geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r915523 - in /geronimo/server/trunk/framework/modules: geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/ geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/ geronimo-service-builder/src/main/xsd/
Date Tue, 23 Feb 2010 21:14:08 GMT
Author: gawor
Date: Tue Feb 23 21:14:08 2010
New Revision: 915523

URL: http://svn.apache.org/viewvc?rev=915523&view=rev
Log:
add support for Require-Bundle header in configuration environment

Modified:
    geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
    geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
    geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/xsd/geronimo-module-1.2.xsd

Modified: geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java?rev=915523&r1=915522&r2=915523&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
Tue Feb 23 21:14:08 2010
@@ -41,6 +41,7 @@
     private final LinkedHashSet<String> bundleClassPath = new LinkedHashSet<String>();
     private final LinkedHashSet<String> imports = new LinkedHashSet<String>();
     private final LinkedHashSet<String> exports = new LinkedHashSet<String>();
+    private final LinkedHashSet<String> requireBundles = new LinkedHashSet<String>();
     private String bundleActivator;
     private final ClassLoadingRules classLoadingRules;
     private boolean suppressDefaultEnvironment;
@@ -61,6 +62,7 @@
         bundleClassPath.addAll(environment.bundleClassPath);
         imports.addAll(environment.imports);
         exports.addAll(environment.exports);
+        requireBundles.addAll(environment.requireBundles);
         bundleActivator = environment.bundleActivator;
         suppressDefaultEnvironment = environment.isSuppressDefaultEnvironment();
         classLoadingRules = environment.classLoadingRules;
@@ -158,6 +160,18 @@
         this.bundleActivator = bundleActivator;
     }
 
+    public void addRequireBundles(Collection<String> symbolicNames) {
+        this.requireBundles.addAll(symbolicNames);
+    }
+
+    public void addRequireBundle(String symbolicName) {
+        this.requireBundles.add(symbolicName);
+    }
+
+    public List<String> getRequireBundles() {
+        return Collections.unmodifiableList(new ArrayList<String>(requireBundles));
+    }
+        
     public Manifest getManifest() throws ManifestException {
         Manifest manifest = new Manifest();
         manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION,
"2"));
@@ -185,6 +199,11 @@
             Manifest.Attribute bundleClassPath = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA,
Constants.BUNDLE_CLASSPATH, this.bundleClassPath);
             manifest.addConfiguredAttribute(bundleClassPath);
         }
+        
+        if (!requireBundles.isEmpty()) {
+            Manifest.Attribute requireBundle = new Manifest.Attribute(Manifest.Attribute.Separator.COMMA,
Constants.REQUIRE_BUNDLE, this.requireBundles);
+            manifest.addConfiguredAttribute(requireBundle);
+        }
         return manifest;
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=915523&r1=915522&r2=915523&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
Tue Feb 23 21:14:08 2010
@@ -75,8 +75,10 @@
             for (String exportPackage: environmentType.getExportPackageArray()) {
                 environment.addExportPackage(trim(exportPackage));
             }
-            
-            
+            for (String requireBundle : environmentType.getRequireBundleArray()) {
+                environment.addRequireBundle(requireBundle);
+            }
+                        
             environment.setSuppressDefaultEnvironment(environmentType.isSetSuppressDefaultEnvironment());
             
             ClassLoadingRulesUtil.configureRules(environment.getClassLoadingRules(), environmentType);
@@ -95,6 +97,7 @@
             environment.addToBundleClassPath(additionalEnvironment.getBundleClassPath());
             environment.addImportPackages(additionalEnvironment.getImportPackages());
             environment.addExportPackages(additionalEnvironment.getExportPackages());
+            environment.addRequireBundles(additionalEnvironment.getRequireBundles());
             if (environment.getBundleActivator() == null && additionalEnvironment.getBundleActivator()
!= null) {
                 environment.setBundleActivator(additionalEnvironment.getBundleActivator());
             }
@@ -139,6 +142,9 @@
         for (String exportPackage: environment.getExportPackages()) {
             environmentType.addExportPackage(exportPackage);
         }
+        for (String requireBundle : environment.getRequireBundles()) {
+            environmentType.addRequireBundle(requireBundle);
+        }
         
         ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
         if (classLoadingRules.isInverseClassLoading()) {

Modified: geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/xsd/geronimo-module-1.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/xsd/geronimo-module-1.2.xsd?rev=915523&r1=915522&r2=915523&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/xsd/geronimo-module-1.2.xsd
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-service-builder/src/main/xsd/geronimo-module-1.2.xsd
Tue Feb 23 21:14:08 2010
@@ -164,6 +164,7 @@
             <xs:element name="bundle-classPath" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="import-package" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="export-package" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="require-bundle" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
 
             <xs:element name="hidden-classes" type="sys:classFilterType"
                 minOccurs="0">



Mime
View raw message