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/04 04:44:06 UTC

svn commit: r383016 - in /incubator/felix/trunk/org.apache.felix.framework/src/main/java/org/apache/felix/framework: Felix.java cache/DefaultBundleArchive.java cache/DefaultBundleCache.java

Author: rickhall
Date: Fri Mar  3 19:44:05 2006
New Revision: 383016

URL: http://svn.apache.org/viewcvs?rev=383016&view=rev
Log:
Fixed a bug in installing bundles where the input stream was being
ignored if supplied. This bug was introduced when the changes for supporting
bundle install by reference an exploded directories were recently introduced.

Modified:
    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/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/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=383016&r1=383015&r2=383016&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 Fri Mar  3 19:44:05 2006
@@ -1859,7 +1859,7 @@
                 try
                 {
                     // Add the bundle to the cache.
-                    m_cache.create(id, location);
+                    m_cache.create(id, location, is);
                 }
                 catch (Exception ex)
                 {
@@ -3925,4 +3925,4 @@
             m_bundleLock.notifyAll();
         }
     }
-}
\ No newline at end of file
+}

Modified: 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/DefaultBundleArchive.java?rev=383016&r1=383015&r2=383016&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/DefaultBundleArchive.java Fri Mar  3 19:44:05 2006
@@ -105,18 +105,21 @@
      * <p>
      * This constructor is used for creating new archives when a bundle is
      * installed into the framework. Each archive receives a logger, a root
-     * directory, its associated bundle identifier, and the associated bundle
-     * location string. The root directory is where any required state can be
-     * stored.
+     * directory, its associated bundle identifier, the associated bundle
+     * location string, and an input stream from which to read the bundle
+     * content. The root directory is where any required state can be
+     * stored. The input stream may be null, in which case the location is
+     * used as an URL to the bundle content.
      * </p>
      * @param logger the logger to be used by the archive.
      * @param archiveRootDir the archive root directory for storing state.
      * @param id the bundle identifier associated with the archive.
      * @param location the bundle location string associated with the archive.
+     * @param is input stream from which to read the bundle content.
      * @throws Exception if any error occurs.
     **/
     public DefaultBundleArchive(
-        Logger logger, File archiveRootDir, long id, String location)    
+        Logger logger, File archiveRootDir, long id, String location, InputStream is)    
         throws Exception
     {
         m_logger = logger;
@@ -133,7 +136,7 @@
         initialize();
 
         // Add a revision for the content.
-        revise(getCurrentLocation(), null);
+        revise(getCurrentLocation(), is);
     }
 
     /**
@@ -958,4 +961,4 @@
             if (os != null) os.close();
         }
     }
-}
\ No newline at end of file
+}

Modified: 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/DefaultBundleCache.java?rev=383016&r1=383015&r2=383016&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/DefaultBundleCache.java Fri Mar  3 19:44:05 2006
@@ -131,7 +131,8 @@
         return -1;
     }
 
-    public synchronized DefaultBundleArchive create(long id, String location)
+    public synchronized DefaultBundleArchive create(
+        long id, String location, InputStream is)
         throws Exception
     {
         // Construct archive root directory.
@@ -141,7 +142,8 @@
         try
         {
             // Create the archive and add it to the list of archives.
-            DefaultBundleArchive ba = new DefaultBundleArchive(m_logger, archiveRootDir, id, location);
+            DefaultBundleArchive ba =
+                new DefaultBundleArchive(m_logger, archiveRootDir, id, location, is);
             DefaultBundleArchive[] tmp = new DefaultBundleArchive[m_archives.length + 1];
             System.arraycopy(m_archives, 0, tmp, 0, m_archives.length);
             tmp[m_archives.length] = ba;
@@ -342,4 +344,4 @@
         m_archives = (DefaultBundleArchive[])
             archiveList.toArray(new DefaultBundleArchive[archiveList.size()]);
     }
-}
\ No newline at end of file
+}