You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/03/15 15:26:18 UTC

svn commit: r386079 - in /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework: ./ cache/ searchpolicy/

Author: rickhall
Date: Wed Mar 15 06:26:15 2006
New Revision: 386079

URL: http://svn.apache.org/viewcvs?rev=386079&view=rev
Log:
Renamed DefaultBundleCache to BundleCache and DefaultBundleArchive to
BundleArchive, since the interfaces that previously used those names
were eliminated after the recent refactoring of the bundle cache.

Added:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java
      - copied, changed from r384613, incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java
      - copied, changed from r384613, incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleCache.java
Removed:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleCache.java
Modified:
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/SystemBundleArchive.java
    incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/BundleInfo.java Wed Mar 15 06:26:15 2006
@@ -18,14 +18,14 @@
 
 import java.util.Map;
 
-import org.apache.felix.framework.cache.DefaultBundleArchive;
+import org.apache.felix.framework.cache.BundleArchive;
 import org.apache.felix.moduleloader.IModule;
 import org.osgi.framework.*;
 
 class BundleInfo
 {
     private Logger m_logger = null;
-    private DefaultBundleArchive m_archive = null;
+    private BundleArchive m_archive = null;
     private IModule[] m_modules = null;
     private int m_state = 0;
     private long m_modified = 0;
@@ -39,7 +39,7 @@
     private int m_lockCount = 0;
     private Thread m_lockThread = null;
 
-    protected BundleInfo(Logger logger, DefaultBundleArchive archive, IModule module)
+    protected BundleInfo(Logger logger, BundleArchive archive, IModule module)
         throws Exception
     {
         m_logger = logger;
@@ -56,7 +56,7 @@
      *  Returns the bundle archive associated with this bundle.
      * @return the bundle archive associated with this bundle.
     **/
-    public DefaultBundleArchive getArchive()
+    public BundleArchive getArchive()
     {
         return m_archive;
     }

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/Felix.java Wed Mar 15 06:26:15 2006
@@ -81,7 +81,7 @@
         FelixConstants.FRAMEWORK_INACTIVE_STARTLEVEL;
 
     // Local file system cache.
-    private DefaultBundleCache m_cache = null;
+    private BundleCache m_cache = null;
 
     // Next available bundle identifier.
     private long m_nextId = 1L;
@@ -243,7 +243,7 @@
 
         try
         {
-            m_cache = new DefaultBundleCache(m_config, m_logger);
+            m_cache = new BundleCache(m_config, m_logger);
         }
         catch (Exception ex)
         {
@@ -380,7 +380,7 @@
         }
         
         // Reload and cached bundles.
-        DefaultBundleArchive[] archives = null;
+        BundleArchive[] archives = null;
 
         // First get cached bundle identifiers.
         try
@@ -1522,7 +1522,7 @@
             try
             {
                 // Get the bundle's archive.
-                DefaultBundleArchive archive = m_cache.getArchive(info.getBundleId());
+                BundleArchive archive = m_cache.getArchive(info.getBundleId());
                 // Update the bundle; this operation will increase
                 // the revision count for the bundle.
                 archive.revise(updateLocation, is);
@@ -1904,7 +1904,7 @@
 
             try
             {
-                DefaultBundleArchive archive = m_cache.getArchive(id);
+                BundleArchive archive = m_cache.getArchive(id);
                 bundle = new BundleImpl(this, createBundleInfo(archive));
             }
             catch (Exception ex)
@@ -2826,7 +2826,7 @@
     // Miscellaneous private methods.
     //
 
-    private BundleInfo createBundleInfo(DefaultBundleArchive archive)
+    private BundleInfo createBundleInfo(BundleArchive archive)
         throws Exception
     {
         // Get the bundle manifest.
@@ -3132,7 +3132,7 @@
         if (activator == null)
         {
             // Get the associated bundle archive.
-            DefaultBundleArchive ba = m_cache.getArchive(info.getBundleId());
+            BundleArchive ba = m_cache.getArchive(info.getBundleId());
             // Get the manifest from the current revision; revision is
             // base zero so subtract one from the count to get the
             // current revision.

Copied: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java (from r384613, incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java)
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java?p2=incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java&p1=incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java&r1=384613&r2=386079&rev=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleArchive.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleArchive.java Wed Mar 15 06:26:15 2006
@@ -61,7 +61,7 @@
  * @see org.apache.felix.framework.cache.BundleCache
  * @see org.apache.felix.framework.cache.BundleRevision
 **/
-public class DefaultBundleArchive
+public class BundleArchive
 {
     public static final transient String FILE_PROTOCOL = "file:";
     public static final transient String REFERENCE_PROTOCOL = "reference:";
@@ -97,7 +97,7 @@
      * because it is special an is not really an archive.
      * </p>
     **/
-    DefaultBundleArchive()
+    BundleArchive()
     {
     }
 
@@ -118,7 +118,7 @@
      * @param is input stream from which to read the bundle content.
      * @throws Exception if any error occurs.
     **/
-    public DefaultBundleArchive(
+    public BundleArchive(
         Logger logger, File archiveRootDir, long id, String location, InputStream is)    
         throws Exception
     {
@@ -151,7 +151,7 @@
      * @param id the bundle identifier associated with the archive.
      * @throws Exception if any error occurs.
     **/
-    public DefaultBundleArchive(Logger logger, File archiveRootDir)    
+    public BundleArchive(Logger logger, File archiveRootDir)    
         throws Exception
     {
         m_logger = logger;
@@ -180,7 +180,7 @@
         BufferedReader br = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(new File(m_archiveRootDir, BUNDLE_ID_FILE));
             br = new BufferedReader(new InputStreamReader(is));
             m_id = Long.parseLong(br.readLine());
@@ -194,7 +194,7 @@
             // into them. Eventually, this can be removed.
             m_id = Long.parseLong(
                 m_archiveRootDir.getName().substring(
-                    DefaultBundleCache.BUNDLE_DIR_PREFIX.length()));
+                    BundleCache.BUNDLE_DIR_PREFIX.length()));
         }
         finally
         {
@@ -224,7 +224,7 @@
         BufferedReader br = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(new File(m_archiveRootDir, BUNDLE_LOCATION_FILE));
             br = new BufferedReader(new InputStreamReader(is));
             m_originalLocation = br.readLine();
@@ -258,7 +258,7 @@
 
         // If the state file doesn't exist, then
         // assume the bundle was installed.
-        if (!DefaultBundleCache.getSecureAction().fileExists(stateFile))
+        if (!BundleCache.getSecureAction().fileExists(stateFile))
         {
             return Bundle.INSTALLED;
         }
@@ -268,7 +268,7 @@
         BufferedReader br = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(stateFile);
             br = new BufferedReader(new InputStreamReader(is));
             String s = br.readLine();
@@ -309,7 +309,7 @@
         BufferedWriter bw= null;
         try
         {
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, BUNDLE_STATE_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             String s = null;
@@ -361,7 +361,7 @@
 
         // If the start level file doesn't exist, then
         // return an error.
-        if (!DefaultBundleCache.getSecureAction().fileExists(levelFile))
+        if (!BundleCache.getSecureAction().fileExists(levelFile))
         {
             return -1;
         }
@@ -371,7 +371,7 @@
         BufferedReader br= null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(levelFile);
             br = new BufferedReader(new InputStreamReader(is));
             m_startLevel = Integer.parseInt(br.readLine());
@@ -398,7 +398,7 @@
         BufferedWriter bw = null;
         try
         {
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, BUNDLE_START_LEVEL_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             String s = Integer.toString(level);
@@ -438,9 +438,9 @@
         // Get bundle data directory.
         File dataDir = new File(m_archiveRootDir, DATA_DIRECTORY);
         // Create the data directory if necessary.
-        if (!DefaultBundleCache.getSecureAction().fileExists(dataDir))
+        if (!BundleCache.getSecureAction().fileExists(dataDir))
         {
-            if (!DefaultBundleCache.getSecureAction().mkdir(dataDir))
+            if (!BundleCache.getSecureAction().mkdir(dataDir))
             {
                 throw new IOException("Unable to create bundle data directory.");
             }
@@ -465,7 +465,7 @@
         File activatorFile = new File(m_archiveRootDir, BUNDLE_ACTIVATOR_FILE);
         // If the activator file doesn't exist, then
         // assume there isn't one.
-        if (!DefaultBundleCache.getSecureAction().fileExists(activatorFile))
+        if (!BundleCache.getSecureAction().fileExists(activatorFile))
         {
             return null;
         }
@@ -475,7 +475,7 @@
         ObjectInputStreamX ois = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(activatorFile);
             ois = new ObjectInputStreamX(is, module);
             Object o = ois.readObject();
@@ -515,7 +515,7 @@
         ObjectOutputStream oos = null;
         try
         {
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, BUNDLE_ACTIVATOR_FILE));
             oos = new ObjectOutputStream(os);
             oos.writeObject(obj);
@@ -621,9 +621,9 @@
         {
             m_revisions[i].dispose();
             revisionDir = new File(m_archiveRootDir, REVISION_DIRECTORY + refreshCount + "." + i);
-            if (DefaultBundleCache.getSecureAction().fileExists(revisionDir))
+            if (BundleCache.getSecureAction().fileExists(revisionDir))
             {
-                DefaultBundleCache.deleteDirectoryTree(revisionDir);
+                BundleCache.deleteDirectoryTree(revisionDir);
             }
         }
 
@@ -639,7 +639,7 @@
         // of the new refresh level.
         File currentDir = new File(m_archiveRootDir, REVISION_DIRECTORY + (refreshCount + 1) + ".0");
         revisionDir = new File(m_archiveRootDir, REVISION_DIRECTORY + refreshCount + "." + (count - 1));
-        DefaultBundleCache.getSecureAction().renameFile(revisionDir, currentDir);
+        BundleCache.getSecureAction().renameFile(revisionDir, currentDir);
 
         // Null the revision array since they are all invalid now.
         m_revisions = null;
@@ -657,7 +657,7 @@
     **/
     /* package */ void dispose() throws Exception
     {
-        if (!DefaultBundleCache.deleteDirectoryTree(m_archiveRootDir))
+        if (!BundleCache.deleteDirectoryTree(m_archiveRootDir))
         {
             m_logger.log(
                 Logger.LOG_ERROR,
@@ -683,13 +683,13 @@
         {
             // If the archive directory exists, then we don't
             // need to initialize since it has already been done.
-            if (DefaultBundleCache.getSecureAction().fileExists(m_archiveRootDir))
+            if (BundleCache.getSecureAction().fileExists(m_archiveRootDir))
             {
                 return;
             }
 
             // Create archive directory, if it does not exist.
-            if (!DefaultBundleCache.getSecureAction().mkdir(m_archiveRootDir))
+            if (!BundleCache.getSecureAction().mkdir(m_archiveRootDir))
             {
                 m_logger.log(
                     Logger.LOG_ERROR,
@@ -698,7 +698,7 @@
             }
 
             // Save id.
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, BUNDLE_ID_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             bw.write(Long.toString(m_id), 0, Long.toString(m_id).length());
@@ -706,7 +706,7 @@
             os.close();
 
             // Save location string.
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, BUNDLE_LOCATION_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             bw.write(m_originalLocation, 0, m_originalLocation.length());
@@ -741,7 +741,7 @@
         BufferedReader br = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(new File(m_archiveRootDir, CURRENT_LOCATION_FILE));
             br = new BufferedReader(new InputStreamReader(is));
             m_currentLocation = br.readLine();
@@ -775,7 +775,7 @@
         BufferedWriter bw = null;
         try
         {
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(new File(m_archiveRootDir, CURRENT_LOCATION_FILE));
             bw = new BufferedWriter(new OutputStreamWriter(os));
             bw.write(location, 0, location.length());
@@ -822,7 +822,7 @@
 
                 // Make sure the referenced file exists.
                 File file = new File(location.substring(FILE_PROTOCOL.length()));
-                if (!DefaultBundleCache.getSecureAction().fileExists(file))
+                if (!BundleCache.getSecureAction().fileExists(file))
                 {
                     throw new IOException("Referenced file does not exist: " + file);
                 }
@@ -830,7 +830,7 @@
                 // If the referenced file is a directory, then create a directory
                 // revision; otherwise, create a JAR revision with the reference
                 // flag set to true.
-                if (DefaultBundleCache.getSecureAction().isFileDirectory(file))
+                if (BundleCache.getSecureAction().isFileDirectory(file))
                 {
                     return new DirectoryRevision(m_logger, revisionRootDir, location);
                 }
@@ -852,9 +852,9 @@
         }
         catch (Exception ex)
         {
-            if (DefaultBundleCache.getSecureAction().fileExists(revisionRootDir))
+            if (BundleCache.getSecureAction().fileExists(revisionRootDir))
             {
-                if (!DefaultBundleCache.deleteDirectoryTree(revisionRootDir))
+                if (!BundleCache.deleteDirectoryTree(revisionRootDir))
                 {
                     m_logger.log(
                         Logger.LOG_ERROR,
@@ -895,7 +895,7 @@
 
         // If the refresh counter file doesn't exist, then
         // assume the counter is at zero.
-        if (!DefaultBundleCache.getSecureAction().fileExists(counterFile))
+        if (!BundleCache.getSecureAction().fileExists(counterFile))
         {
             return 0;
         }
@@ -905,7 +905,7 @@
         BufferedReader br = null;
         try
         {
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(counterFile);
             br = new BufferedReader(new InputStreamReader(is));
             long counter = Long.parseLong(br.readLine());
@@ -943,7 +943,7 @@
         BufferedWriter bw = null;
         try
         {
-            os = DefaultBundleCache.getSecureAction()
+            os = BundleCache.getSecureAction()
                 .getFileOutputStream(counterFile);
             bw = new BufferedWriter(new OutputStreamWriter(os));
             String s = Long.toString(counter);

Copied: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java (from r384613, incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleCache.java)
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java?p2=incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java&p1=incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleCache.java&r1=384613&r2=386079&rev=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DefaultBundleCache.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/BundleCache.java Wed Mar 15 06:26:15 2006
@@ -67,9 +67,9 @@
  * For specific information on how to configure Felix using system properties,
  * refer to the Felix usage documentation.
  * </p>
- * @see org.apache.felix.framework.util.DefaultBundleArchive
+ * @see org.apache.felix.framework.util.BundleArchive
 **/
-public class DefaultBundleCache
+public class BundleCache
 {
     public static final String CACHE_BUFSIZE_PROP = "felix.cache.bufsize";
     public static final String CACHE_DIR_PROP = "felix.cache.dir";
@@ -83,11 +83,11 @@
     private PropertyResolver m_cfg = null;
     private Logger m_logger = null;
     private File m_profileDir = null;
-    private DefaultBundleArchive[] m_archives = null;
+    private BundleArchive[] m_archives = null;
 
     private static SecureAction m_secureAction = new SecureAction();
 
-    public DefaultBundleCache(PropertyResolver cfg, Logger logger)
+    public BundleCache(PropertyResolver cfg, Logger logger)
         throws Exception
     {
         m_cfg = cfg;
@@ -100,13 +100,13 @@
         return m_secureAction;
     }
 
-    public synchronized DefaultBundleArchive[] getArchives()
+    public synchronized BundleArchive[] getArchives()
         throws Exception
     {
         return m_archives;
     }
 
-    public synchronized DefaultBundleArchive getArchive(long id)
+    public synchronized BundleArchive getArchive(long id)
         throws Exception
     {
         for (int i = 0; i < m_archives.length; i++)
@@ -119,7 +119,7 @@
         return null;
     }
 
-    public synchronized int getArchiveIndex(DefaultBundleArchive ba)
+    public synchronized int getArchiveIndex(BundleArchive ba)
     {
         for (int i = 0; i < m_archives.length; i++)
         {
@@ -131,7 +131,7 @@
         return -1;
     }
 
-    public synchronized DefaultBundleArchive create(
+    public synchronized BundleArchive create(
         long id, String location, InputStream is)
         throws Exception
     {
@@ -142,9 +142,9 @@
         try
         {
             // Create the archive and add it to the list of archives.
-            DefaultBundleArchive ba =
-                new DefaultBundleArchive(m_logger, archiveRootDir, id, location, is);
-            DefaultBundleArchive[] tmp = new DefaultBundleArchive[m_archives.length + 1];
+            BundleArchive ba =
+                new BundleArchive(m_logger, archiveRootDir, id, location, is);
+            BundleArchive[] tmp = new BundleArchive[m_archives.length + 1];
             System.arraycopy(m_archives, 0, tmp, 0, m_archives.length);
             tmp[m_archives.length] = ba;
             m_archives = tmp;
@@ -154,7 +154,7 @@
         {
             if (m_secureAction.fileExists(archiveRootDir))
             {
-                if (!DefaultBundleCache.deleteDirectoryTree(archiveRootDir))
+                if (!BundleCache.deleteDirectoryTree(archiveRootDir))
                 {
                     m_logger.log(
                         Logger.LOG_ERROR,
@@ -167,7 +167,7 @@
         }
     }
 
-    public synchronized void remove(DefaultBundleArchive ba)
+    public synchronized void remove(BundleArchive ba)
         throws Exception
     {
         // Remove the archive.
@@ -176,8 +176,8 @@
         int idx = getArchiveIndex(ba);
         if (idx >= 0)
         {
-            DefaultBundleArchive[] tmp =
-                new DefaultBundleArchive[m_archives.length - 1];
+            BundleArchive[] tmp =
+                new BundleArchive[m_archives.length - 1];
             System.arraycopy(m_archives, 0, tmp, 0, idx);
             if (idx < tmp.length)
             {
@@ -330,7 +330,7 @@
                 try
                 {
                     archiveList.add(
-                        new DefaultBundleArchive(m_logger, children[i]));
+                        new BundleArchive(m_logger, children[i]));
                 }
                 catch (Exception ex)
                 {
@@ -341,7 +341,7 @@
             }
         }
         
-        m_archives = (DefaultBundleArchive[])
-            archiveList.toArray(new DefaultBundleArchive[archiveList.size()]);
+        m_archives = (BundleArchive[])
+            archiveList.toArray(new BundleArchive[archiveList.size()]);
     }
 }

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/DirectoryRevision.java Wed Mar 15 06:26:15 2006
@@ -42,8 +42,8 @@
     {
         super(logger, revisionRootDir, location);
         m_refDir = new File(location.substring(
-            location.indexOf(DefaultBundleArchive.FILE_PROTOCOL)
-                + DefaultBundleArchive.FILE_PROTOCOL.length()));
+            location.indexOf(BundleArchive.FILE_PROTOCOL)
+                + BundleArchive.FILE_PROTOCOL.length()));
     }
 
     public synchronized Map getManifestHeader()
@@ -60,7 +60,7 @@
         try
         {
             // Open manifest file.
-            is = DefaultBundleCache.getSecureAction()
+            is = BundleCache.getSecureAction()
                 .getFileInputStream(new File(m_refDir, "META-INF/MANIFEST.MF"));
             // Error if no jar file.
             if (is == null)
@@ -121,7 +121,7 @@
             {
                 // Determine if the class path entry is a file or directory.
                 File file = new File(m_refDir, classPathStrings[i]);
-                if (DefaultBundleCache.getSecureAction().isFileDirectory(file))
+                if (BundleCache.getSecureAction().isFileDirectory(file))
                 {
                     contentPath[i] = new DirectoryContent(file);
                 }
@@ -145,7 +145,7 @@
 // TODO: This will need to consider security.
     public String findLibrary(String libName) throws Exception
     {
-        return DefaultBundleCache.getSecureAction().getAbsolutePath(new File(m_refDir, libName));
+        return BundleCache.getSecureAction().getAbsolutePath(new File(m_refDir, libName));
     }
 
     public void dispose() throws Exception

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/JarRevision.java Wed Mar 15 06:26:15 2006
@@ -66,8 +66,8 @@
         if (byReference)
         {
             m_bundleFile = new File(location.substring(
-                location.indexOf(DefaultBundleArchive.FILE_PROTOCOL)
-                    + DefaultBundleArchive.FILE_PROTOCOL.length()));
+                location.indexOf(BundleArchive.FILE_PROTOCOL)
+                    + BundleArchive.FILE_PROTOCOL.length()));
         }
         else
         {
@@ -91,7 +91,7 @@
         try
         {
             // Open bundle JAR file.
-            jarFile = DefaultBundleCache.getSecureAction().openJAR(m_bundleFile);
+            jarFile = BundleCache.getSecureAction().openJAR(m_bundleFile);
             // Error if no jar file.
             if (jarFile == null)
             {
@@ -144,7 +144,7 @@
         JarFile bundleJar = null;
         try
         {
-            bundleJar = DefaultBundleCache.getSecureAction().openJAR(m_bundleFile);
+            bundleJar = BundleCache.getSecureAction().openJAR(m_bundleFile);
             IContent self = new JarContent(m_bundleFile);
             IContent[] contentPath = new IContent[classPathStrings.length];
             for (int i = 0; i < classPathStrings.length; i++)
@@ -194,37 +194,37 @@
         // Make sure that the library's parent directory exists;
         // it may be in a sub-directory.
         libDir = libFile.getParentFile();
-        if (!DefaultBundleCache.getSecureAction().fileExists(libDir))
+        if (!BundleCache.getSecureAction().fileExists(libDir))
         {
-            if (!DefaultBundleCache.getSecureAction().mkdirs(libDir))
+            if (!BundleCache.getSecureAction().mkdirs(libDir))
             {
                 throw new IOException("Unable to create library directory.");
             }
         }
         // Extract the library from the JAR file if it does not
         // already exist.
-        if (!DefaultBundleCache.getSecureAction().fileExists(libFile))
+        if (!BundleCache.getSecureAction().fileExists(libFile))
         {
             JarFile bundleJar = null;
             InputStream is = null;
 
             try
             {
-                bundleJar = DefaultBundleCache.getSecureAction().openJAR(m_bundleFile);
+                bundleJar = BundleCache.getSecureAction().openJAR(m_bundleFile);
                 ZipEntry ze = bundleJar.getEntry(libName);
                 if (ze == null)
                 {
                     throw new IOException("No JAR entry: " + libName);
                 }
                 is = new BufferedInputStream(
-                    bundleJar.getInputStream(ze), DefaultBundleCache.BUFSIZE);
+                    bundleJar.getInputStream(ze), BundleCache.BUFSIZE);
                 if (is == null)
                 {
                     throw new IOException("No input stream: " + libName);
                 }
 
                 // Create the file.
-                DefaultBundleCache.copyStreamToFile(is, libFile);
+                BundleCache.copyStreamToFile(is, libFile);
             }
             finally
             {
@@ -233,7 +233,7 @@
             }
         }
 
-        return DefaultBundleCache.getSecureAction().getAbsolutePath(libFile);
+        return BundleCache.getSecureAction().getAbsolutePath(libFile);
     }
 
     public void dispose() throws Exception
@@ -254,13 +254,13 @@
         {
             // If the revision directory exists, then we don't
             // need to initialize since it has already been done.
-            if (DefaultBundleCache.getSecureAction().fileExists(getRevisionRootDir()))
+            if (BundleCache.getSecureAction().fileExists(getRevisionRootDir()))
             {
                 return;
             }
 
             // Create revision directory, if it does not exist.
-            if (!DefaultBundleCache.getSecureAction().mkdir(getRevisionRootDir()))
+            if (!BundleCache.getSecureAction().mkdir(getRevisionRootDir()))
             {
                 getLogger().log(
                     Logger.LOG_ERROR,
@@ -278,7 +278,7 @@
                     URLConnection conn = url.openConnection(); 
         
                     // Support for http proxy authentication.
-                    String auth = DefaultBundleCache.getSecureAction()
+                    String auth = BundleCache.getSecureAction()
                         .getSystemProperty("http.proxyAuth", null);
                     if ((auth != null) && (auth.length() > 0))
                     {
@@ -294,7 +294,7 @@
                 }
     
                 // Save the bundle jar file.
-                DefaultBundleCache.copyStreamToFile(is, m_bundleFile);
+                BundleCache.copyStreamToFile(is, m_bundleFile);
             }
 
             // This will always be revision zero.
@@ -320,18 +320,18 @@
         //
 
         File embedDir = new File(getRevisionRootDir(), EMBEDDED_DIRECTORY);
-        if (!DefaultBundleCache.getSecureAction().fileExists(embedDir))
+        if (!BundleCache.getSecureAction().fileExists(embedDir))
         {
-            if (!DefaultBundleCache.getSecureAction().mkdir(embedDir))
+            if (!BundleCache.getSecureAction().mkdir(embedDir))
             {
                 throw new IOException("Could not create embedded JAR directory.");
             }
         }
 
         File libDir = new File(getRevisionRootDir(), LIBRARY_DIRECTORY);
-        if (!DefaultBundleCache.getSecureAction().fileExists(libDir))
+        if (!BundleCache.getSecureAction().fileExists(libDir))
         {
-            if (!DefaultBundleCache.getSecureAction().mkdir(libDir))
+            if (!BundleCache.getSecureAction().mkdir(libDir))
             {
                 throw new IOException("Unable to create native library directory.");
             }
@@ -394,14 +394,14 @@
         File jarFile = new File(
             getRevisionRootDir(), EMBEDDED_DIRECTORY + File.separatorChar + jarPath);
 
-        if (!DefaultBundleCache.getSecureAction().fileExists(jarFile))
+        if (!BundleCache.getSecureAction().fileExists(jarFile))
         {
             JarFile bundleJar = null;
             InputStream is = null;
             try
             {
                 // Make sure class path entry is a JAR file.
-                bundleJar = DefaultBundleCache.getSecureAction().openJAR(m_bundleFile);
+                bundleJar = BundleCache.getSecureAction().openJAR(m_bundleFile);
                 ZipEntry ze = bundleJar.getEntry(jarPath);
                 if (ze == null)
                 {
@@ -415,22 +415,22 @@
                     // Make sure that the embedded JAR's parent directory exists;
                     // it may be in a sub-directory.
                     File jarDir = jarFile.getParentFile();
-                    if (!DefaultBundleCache.getSecureAction().fileExists(jarDir))
+                    if (!BundleCache.getSecureAction().fileExists(jarDir))
                     {
-                        if (!DefaultBundleCache.getSecureAction().mkdirs(jarDir))
+                        if (!BundleCache.getSecureAction().mkdirs(jarDir))
                         {
                             throw new IOException("Unable to create embedded JAR directory.");
                         }
                     }
     
                     // Extract embedded JAR into its directory.
-                    is = new BufferedInputStream(bundleJar.getInputStream(ze), DefaultBundleCache.BUFSIZE);
+                    is = new BufferedInputStream(bundleJar.getInputStream(ze), BundleCache.BUFSIZE);
                     if (is == null)
                     {
                         throw new IOException("No input stream: " + jarPath);
                     }
                     // Copy the file.
-                    DefaultBundleCache.copyStreamToFile(is, jarFile);
+                    BundleCache.copyStreamToFile(is, jarFile);
                 }
             }
             finally

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/SystemBundleArchive.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/SystemBundleArchive.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/SystemBundleArchive.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/cache/SystemBundleArchive.java Wed Mar 15 06:26:15 2006
@@ -33,7 +33,7 @@
  * bundle is not a real archive.
  * </p>
 **/
-public class SystemBundleArchive extends DefaultBundleArchive
+public class SystemBundleArchive extends BundleArchive
 {
     private Map m_headerMap = null;
     private BundleRevision m_revision = null;

Modified: incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java?rev=386079&r1=386078&r2=386079&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java (original)
+++ incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework/searchpolicy/R4Library.java Wed Mar 15 06:26:15 2006
@@ -17,13 +17,13 @@
 package org.apache.felix.framework.searchpolicy;
 
 import org.apache.felix.framework.Logger;
-import org.apache.felix.framework.cache.DefaultBundleCache;
+import org.apache.felix.framework.cache.BundleCache;
 import org.osgi.framework.Constants;
 
 public class R4Library
 {
     private Logger m_logger = null;
-    private DefaultBundleCache m_cache = null;
+    private BundleCache m_cache = null;
     private long m_bundleId = -1;
     private int m_revision = -1;
     private String m_os = null;
@@ -31,7 +31,7 @@
     private R4LibraryHeader m_header = null;
 
     public R4Library(
-        Logger logger, DefaultBundleCache cache, long bundleId, int revision,
+        Logger logger, BundleCache cache, long bundleId, int revision,
         String os, String processor, R4LibraryHeader header)
     {
         m_logger = logger;