You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2011/05/12 01:18:00 UTC

svn commit: r1102134 - in /geronimo/server/branches/3.0-osgi/framework/modules: geronimo-deployment/ geronimo-deployment/src/main/java/org/apache/geronimo/deployment/ geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ geronimo-kernel/src/...

Author: djencks
Date: Wed May 11 23:17:59 2011
New Revision: 1102134

URL: http://svn.apache.org/viewvc?rev=1102134&view=rev
Log:
Untested code to use bnd for constructing application (car) manifests

Added:
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java   (with props)
Modified:
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/pom.xml
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/EnvironmentType.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/ObjectFactory.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/resources/geronimo-module-1.2.xsd
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditorTest.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/pom.xml?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/pom.xml (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/pom.xml Wed May 11 23:17:59 2011
@@ -45,6 +45,18 @@
             <version>${project.version}</version>
         </dependency>
 
+        <dependency>
+          <groupId>biz.aQute</groupId>
+          <artifactId>bndlib</artifactId>
+          <version>0.0.397</version>
+          <!--<scope>provided</scope>-->
+        </dependency>
+        <!--<dependency>-->
+          <!--<groupId>net.sf.kxml</groupId>-->
+          <!--<artifactId>kxml2</artifactId>-->
+          <!--<version>2.2.2</version>-->
+        <!--</dependency>-->
+
         <!--<dependency>-->
             <!--<groupId>org.apache.servicemix.bundles</groupId>-->
             <!--<artifactId>org.apache.servicemix.bundles.xmlbeans</artifactId>-->

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/DeploymentContext.java Wed May 11 23:17:59 2011
@@ -33,12 +33,16 @@ import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
+import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import aQute.lib.osgi.Analyzer;
+import aQute.lib.osgi.Jar;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.IllegalConfigurationException;
 import org.apache.geronimo.deployment.util.osgi.DummyExportPackagesSelector;
@@ -57,8 +61,8 @@ import org.apache.geronimo.kernel.Naming
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.Manifest;
-import org.apache.geronimo.kernel.config.ManifestException;
+//import org.apache.geronimo.kernel.config.Manifest;
+//import org.apache.geronimo.kernel.config.ManifestException;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
@@ -71,6 +75,7 @@ import org.apache.geronimo.system.plugin
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -182,7 +187,6 @@ public class DeploymentContext {
     }
 
     private Configuration createTempConfiguration() throws DeploymentException {
-        LinkedHashSet<Artifact> resolvedParentIds = null;
         try {
             ConfigurationData configurationData = new ConfigurationData(moduleType, null, childConfigurationDatas, environment, baseDir, inPlaceConfigurationDir, naming);
             tempBundleFile = FileUtils.createTempFile();
@@ -201,7 +205,7 @@ public class DeploymentContext {
 //            configurationManager.startConfiguration(environment.getConfigId());
 //            return configurationManager.getConfiguration(environment.getConfigId());
         } catch (Exception e) {
-            throw new DeploymentException("Unable to create configuration for deployment: dependencies: " + resolvedParentIds, e);
+            throw new DeploymentException("Unable to create configuration for deployment: " + environment.getConfigId(), e);
         }
     }
 
@@ -239,21 +243,57 @@ public class DeploymentContext {
         } catch (IllegalConfigurationException e) {
             throw new DeploymentException(e);
         }
-        Manifest manifest;
-        try {
-            manifest = env.getManifest();
-        } catch (ManifestException e) {
-            throw new DeploymentException(e);
-        }
+        //TODO what manifest to use here??
+        Manifest manifest = calculateManifest();
+//        try {
+//            manifest = env.getManifest();
+//        } catch (ManifestException e) {
+//            throw new DeploymentException(e);
+//        }
 
+//        Artifact configId = environment.getConfigId();
+//        manifest = new Manifest();
+//        manifest.getMainAttributes().put(Constants.BUNDLE_MANIFESTVERSION, "2");
+//        manifest.getMainAttributes().put(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId());
+//        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
+//        if (configId.getVersion().getQualifier() != null) {
+//            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
+//        }
+//
+//        manifest.getMainAttributes().put(Constants.BUNDLE_VERSION, versionString);
+//
+//        if (bundleActivator != null) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
+//        }
+//
+//        if (!imports.isEmpty()) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
+//        }
+//
+//        if (!exports.isEmpty()) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
+//        }
+//
+//        if (!dynamicImports.isEmpty()) {
+            manifest.getMainAttributes().put(new Attributes.Name(Constants.DYNAMICIMPORT_PACKAGE), "*");
+//        }
+//
+//        if (!bundleClassPath.isEmpty()) {
+//            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;
         File metaInf = new File(getConfigurationDir(), "META-INF");
         metaInf.mkdirs();
-        FileWriter fw = new FileWriter(new File(metaInf, "MANIFEST.MF"));
-        PrintWriter pw = new PrintWriter(fw);
+        OutputStream fw = new FileOutputStream(new File(metaInf, "MANIFEST.MF"));
         try {
-            manifest.write(pw);
+            manifest.write(fw);
         } finally {
-            pw.close();
             fw.close();
         }
     }
@@ -537,13 +577,14 @@ public class DeploymentContext {
 //            throw new DeploymentException(message.toString());
 //        }
 
-        // TODO OSGI figure out exports
-        environment.addToBundleClassPath(bundleClassPath);
-
         List<GBeanData> gbeans = new ArrayList<GBeanData>(configuration.getGBeans().values());
         Collections.sort(gbeans, new GBeanData.PriorityComparator());
 
-        OSGiMetaDataBuilder osgiMetaDataBuilder = null;
+        // TODO OSGI figure out exports
+        environment.addToBundleClassPath(bundleClassPath);
+        environment.setManifest(calculateManifest());
+
+//        OSGiMetaDataBuilder osgiMetaDataBuilder = null;
         //TODO Import package calculation is only used for deployed applications, should be use the same way for car package later
 //        if (System.getProperty("geronimo.build.car") == null) {
 //            osgiMetaDataBuilder = new OSGiMetaDataBuilder(bundleContext);
@@ -557,7 +598,7 @@ public class DeploymentContext {
 //            environment.addImportPackages(imports);
 //        }
 //            environment.addDynamicImportPackage("*");
-            osgiMetaDataBuilder = new OSGiMetaDataBuilder(bundleContext, new DummyExportPackagesSelector());
+//            osgiMetaDataBuilder = new OSGiMetaDataBuilder(bundleContext, new DummyExportPackagesSelector());
 //        }
 
 //        try {
@@ -590,6 +631,27 @@ public class DeploymentContext {
         return configurationData;
     }
 
+    private java.util.jar.Manifest calculateManifest() {
+        try {
+            Jar dot = new Jar("dot", getBaseDir());
+            Analyzer analyzer = new Analyzer();
+            analyzer.setJar(dot);
+            Properties properties = new Properties();
+            properties.put(Constants.BUNDLE_SYMBOLICNAME, environment.getConfigId().getGroupId() + "." + environment.getConfigId().getArtifactId());
+            properties.put(Constants.BUNDLE_VERSION, environment.getConfigId().getVersion());
+            properties.put(Constants.BUNDLE_NAME, environment.getConfigId().getArtifactId());
+            properties.putAll(environment.getProperties());
+            analyzer.setProperties(properties);
+            analyzer.analyze();
+            return analyzer.calcManifest();
+        } catch (IOException e) {
+
+        } catch (Exception e) {
+
+        }
+        return null;
+    }
+
     public static LinkedHashSet<String> getImports(List<GBeanData> gbeans) {
         LinkedHashSet<String> imports = new LinkedHashSet<String>();
         for (GBeanData data: gbeans) {

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java Wed May 11 23:17:59 2011
@@ -185,14 +185,14 @@ public class Configuration implements GB
         this.abstractName = getConfigurationAbstractName(configurationData.getId());
         this.bundle = configurationData.getBundle();
 
-        if (!configurationData.getEnvironment().getBundleFilters().isEmpty()) {
-            try {
-                List<Bundle> bundles = getParentBundles(configurationData);
-                this.bundle = new DelegatingBundle(bundles);
-            } catch (Exception e) {
-                log.debug("Failed to identify bundle parents for " + configurationData.getId(), e);
-            }
-        }
+//        if (!configurationData.getEnvironment().getBundleFilters().isEmpty()) {
+//            try {
+//                List<Bundle> bundles = getParentBundles(configurationData);
+//                this.bundle = new DelegatingBundle(bundles);
+//            } catch (Exception e) {
+//                log.debug("Failed to identify bundle parents for " + configurationData.getId(), e);
+//            }
+//        }
 
         try {
             // Deserialize the GBeans in the configurationData
@@ -216,20 +216,20 @@ public class Configuration implements GB
         }
     }
 
-    private List<Bundle> getParentBundles(ConfigurationData configurationData)
-                                          throws MissingDependencyException, InvalidConfigException {
-        List<Bundle> bundles = new ArrayList<Bundle>();
-        bundles.add(configurationData.getBundle());
-        BundleContext bundleContext = configurationData.getBundle().getBundleContext();
-        List<String> bundleFilters = configurationData.getEnvironment().getBundleFilters();
-        for (String bundleFilter: bundleFilters) {
-            ServiceReference sr = bundleContext.getServiceReference(bundleFilter);
-            bundleReferences.add(sr);
-            Bundle bundle = (Bundle) bundleContext.getService(sr);
-            bundles.add(bundle);
-        }
-        return bundles;
-    }
+//    private List<Bundle> getParentBundles(ConfigurationData configurationData)
+//                                          throws MissingDependencyException, InvalidConfigException {
+//        List<Bundle> bundles = new ArrayList<Bundle>();
+//        bundles.add(configurationData.getBundle());
+//        BundleContext bundleContext = configurationData.getBundle().getBundleContext();
+//        List<String> bundleFilters = configurationData.getEnvironment().getBundleFilters();
+//        for (String bundleFilter: bundleFilters) {
+//            ServiceReference sr = bundleContext.getServiceReference(bundleFilter);
+//            bundleReferences.add(sr);
+//            Bundle bundle = (Bundle) bundleContext.getService(sr);
+//            bundles.add(bundle);
+//        }
+//        return bundles;
+//    }
 
     private static String getBundleLocation(ConfigurationResolver configurationResolver, Artifact configurationId) {
         if (System.getProperty("geronimo.build.car") == null) {

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/ConfigurationData.java Wed May 11 23:17:59 2011
@@ -176,7 +176,7 @@ public class ConfigurationData implement
         return moduleType;
     }
 
-    public Manifest getManifest() throws ManifestException {
+    public java.util.jar.Manifest getManifest() throws ManifestException {
         return environment.getManifest();
     }
 

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/repository/Environment.java Wed May 11 23:17:59 2011
@@ -23,11 +23,9 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Properties;
+import java.util.jar.Manifest;
 
-import org.apache.geronimo.kernel.config.Manifest;
-import org.apache.geronimo.kernel.config.ManifestException;
-import org.osgi.framework.Constants;
-import sun.tools.tree.ThisExpression;
 
 /**
  * holds the data from the EnvironmentType xml while it is being resolved, transitively closed, etc.
@@ -39,13 +37,14 @@ public class Environment implements Seri
     private static final long serialVersionUID = -7664363036619171222L;
 
     private Artifact configId;
+    private transient Manifest manifest;
     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 final LinkedHashSet<String> dynamicImports = new LinkedHashSet<String>();
-    private final LinkedHashSet<String> bundleFilters = new LinkedHashSet<String>();
     private String bundleActivator;
+    private final Properties properties = new Properties();
 
     public Environment() {
     }
@@ -57,13 +56,14 @@ public class Environment implements Seri
 
     public Environment(Environment environment) {
         configId = environment.getConfigId();
-        bundleFilters.addAll(environment.bundleFilters);
+        manifest = environment.getManifest();
         bundleClassPath.addAll(environment.bundleClassPath);
         imports.addAll(environment.imports);
         exports.addAll(environment.exports);
         requireBundles.addAll(environment.requireBundles);
         dynamicImports.addAll(environment.dynamicImports);
         bundleActivator = environment.bundleActivator;
+        properties.putAll(environment.getProperties());
     }
 
     public Artifact getConfigId() {
@@ -74,14 +74,6 @@ public class Environment implements Seri
         this.configId = configId;
     }
 
-    public List<String> getBundleFilters() {
-        return Collections.unmodifiableList(new ArrayList<String>(bundleFilters));
-    }
-
-    public void addBundleFilter(String bundleFilter){
-        this.bundleFilters.add(bundleFilter);
-    }
-
     public void addToBundleClassPath(Collection<String> bundleClassPath) {
         this.bundleClassPath.addAll(bundleClassPath);
     }
@@ -190,43 +182,52 @@ public class Environment implements Seri
         this.imports.removeAll(importPackages);
     }
 
-    public Manifest getManifest() throws ManifestException {
-        Manifest manifest = new Manifest();
-        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
-        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId()));
-        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
-        if (configId.getVersion().getQualifier() != null) {
-            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
-        }
-
-        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));
-
-        if (bundleActivator != null) {
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
-        }
-
-        if (!imports.isEmpty()) {
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
-        }
-
-        if (!exports.isEmpty()) {
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
-        }
-
-        if (!dynamicImports.isEmpty()) {
-            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, dynamicImports));
-        }
-
-        if (!bundleClassPath.isEmpty()) {
-            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);
-        }
+    public Properties getProperties() {
+        return properties;
+    }
+
+    public void setManifest(Manifest manifest) {
+        this.manifest = manifest;
+    }
+
+    public Manifest getManifest() {
         return manifest;
+//        Manifest manifest = new Manifest();
+//        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_MANIFESTVERSION, "2"));
+//        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_SYMBOLICNAME, configId.getGroupId() + "." + configId.getArtifactId()));
+//        String versionString = "" + configId.getVersion().getMajorVersion() + "." + configId.getVersion().getMinorVersion() + "." + configId.getVersion().getIncrementalVersion();
+//        if (configId.getVersion().getQualifier() != null) {
+//            versionString += "." + configId.getVersion().getQualifier().replaceAll("[^-_\\w]{1}", "_");
+//        }
+//
+//        manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_VERSION, versionString));
+//
+//        if (bundleActivator != null) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Constants.BUNDLE_ACTIVATOR, bundleActivator));
+//        }
+//
+//        if (!imports.isEmpty()) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.IMPORT_PACKAGE, imports));
+//        }
+//
+//        if (!exports.isEmpty()) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.EXPORT_PACKAGE, exports));
+//        }
+//
+//        if (!dynamicImports.isEmpty()) {
+//            manifest.addConfiguredAttribute(new Manifest.Attribute(Manifest.Attribute.Separator.COMMA, Constants.DYNAMICIMPORT_PACKAGE, dynamicImports));
+//        }
+//
+//        if (!bundleClassPath.isEmpty()) {
+//            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;
     }
 
 
@@ -237,4 +238,5 @@ public class Environment implements Seri
         buf.append("]\n");
         return buf.toString();
     }
+
 }

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java Wed May 11 23:17:59 2011
@@ -19,12 +19,14 @@ package org.apache.geronimo.deployment.s
 
 import java.beans.PropertyEditorSupport;
 import java.util.LinkedHashSet;
+import java.util.Map;
 
 import org.apache.geronimo.deployment.service.plan.ArtifactType;
 import org.apache.geronimo.deployment.service.plan.EnvironmentType;
 import org.apache.geronimo.deployment.service.plan.ObjectFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.w3c.dom.Element;
 
 /**
  * @version $Rev$ $Date$
@@ -37,21 +39,29 @@ public class EnvironmentBuilder extends 
         Environment environment = new Environment();
         if (environmentType != null) {
                 environment.setConfigId(toArtifact(environmentType.getModuleId(), null));
+            if (environmentType.getInstructions() != null) {
+                for (Element any: environmentType.getInstructions().getAny()) {
+                    String name = any.getLocalName();
+                    String value = any.getTextContent();
+
+                    //From felix MavenBundlePlugin  BundlePlugin.transformDirectives
+                    if ( name.startsWith( "_" ) )
+                    {
+                        name = "-" + name.substring( 1 );
+                    }
+
+                    if ( null == value )
+                    {
+                        value = "";
+                    }
+                    else
+                    {
+                        value = value.replaceAll( "\\p{Blank}*[\r\n]\\p{Blank}*", "" );
+                    }
 
-                environment.setBundleActivator(trim(environmentType.getBundleActivator()));
-            for (String importPackage: environmentType.getImportPackage()) {
-                environment.addImportPackage(trim(importPackage));
+                    environment.getProperties().setProperty(name, value);
+                }
             }
-            for (String exportPackage: environmentType.getExportPackage()) {
-                environment.addExportPackage(trim(exportPackage));
-            }
-            for (String requireBundle : environmentType.getRequireBundle()) {
-                environment.addRequireBundle(requireBundle);
-            }
-            for (String dynamicImportPackage: environmentType.getDynamicImportPackage()) {
-                environment.addDynamicImportPackage(trim(dynamicImportPackage));
-            }
-                        
         }
 
         return environment;
@@ -80,21 +90,21 @@ public class EnvironmentBuilder extends 
         return environment;
     }
 
-    public static EnvironmentType buildEnvironmentType(Environment environment) {
-        EnvironmentType environmentType = new ObjectFactory().createEnvironmentType();
-        if (environment.getConfigId() != null) {
-            ArtifactType configId = toArtifactType(environment.getConfigId());
-            environmentType.setModuleId(configId);
-        }
-
-            environmentType.setBundleActivator(environment.getBundleActivator());
-            environmentType.getBundleClassPath().addAll(environment.getBundleClassPath());
-            environmentType.getImportPackage().addAll(environment.getImportPackages());
-            environmentType.getExportPackage().addAll(environment.getExportPackages());
-            environmentType.getRequireBundle().addAll(environment.getRequireBundles());
-            environmentType.getDynamicImportPackage().addAll(environment.getDynamicImportPackages());
-                return environmentType;
-    }
+//    public static EnvironmentType buildEnvironmentType(Environment environment) {
+//        EnvironmentType environmentType = new ObjectFactory().createEnvironmentType();
+//        if (environment.getConfigId() != null) {
+//            ArtifactType configId = toArtifactType(environment.getConfigId());
+//            environmentType.setModuleId(configId);
+//        }
+//
+//            environmentType.setBundleActivator(environment.getBundleActivator());
+//            environmentType.getBundleClassPath().addAll(environment.getBundleClassPath());
+//            environmentType.getImportPackage().addAll(environment.getImportPackages());
+//            environmentType.getExportPackage().addAll(environment.getExportPackages());
+//            environmentType.getRequireBundle().addAll(environment.getRequireBundles());
+//            environmentType.getDynamicImportPackage().addAll(environment.getDynamicImportPackages());
+//                return environmentType;
+//    }
 
     private static ArtifactType toArtifactType(Artifact artifact) {
         ArtifactType artifactType = new ObjectFactory().createArtifactType();

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditor.java Wed May 11 23:17:59 2011
@@ -108,7 +108,7 @@ public class JavaBeanXmlAttributeEditor 
     }
 
     protected JavabeanType getJavabeanType(Object javaBean) {
-        JavabeanType javabeanType = new ObjectFactory().createJavabeanType();
+        JavabeanType javabeanType = new JavabeanType();
 
         javabeanType.setClazz(javaBean.getClass().getName());
         
@@ -146,7 +146,7 @@ public class JavaBeanXmlAttributeEditor 
         }
         
         if (isPrimitive(value)) {
-            PropertyType propertyType = new ObjectFactory().createPropertyType();
+            PropertyType propertyType = new PropertyType();
             propertyType.setName(propertyDescriptor.getName());
             
             String valueAsString = value.toString();
@@ -159,7 +159,7 @@ public class JavaBeanXmlAttributeEditor 
         } else {
             JavabeanType nestedJavabeanType = getJavabeanType(value);
             
-            BeanPropertyType propertyType = new ObjectFactory().createBeanPropertyType();
+            BeanPropertyType propertyType = new BeanPropertyType();
             propertyType.setName(propertyDescriptor.getName());
             propertyType.setJavabean(nestedJavabeanType);
             javabeanType.getBeanProperty().add(propertyType);

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/EnvironmentType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/EnvironmentType.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/EnvironmentType.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/EnvironmentType.java Wed May 11 23:17:59 2011
@@ -1,18 +1,15 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.03.23 at 08:34:08 PM PDT 
+// Generated on: 2011.05.08 at 11:32:10 AM PDT 
 //
 
 
 package org.apache.geronimo.deployment.service.plan;
 
-import java.util.ArrayList;
-import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlType;
 
 
@@ -27,12 +24,7 @@ import javax.xml.bind.annotation.XmlType
  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       &lt;sequence>
  *         &lt;element name="moduleId" type="{http://geronimo.apache.org/xml/ns/deployment-1.2}artifactType" minOccurs="0"/>
- *         &lt;element name="bundle-activator" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
- *         &lt;element name="bundle-classPath" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="import-package" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="export-package" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="require-bundle" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
- *         &lt;element name="dynamic-import-package" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
+ *         &lt;element name="instructions" type="{http://geronimo.apache.org/xml/ns/deployment-1.2}instructionsType" minOccurs="0"/>
  *       &lt;/sequence>
  *     &lt;/restriction>
  *   &lt;/complexContent>
@@ -44,28 +36,12 @@ import javax.xml.bind.annotation.XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "environmentType", propOrder = {
     "moduleId",
-    "bundleActivator",
-    "bundleClassPath",
-    "importPackage",
-    "exportPackage",
-    "requireBundle",
-    "dynamicImportPackage"
+    "instructions"
 })
 public class EnvironmentType {
 
     protected ArtifactType moduleId;
-    @XmlElement(name = "bundle-activator")
-    protected String bundleActivator;
-    @XmlElement(name = "bundle-classPath")
-    protected List<String> bundleClassPath;
-    @XmlElement(name = "import-package")
-    protected List<String> importPackage;
-    @XmlElement(name = "export-package")
-    protected List<String> exportPackage;
-    @XmlElement(name = "require-bundle")
-    protected List<String> requireBundle;
-    @XmlElement(name = "dynamic-import-package")
-    protected List<String> dynamicImportPackage;
+    protected InstructionsType instructions;
 
     /**
      * Gets the value of the moduleId property.
@@ -92,172 +68,27 @@ public class EnvironmentType {
     }
 
     /**
-     * Gets the value of the bundleActivator property.
+     * Gets the value of the instructions property.
      * 
      * @return
      *     possible object is
-     *     {@link String }
+     *     {@link InstructionsType }
      *     
      */
-    public String getBundleActivator() {
-        return bundleActivator;
+    public InstructionsType getInstructions() {
+        return instructions;
     }
 
     /**
-     * Sets the value of the bundleActivator property.
+     * Sets the value of the instructions property.
      * 
      * @param value
      *     allowed object is
-     *     {@link String }
+     *     {@link InstructionsType }
      *     
      */
-    public void setBundleActivator(String value) {
-        this.bundleActivator = value;
-    }
-
-    /**
-     * Gets the value of the bundleClassPath property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the bundleClassPath property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getBundleClassPath().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getBundleClassPath() {
-        if (bundleClassPath == null) {
-            bundleClassPath = new ArrayList<String>();
-        }
-        return this.bundleClassPath;
-    }
-
-    /**
-     * Gets the value of the importPackage property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the importPackage property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getImportPackage().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getImportPackage() {
-        if (importPackage == null) {
-            importPackage = new ArrayList<String>();
-        }
-        return this.importPackage;
-    }
-
-    /**
-     * Gets the value of the exportPackage property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the exportPackage property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getExportPackage().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getExportPackage() {
-        if (exportPackage == null) {
-            exportPackage = new ArrayList<String>();
-        }
-        return this.exportPackage;
-    }
-
-    /**
-     * Gets the value of the requireBundle property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the requireBundle property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getRequireBundle().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getRequireBundle() {
-        if (requireBundle == null) {
-            requireBundle = new ArrayList<String>();
-        }
-        return this.requireBundle;
-    }
-
-    /**
-     * Gets the value of the dynamicImportPackage property.
-     * 
-     * <p>
-     * This accessor method returns a reference to the live list,
-     * not a snapshot. Therefore any modification you make to the
-     * returned list will be present inside the JAXB object.
-     * This is why there is not a <CODE>set</CODE> method for the dynamicImportPackage property.
-     * 
-     * <p>
-     * For example, to add a new item, do as follows:
-     * <pre>
-     *    getDynamicImportPackage().add(newItem);
-     * </pre>
-     * 
-     * 
-     * <p>
-     * Objects of the following type(s) are allowed in the list
-     * {@link String }
-     * 
-     * 
-     */
-    public List<String> getDynamicImportPackage() {
-        if (dynamicImportPackage == null) {
-            dynamicImportPackage = new ArrayList<String>();
-        }
-        return this.dynamicImportPackage;
+    public void setInstructions(InstructionsType value) {
+        this.instructions = value;
     }
 
 }

Added: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java?rev=1102134&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java (added)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java Wed May 11 23:17:59 2011
@@ -0,0 +1,77 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.05.08 at 11:32:10 AM PDT 
+//
+
+
+package org.apache.geronimo.deployment.service.plan;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for instructionsType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="instructionsType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any namespace='http://geronimo.apache.org/xml/ns/deployment-1.2' maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "instructionsType", propOrder = {
+    "any"
+})
+public class InstructionsType {
+
+    @XmlAnyElement
+    protected List<Element> any;
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Element> getAny() {
+        if (any == null) {
+            any = new ArrayList<Element>();
+        }
+        return this.any;
+    }
+
+}

Propchange: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/InstructionsType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/ObjectFactory.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/ObjectFactory.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/service/plan/ObjectFactory.java Wed May 11 23:17:59 2011
@@ -1,8 +1,8 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.03.23 at 08:34:08 PM PDT 
+// Generated on: 2011.05.08 at 11:32:10 AM PDT 
 //
 
 
@@ -33,7 +33,6 @@ public class ObjectFactory {
 
     private final static QName _ClientEnvironment_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "client-environment");
     private final static QName _Gbean_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "gbean");
-    private final static QName _Javabean_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment/javabean-1.0", "javabean");
     private final static QName _ServerEnvironment_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "server-environment");
     private final static QName _Module_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "module");
     private final static QName _Environment_QNAME = new QName("http://geronimo.apache.org/xml/ns/deployment-1.2", "environment");
@@ -46,27 +45,19 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link ReferencesType }
-     * 
-     */
-    public ReferencesType createReferencesType() {
-        return new ReferencesType();
-    }
-
-    /**
-     * Create an instance of {@link EnvironmentType }
+     * Create an instance of {@link XmlAttributeType }
      * 
      */
-    public EnvironmentType createEnvironmentType() {
-        return new EnvironmentType();
+    public XmlAttributeType createXmlAttributeType() {
+        return new XmlAttributeType();
     }
 
     /**
-     * Create an instance of {@link PropertyType }
+     * Create an instance of {@link InstructionsType }
      * 
      */
-    public PropertyType createPropertyType() {
-        return new PropertyType();
+    public InstructionsType createInstructionsType() {
+        return new InstructionsType();
     }
 
     /**
@@ -78,19 +69,11 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link BeanPropertyType }
-     * 
-     */
-    public BeanPropertyType createBeanPropertyType() {
-        return new BeanPropertyType();
-    }
-
-    /**
-     * Create an instance of {@link XmlAttributeType }
+     * Create an instance of {@link ReferencesType }
      * 
      */
-    public XmlAttributeType createXmlAttributeType() {
-        return new XmlAttributeType();
+    public ReferencesType createReferencesType() {
+        return new ReferencesType();
     }
 
     /**
@@ -102,35 +85,35 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link AttributeType }
+     * Create an instance of {@link ReferenceType }
      * 
      */
-    public AttributeType createAttributeType() {
-        return new AttributeType();
+    public ReferenceType createReferenceType() {
+        return new ReferenceType();
     }
 
     /**
-     * Create an instance of {@link ReferenceType }
+     * Create an instance of {@link ModuleType }
      * 
      */
-    public ReferenceType createReferenceType() {
-        return new ReferenceType();
+    public ModuleType createModuleType() {
+        return new ModuleType();
     }
 
     /**
-     * Create an instance of {@link EmptyType }
+     * Create an instance of {@link AttributeType }
      * 
      */
-    public EmptyType createEmptyType() {
-        return new EmptyType();
+    public AttributeType createAttributeType() {
+        return new AttributeType();
     }
 
     /**
-     * Create an instance of {@link JavabeanType }
+     * Create an instance of {@link EmptyType }
      * 
      */
-    public JavabeanType createJavabeanType() {
-        return new JavabeanType();
+    public EmptyType createEmptyType() {
+        return new EmptyType();
     }
 
     /**
@@ -142,11 +125,11 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link ModuleType }
+     * Create an instance of {@link EnvironmentType }
      * 
      */
-    public ModuleType createModuleType() {
-        return new ModuleType();
+    public EnvironmentType createEnvironmentType() {
+        return new EnvironmentType();
     }
 
     /**
@@ -168,15 +151,6 @@ public class ObjectFactory {
     }
 
     /**
-     * Create an instance of {@link JAXBElement }{@code <}{@link JavabeanType }{@code >}}
-     * 
-     */
-    @XmlElementDecl(namespace = "http://geronimo.apache.org/xml/ns/deployment/javabean-1.0", name = "javabean")
-    public JAXBElement<JavabeanType> createJavabean(JavabeanType value) {
-        return new JAXBElement<JavabeanType>(_Javabean_QNAME, JavabeanType.class, null, value);
-    }
-
-    /**
      * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentType }{@code >}}
      * 
      */

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/resources/geronimo-module-1.2.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/resources/geronimo-module-1.2.xsd?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/resources/geronimo-module-1.2.xsd (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/main/resources/geronimo-module-1.2.xsd Wed May 11 23:17:59 2011
@@ -154,16 +154,23 @@
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
-            <xs:element name="bundle-activator" type="xs:string" minOccurs="0"/>
-            <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="dynamic-import-package" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element name="instructions" type="sys:instructionsType" minOccurs="0"/>
+            <!--<xs:element name="bundle-activator" type="xs:string" minOccurs="0"/>-->
+            <!--<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="dynamic-import-package" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>-->
 
         </xs:sequence>
     </xs:complexType>
 
+    <xs:complexType name="instructionsType">
+        <xs:sequence>
+            <xs:any namespace="http://geronimo.apache.org/xml/ns/deployment-1.2" processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:complexType name="emptyType" />
 
     <!--<xs:element name="service" type="sys:abstract-serviceType">-->

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditorTest.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditorTest.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-service-builder/src/test/java/org/apache/geronimo/deployment/service/JavaBeanXmlAttributeEditorTest.java Wed May 11 23:17:59 2011
@@ -66,7 +66,7 @@ public class JavaBeanXmlAttributeEditorT
         editor.setValue(bean);
         String result = editor.getAsText();
 
-        JavabeanType javabeanType = new ObjectFactory().createJavabeanType();
+        JavabeanType javabeanType = new JavabeanType();
         assertPrimitive(javabeanType, "booleanValue", "true");
         assertPrimitive(javabeanType, "byteValue", "1");
         assertPrimitive(javabeanType, "charValue", "a");

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java?rev=1102134&r1=1102133&r2=1102134&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ExecutableConfigurationUtil.java Wed May 11 23:17:59 2011
@@ -19,33 +19,26 @@ package org.apache.geronimo.system.confi
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.io.FileWriter;
 import java.io.Writer;
 import java.net.URI;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.LinkedList;
-import java.util.Arrays;
-import java.util.LinkedHashSet;
-import java.util.List;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Manifest;
 import java.util.zip.ZipEntry;
 
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.ManifestException;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GAttributeInfo;
-import org.apache.geronimo.gbean.GReferenceInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -131,9 +124,7 @@ public final class ExecutableConfigurati
     public static void writeConfiguration(ConfigurationData configurationData, JarOutputStream out) throws IOException {
         out.putNextEntry(new ZipEntry(META_INF_MANIFEST));
         try {
-            PrintWriter writer = new PrintWriter(new OutputStreamWriter(out));
-            configurationData.getManifest().write(writer);
-            writer.flush();
+            configurationData.getManifest().write(out);
         } catch (ManifestException e) {
             throw new IOException("Could not write manifest", e);
         } finally {
@@ -176,21 +167,19 @@ public final class ExecutableConfigurati
         File metaInf = new File(source, META_INF);
         metaInf.mkdirs();
 
-        PrintWriter writer = null;
-
-        writer = new PrintWriter(new FileWriter(new File(metaInf, MANIFEST_MF)));
+        OutputStream out = new FileOutputStream(new File(metaInf, MANIFEST_MF));
         try {
-            configurationData.getManifest().write(writer);
-            writer.flush();
+            configurationData.getManifest().write(out);
+            out.flush();
         } catch (ManifestException e) {
             throw new IOException("Could not write manifest", e);
         } finally {
-            writer.close();
+            out.close();
         }
         
         File configSer = new File(metaInf, CONFIG_SER);
 
-        OutputStream out = new FileOutputStream(configSer);
+        out = new FileOutputStream(configSer);
         try {
             ConfigurationUtil.writeConfigurationData(configurationData, out);
         } finally {
@@ -202,6 +191,7 @@ public final class ExecutableConfigurati
         ConfigurationStoreUtil.writeChecksumFor(configSer);
 
         // write the info file
+        PrintWriter writer = null;
         try {
             writer = new PrintWriter(new FileWriter(new File(metaInf, CONFIG_INFO)));
             ConfigurationUtil.writeConfigInfo(writer, configurationData);