felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r372838 - /incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java
Date Fri, 27 Jan 2006 13:21:32 GMT
Author: rickhall
Date: Fri Jan 27 05:21:25 2006
New Revision: 372838

URL: http://svn.apache.org/viewcvs?rev=372838&view=rev
Log:
Modified so that it constructs pieces of the new module abstraction.

Modified:
    incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java

Modified: incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java
URL: http://svn.apache.org/viewcvs/incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java?rev=372838&r1=372837&r2=372838&view=diff
==============================================================================
--- incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java
(original)
+++ incubator/felix/sandbox/rickhall/framework-branch/src/main/java/org/apache/felix/framework/SystemBundle.java
Fri Jan 27 05:21:25 2006
@@ -1,5 +1,5 @@
 /*
- *   Copyright 2005 The Apache Software Foundation
+ *   Copyright 2006 The Apache Software Foundation
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -24,18 +24,16 @@
 import org.apache.felix.framework.searchpolicy.*;
 import org.apache.felix.framework.util.FelixConstants;
 import org.apache.felix.framework.util.StringMap;
-import org.apache.felix.moduleloader.LibrarySource;
-import org.apache.felix.moduleloader.ResourceSource;
+import org.apache.felix.moduleloader.*;
 import org.osgi.framework.*;
 
-
 class SystemBundle extends BundleImpl
 {
     private List m_activatorList = null;
     private BundleActivator m_activator = null;
     private Thread m_shutdownThread = null;
     private Object[][] m_attributes = null;
-    private ResourceSource[] m_resSources = null;
+    private IContentLoader m_contentLoader = null;
     private LibrarySource[] m_libSources = null;
 
     protected SystemBundle(Felix felix, BundleInfo info, List activatorList)
@@ -66,14 +64,15 @@
 
         // Get system property that specifies which class path
         // packages should be exported by the system bundle.
-        R4Package[] classPathPkgs = null;
+        IPackage[] classPathPkgs = null;
         try
         {
-            classPathPkgs = R4Package.parseImportOrExportHeader(
+            classPathPkgs = PackageImpl.parseImportOrExportHeader(
                 getFelix().getConfig().get(FelixConstants.FRAMEWORK_SYSTEMPACKAGES));
         }
         catch (Exception ex)
         {
+            classPathPkgs = new IPackage[0];
             getFelix().getLogger().log(
                 LogWrapper.LOG_ERROR,
                 "Error parsing system bundle export statement.", ex);
@@ -81,37 +80,40 @@
 
         // Now, create the list of standard framework exports for
         // the system bundle.
-        R4Package[] exports = new R4Package[classPathPkgs.length + 4];
+        IExport[] exports = new IExport[classPathPkgs.length + 4];
 
-        exports[0] = new R4Package(
+        exports[0] = new ExportImpl(
             "org.osgi.framework",
             new R4Directive[0],
             new R4Attribute[] { new R4Attribute("version", "1.3.0", false) });
 
-        exports[1] = new R4Package(
+        exports[1] = new ExportImpl(
             "org.osgi.service.packageadmin",
             new R4Directive[0],
             new R4Attribute[] { new R4Attribute("version", "1.2.0", false) });
 
-        exports[2] = new R4Package(
+        exports[2] = new ExportImpl(
                 "org.osgi.service.startlevel",
                 new R4Directive[0],
                 new R4Attribute[] { new R4Attribute("version", "1.0.0", false) });
 
-        exports[3] = new R4Package(
+        exports[3] = new ExportImpl(
                 "org.osgi.service.url",
                 new R4Directive[0],
                 new R4Attribute[] { new R4Attribute("version", "1.0.0", false) });
 
         // Copy the class path exported packages.
-        System.arraycopy(classPathPkgs, 0, exports, 4, classPathPkgs.length);
+        for (int i = 0; i < classPathPkgs.length; i++)
+        {
+            exports[i + 4] = new ExportImpl(classPathPkgs[i]);
+        }
 
         m_attributes = new Object[][] {
-            new Object[] { R4SearchPolicy.EXPORTS_ATTR, exports },
-            new Object[] { R4SearchPolicy.IMPORTS_ATTR, new R4Package[0] }
+            new Object[] { SearchPolicyImpl.EXPORTS_ATTR, exports },
+            new Object[] { SearchPolicyImpl.IMPORTS_ATTR, new IImport[0] }
         };
 
-        m_resSources = new ResourceSource[0];
+        m_contentLoader = new SystemBundleContentLoader();
 
         m_libSources = null;
 
@@ -119,17 +121,17 @@
         for (int i = 0; i < exports.length; i++)
         {
             exportString = exportString +
-            exports[i].getId()
+            exports[i].getName()
             + "; specification-version=\""
-            + exports[i].getVersionLow().toString() + "\"";
+            + exports[i].getVersion().toString() + "\"";
 
             if (i < (exports.length - 1))
             {
                 exportString = exportString + ", ";
                 exportString = exportString +
-                    exports[i].getId()
+                    exports[i].getName()
                     + "; specification-version=\""
-                    + exports[i].getVersionLow().toString() + "\", ";
+                    + exports[i].getVersion().toString() + "\", ";
             }
         }
 
@@ -148,9 +150,9 @@
         return m_attributes;
     }
 
-    public ResourceSource[] getResourceSources()
+    public IContentLoader getContentLoader()
     {
-        return m_resSources;
+        return m_contentLoader;
     }
 
     public LibrarySource[] getLibrarySources()



Mime
View raw message