geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1100440 [1/4] - in /geronimo/server/branches/3.0-osgi: framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/ plugi...
Date Sat, 07 May 2011 03:47:50 GMT
Author: djencks
Date: Sat May  7 03:47:48 2011
New Revision: 1100440

URL: http://svn.apache.org/viewvc?rev=1100440&view=rev
Log:
Make an openejb jaxb tree.  Lots of small changes, all the enabled plugins build

Added:
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml   (with props)
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/
    geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/AbstractClusteringType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/AbstractSecurityType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/ApplicationType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/AuthMethodType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/EmptyType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/ExtModuleType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/GeronimoEjbJarType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/ModuleType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/ObjectFactory.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/OpenejbJarType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/TransportGuaranteeType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/TssLinkType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/WebServiceBindingType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/WebServiceSecurityType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/model/package-info.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/resources/
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/resources/META-INF/
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/resources/META-INF/sun-jaxb.episode
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/resources/catalog.cat
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/resources/geronimo-openejb-2.0.xsd   (contents, props changed)
      - copied, changed from r1100290, geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/xsd/geronimo-openejb-2.0.xsd
Removed:
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/xsd/geronimo-openejb-2.0.xsd
Modified:
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java
    geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/LicenseType.java
    geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java
    geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationInstaller.java
    geronimo/server/branches/3.0-osgi/plugins/bval/bval-deployer/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/resources/geronimo-application-2.0.xsd
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/resources/geronimo-web-2.0.1.xsd
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/XmlUtil.java
    geronimo/server/branches/3.0-osgi/plugins/openejb/openejb-deployer/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openejb/openejb/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openejb/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceRefBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openjpa2/openjpa2/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openjpa2/persistence-jpa20-deployer/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/openjpa2/persistence-jpa20-deployer/src/main/plan/plan.xml
    geronimo/server/branches/3.0-osgi/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansModuleBuilderExtension.java
    geronimo/server/branches/3.0-osgi/plugins/openwebbeans/geronimo-openwebbeans-builder/src/main/java/org/apache/geronimo/openwebbeans/deployment/OpenWebBeansNamingBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/openwebbeans/openwebbeans-deployer/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/tomcat/tomcat7-deployer/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/wab/geronimo-web-extender/src/main/java/org/apache/geronimo/osgi/web/extender/WebApplication.java
    geronimo/server/branches/3.0-osgi/plugins/wab/web-extender/pom.xml

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.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/ConfigurationInstaller.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/configuration/ConfigurationInstaller.java Sat May  7 03:47:48 2011
@@ -148,20 +148,25 @@ public class ConfigurationInstaller {
                 InputStream in = pluginXmlURL.openStream();
                 try {
                     PluginType pluginType = PluginXmlUtil.loadPluginMetadata(in);
-                    PluginArtifactType pluginArtifactType = pluginType.getPluginArtifact().get(0);
-                    List<PropertyType> substitutions = pluginArtifactType.getConfigSubstitution();
-                    Map<String, String> subMap = new HashMap<String, String>();
-                    for (PropertyType propertyType: substitutions) {
-                        if (equals(propertyType.getServer(), pluginAttributeStore.getServerName())) {
-                            subMap.put(propertyType.getKey(), propertyType.getValue());
+                    //TODO this check should not really be necessary, identify which cars are missing the plugin artifact.
+                    if (!pluginType.getPluginArtifact().isEmpty()) {
+                        PluginArtifactType pluginArtifactType = pluginType.getPluginArtifact().get(0);
+                        List<PropertyType> substitutions = pluginArtifactType.getConfigSubstitution();
+                        Map<String, String> subMap = new HashMap<String, String>();
+                        for (PropertyType propertyType: substitutions) {
+                            if (equals(propertyType.getServer(), pluginAttributeStore.getServerName())) {
+                                subMap.put(propertyType.getKey(), propertyType.getValue());
+                            }
                         }
-                    }
-                    pluginAttributeStore.addConfigSubstitutions(subMap);
-                    List<ConfigXmlContentType> xmls = pluginArtifactType.getConfigXmlContent();
-                    for (ConfigXmlContentType xml: xmls) {
-                        if (equals(xml.getServer(), pluginAttributeStore.getServerName())) {
-                            pluginAttributeStore.setModuleGBeans(toArtifact(pluginArtifactType.getModuleId()), xml.getGbean(), xml.isLoad(), xml.getCondition());
+                        pluginAttributeStore.addConfigSubstitutions(subMap);
+                        List<ConfigXmlContentType> xmls = pluginArtifactType.getConfigXmlContent();
+                        for (ConfigXmlContentType xml: xmls) {
+                            if (equals(xml.getServer(), pluginAttributeStore.getServerName())) {
+                                pluginAttributeStore.setModuleGBeans(toArtifact(pluginArtifactType.getModuleId()), xml.getGbean(), xml.isLoad(), xml.getCondition());
+                            }
                         }
+                    } else {
+                        logger.warn("No PluginArtifact in plugin xml at " + pluginXmlURL);
                     }
                 } finally {
                     in.close();

Modified: geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/LicenseType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/LicenseType.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/LicenseType.java (original)
+++ geronimo/server/branches/3.0-osgi/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/plugin/model/LicenseType.java Sat May  7 03:47:48 2011
@@ -49,7 +49,7 @@ public class LicenseType
     @XmlValue
     protected String value;
     @XmlAttribute(name = "osi-approved", required = true)
-    protected boolean osiApproved;
+    protected Boolean osiApproved = Boolean.FALSE;
 
     /**
      * Gets the value of the value property.
@@ -79,7 +79,7 @@ public class LicenseType
      * Gets the value of the osiApproved property.
      * 
      */
-    public boolean isOsiApproved() {
+    public Boolean isOsiApproved() {
         return osiApproved;
     }
 
@@ -87,7 +87,7 @@ public class LicenseType
      * Sets the value of the osiApproved property.
      * 
      */
-    public void setOsiApproved(boolean value) {
+    public void setOsiApproved(Boolean value) {
         this.osiApproved = value;
     }
 

Modified: geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationGBean.java Sat May  7 03:47:48 2011
@@ -339,8 +339,8 @@ public class ApplicationGBean implements
    
     protected void applicationStart() throws BundleException {
         try {
-            installer.getConfigurationManager().loadConfiguration(configId);
-            installer.getConfigurationManager().startConfiguration(configId);
+//            installer.getConfigurationManager().loadConfiguration(configId);
+//            installer.getConfigurationManager().startConfiguration(configId);
         } catch (Exception e) {
             throw new BundleException("Failed to start application", e);            
         }
@@ -348,7 +348,7 @@ public class ApplicationGBean implements
     
     protected void applicationStop() throws BundleException {
         try {
-            installer.getConfigurationManager().unloadConfiguration(configId);
+//            installer.getConfigurationManager().unloadConfiguration(configId);
         } catch (Exception e) {
             throw new BundleException("Failed to start application", e);            
         }
@@ -358,8 +358,8 @@ public class ApplicationGBean implements
         LOG.debug("Uninstalling {}", application.getApplicationMetadata().getApplicationScope());
 
         try {
-            installer.getConfigurationManager().unloadConfiguration(configId);
-            installer.getConfigurationManager().uninstallConfiguration(configId);
+//            installer.getConfigurationManager().unloadConfiguration(configId);
+//            installer.getConfigurationManager().uninstallConfiguration(configId);
         } catch (Exception e) {
             // ignore
         }

Modified: geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationInstaller.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationInstaller.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationInstaller.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/aries/geronimo-aries/src/main/java/org/apache/geronimo/aries/ApplicationInstaller.java Sat May  7 03:47:48 2011
@@ -38,17 +38,14 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.util.BundleUtil;
 import org.apache.geronimo.kernel.util.FileUtils;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.framework.Version;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,7 +61,6 @@ public class ApplicationInstaller implem
     private BundleContext bundleContext;
     private AbstractName abstractName;
     private ServiceRegistration registration;
-    private ConfigurationManager configurationManager;
     private Collection<ConfigurationStore> configurationStores;
     private Environment defaultEnvironment;
 
@@ -79,7 +75,6 @@ public class ApplicationInstaller implem
         this.bundleContext = bundleContext;
         this.abstractName = abstractName;
         this.configurationStores = configurationStores;
-        this.configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
         this.defaultEnvironment = defaultEnvironment;
     }
 
@@ -97,10 +92,6 @@ public class ApplicationInstaller implem
         doStop();
     }
 
-    protected ConfigurationManager getConfigurationManager() {
-        return configurationManager;
-    }
-
     public DeploymentContext startInstall(AriesApplication app, ConfigurationStore targetConfigurationStore)
         throws ConfigurationAlreadyExistsException, IOException, DeploymentException {
 
@@ -124,7 +115,6 @@ public class ApplicationInstaller implem
                             moduleName,
                             ConfigurationModuleType.EBA,
                             naming,
-                            configurationManager,
                             null,
                             bundleContext);
 
@@ -173,8 +163,8 @@ public class ApplicationInstaller implem
         ConfigurationData configurationData = finishInstall(context, store);
 
         try {
-            configurationManager.loadConfiguration(configurationData.getId());
-            configurationManager.startConfiguration(configurationData.getId());
+//            configurationManager.loadConfiguration(configurationData.getId());
+//            configurationManager.startConfiguration(configurationData.getId());
         } catch (Exception e) {
             e.printStackTrace();
             throw new DeploymentException("", e);

Modified: geronimo/server/branches/3.0-osgi/plugins/bval/bval-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/bval/bval-deployer/pom.xml?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/bval/bval-deployer/pom.xml (original)
+++ geronimo/server/branches/3.0-osgi/plugins/bval/bval-deployer/pom.xml Sat May  7 03:47:48 2011
@@ -34,13 +34,47 @@
     <packaging>car</packaging>
     
     <dependencies>
-        <!-- parent -->
         <dependency>
-            <groupId>org.apache.geronimo.configs</groupId>
-            <artifactId>j2ee-deployer</artifactId>
+             <groupId>org.apache.geronimo.framework.feature</groupId>
+             <artifactId>j2ee-system</artifactId>
+             <version>${project.version}</version>
+             <type>xml</type>
+             <classifier>features</classifier>
+         </dependency>
+         <!--<dependency>-->
+             <!--<groupId>org.apache.geronimo.framework.feature</groupId>-->
+             <!--<artifactId>server-security-config</artifactId>-->
+             <!--<version>${project.version}</version>-->
+             <!--<type>kar</type>-->
+         <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.geronimo.feature</groupId>
+            <artifactId>org.apache.geronimo.javaee-specs</artifactId>
             <version>${project.version}</version>
-            <type>car</type>
+            <type>xml</type>
+            <classifier>features</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-naming</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- parent -->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.configs</groupId>-->
+            <!--<artifactId>j2ee-deployer</artifactId>-->
+            <!--<version>${project.version}</version>-->
+            <!--<type>car</type>-->
+        <!--</dependency>-->
         
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
@@ -69,6 +103,13 @@
                 <groupId>org.apache.geronimo.buildsupport</groupId>
                 <artifactId>car-maven-plugin</artifactId>
                 <configuration>
+                    <features>
+                        <feature>declarative-services</feature>
+                        <feature>org.apache.geronimo.jaxb-support</feature>
+                        <feature>org.apache.geronimo.javaee-specs</feature>
+                        <feature>j2ee-system</feature>
+                        <!--<feature>server-security-config</feature>-->
+                    </features>
                     <category>Web Framework</category>
                     <instance>
                         <plugin-artifact>

Modified: geronimo/server/branches/3.0-osgi/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/bval/geronimo-bval-builder/src/main/java/org/apache/geronimo/bval/deployment/BValNamingBuilder.java Sat May  7 03:47:48 2011
@@ -23,9 +23,7 @@ package org.apache.geronimo.bval.deploym
 import java.util.Collections;
 import java.util.Map;
 
-import javax.validation.ValidationException;
 import javax.validation.ValidatorFactory;
-
 import org.apache.geronimo.bval.DefaultValidatorFactoryReference;
 import org.apache.geronimo.bval.DefaultValidatorReference;
 import org.apache.geronimo.bval.ValidatorFactoryResourceReference;
@@ -34,17 +32,14 @@ import org.apache.geronimo.gbean.Abstrac
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.JndiPlan;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
-import org.apache.geronimo.naming.reference.ResourceReference;
 import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
@@ -56,14 +51,9 @@ public class BValNamingBuilder extends A
         super(defaultEnvironment);
     }
 
-    @Override 
-    protected boolean willMergeEnvironment(JndiConsumer specDD, XmlObject plan) {
-        // we always merge our information 
-        return true; 
-    }
 
     @Override
-    public void buildNaming(JndiConsumer specDD, XmlObject xmlObject1, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
+    public void buildNaming(JndiConsumer specDD, JndiPlan plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         try {
             // perform a lookup on the bound GBean and add this as a resource reference.  If 
             // we can't find one, then bind in a default validator. 
@@ -81,13 +71,4 @@ public class BValNamingBuilder extends A
         put("java:comp/Validator", new DefaultValidatorReference(), module.getJndiContext(), Collections.<InjectionTarget>emptyList(), sharedContext);
     }
 
-    @Override
-    public QNameSet getSpecQNameSet() {
-        return QNameSet.EMPTY;
-    }
-
-    @Override
-    public QNameSet getPlanQNameSet() {
-        return QNameSet.EMPTY;
-    }
 }

Added: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java?rev=1100440&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java (added)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java Sat May  7 03:47:48 2011
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.j2ee.deployment;
+
+import java.util.List;
+
+import org.apache.openejb.jee.jpa.unit.Persistence;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface PersistencePlan {
+    List<Persistence> getPersistence();
+}

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/PersistencePlan.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/resources/geronimo-application-2.0.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/resources/geronimo-application-2.0.xsd?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/resources/geronimo-application-2.0.xsd (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-j2ee-builder/src/main/resources/geronimo-application-2.0.xsd Sat May  7 03:47:48 2011
@@ -115,7 +115,7 @@
                 </xs:annotation>
             </xs:element>
 
-            <xs:element ref="geronimo:security" minOccurs="0">
+            <xs:element name="security" type="geronimo:abstract-securityType" minOccurs="0">
                 <xs:annotation>
                     <xs:documentation>
                         Reference to security element defined in this schema. If
@@ -229,16 +229,16 @@
         </xs:sequence>
     </xs:complexType>
 
-    <xs:element name="security" type="geronimo:abstract-securityType">
-        <xs:annotation>
-            <xs:documentation>
-                If this optional element is present, all web and EJB modules
-                must make the appropriate access checks as outlined in the JACC
-                spec. This element groups the security role mapping settings for
-                the application.
-            </xs:documentation>
-        </xs:annotation>
-    </xs:element>
+    <!--<xs:element name="security" type="geronimo:abstract-securityType">-->
+        <!--<xs:annotation>-->
+            <!--<xs:documentation>-->
+                <!--If this optional element is present, all web and EJB modules-->
+                <!--must make the appropriate access checks as outlined in the JACC-->
+                <!--spec. This element groups the security role mapping settings for-->
+                <!--the application.-->
+            <!--</xs:documentation>-->
+        <!--</xs:annotation>-->
+    <!--</xs:element>-->
 
     <xs:complexType name="abstract-securityType" abstract="true">
         <xs:annotation>

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/resources/geronimo-web-2.0.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/resources/geronimo-web-2.0.1.xsd?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/resources/geronimo-web-2.0.1.xsd (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/resources/geronimo-web-2.0.1.xsd Sat May  7 03:47:48 2011
@@ -118,8 +118,8 @@
                     </xs:annotation>
                 </xs:element>
                 <xs:choice minOccurs="0">
-                <xs:element ref="sec:security"/>
-                <xs:element ref="sec:security-ref"/>
+                    <xs:element ref="sec:security"/>
+                    <xs:element ref="sec:security-ref"/>
                 </xs:choice>
             </xs:sequence>
 

Added: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml?rev=1100440&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml (added)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml Sat May  7 03:47:48 2011
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="org.apache.geronimo.javaee-specs">
+    <feature>
+        <bundle>mvn:org.apache.geronimo.bundles/jaxb-impl/2.2.3_1-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.bundles/woodstox/4.0.6_2-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.javamail/geronimo-javamail_1.4_mail/1.8.2</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-annotation_1.1_spec/1.0.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-ejb_3.1_spec/1.0.2</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-el_2.2_spec/1.0.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-interceptor_1.1_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-j2ee-connector_1.6_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jacc_1.4_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaspic_1.0_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-javaee-deployment_1.1MR3_spec/1.0.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.2-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaxr_1.0_spec/2.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaxrpc_1.1_spec/2.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaxws_2.2_spec/1.1-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jcdi_1.0_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jsp_2.2_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-osgi-registry/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-saaj_1.3_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-servlet_3.0_spec/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-stax-api_1.2_spec/1.1-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-validation_1.0_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3</bundle>
+    </feature>
+</features>

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.javaee-specs/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml?rev=1100440&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml (added)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml Sat May  7 03:47:48 2011
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="org.apache.geronimo.jaxb-support">
+    <feature>
+        <bundle>mvn:org.apache.geronimo.bundles/jaxb-impl/2.2.3_1-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.bundles/woodstox/4.0.6_2-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-activation_1.1_spec/1.1</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.2-SNAPSHOT</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-osgi-registry/1.0</bundle>
+        <bundle>mvn:org.apache.geronimo.specs/geronimo-stax-api_1.2_spec/1.1-SNAPSHOT</bundle>
+    </feature>
+</features>

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/org.apache.geronimo.jaxb-support/src/main/history/dependencies.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/pom.xml?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/pom.xml (original)
+++ geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/pom.xml Sat May  7 03:47:48 2011
@@ -51,21 +51,19 @@
             <!--</exclusions>-->
         <!--</dependency>-->
 
-        <!-- g-service-builder coming from this via g-naming-builder -->
         <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-openejb</artifactId>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
             <version>${project.version}</version>
         </dependency>
-
         <dependency>
-            <groupId>org.apache.openejb</groupId>
-            <artifactId>openejb-osgi-core</artifactId>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${project.version}</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-connector-builder-1_6</artifactId>
+            <artifactId>geronimo-naming-builder</artifactId>
             <version>${project.version}</version>
         </dependency>
 
@@ -74,6 +72,22 @@
             <artifactId>geronimo-security-builder</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>openejb-osgi-core</artifactId>
+        </dependency>
+
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-connector-builder-1_6</artifactId>-->
+            <!--<version>${project.version}</version>-->
+        <!--</dependency>-->
 
         <dependency>
             <groupId>org.apache.geronimo.testsupport</groupId>
@@ -85,10 +99,10 @@
 
     <build>
         <plugins>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>xmlbeans-maven-plugin</artifactId>
-            </plugin>
+            <!--<plugin>-->
+                <!--<groupId>org.codehaus.mojo</groupId>-->
+                <!--<artifactId>xmlbeans-maven-plugin</artifactId>-->
+            <!--</plugin>-->
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
@@ -96,40 +110,75 @@
                     <instructions>
                         <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
                         <Import-Package>
-                            org.apache.geronimo.deployment.xbeans.impl,
-                            org.apache.geronimo.deployment.javabean.xbeans.impl,
-                            org.apache.geronimo.deployment.xbeans,
-                            org.apache.geronimo.deployment.javabean.xbeans,
-                            org.apache.geronimo.deployment.dconfigbean,
-                            org.apache.geronimo.deployment.service,
-                            org.apache.geronimo.deployment.service.jsr88,
-                            org.apache.geronimo.connector.deployment.dconfigbean,
-                            org.apache.geronimo.connector.deployment.jsr88,
-                            org.apache.geronimo.xbeans.connector,
-                            org.apache.geronimo.xbeans.connector.impl,
-                            org.apache.geronimo.xbeans.geronimo.j2ee,
-                            org.apache.geronimo.xbeans.geronimo.j2ee.impl,
                             org.apache.geronimo.j2ee.deployment,
                             org.apache.geronimo.j2ee.deployment.annotation,
-                            org.apache.geronimo.j2ee.jsr88,
-                            org.apache.geronimo.xbeans.geronimo.naming,
-                            org.apache.geronimo.xbeans.geronimo.naming.impl,
                             org.apache.geronimo.naming.deployment,
-                            org.apache.geronimo.naming.deployment.jsr88,
-                            org.apache.xmlbeans.impl.schema;version="2.4",
                             *
                         </Import-Package>
                         <Export-Package>
                             org.apache.geronimo.openejb.deployment,
-                            org.apache.geronimo.openejb.xbeans.ejbjar,
-                            org.apache.geronimo.openejb.xbeans.ejbjar.impl,
                         </Export-Package>
-                        <_exportcontents>schemaorg_apache_xmlbeans*</_exportcontents>
-                        <DynamicImport-Package>schemaorg_apache_xmlbeans.*</DynamicImport-Package>
                     </instructions>
                 </configuration>
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>jaxb</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.jvnet.jaxb2.maven2</groupId>
+                        <artifactId>maven-jaxb2-plugin</artifactId>
+                        <configuration>
+                            <debug>true</debug>
+                            <verbose>true</verbose>
+                            <generatePackage>org.apache.geronimo.openejb.deployment.model</generatePackage>
+                            <catalog>src/main/resources/catalog.cat</catalog>
+                            <catalogResolver>org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver</catalogResolver>
+                            <episodes>
+                                <episode>
+                                    <groupId>org.apache.geronimo.framework</groupId>
+                                    <artifactId>geronimo-service-builder</artifactId>
+                                </episode>
+                                <episode>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-j2ee-builder</artifactId>
+                                </episode>
+                                <episode>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-security-builder</artifactId>
+                                </episode>
+                                <episode>
+                                    <groupId>org.apache.openejb</groupId>
+                                    <artifactId>openejb-jee</artifactId>
+                                </episode>
+                            </episodes>
+                            <plugins>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.framework</groupId>
+                                    <artifactId>geronimo-service-builder</artifactId>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-j2ee-builder</artifactId>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-security-builder</artifactId>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.openejb</groupId>
+                                    <artifactId>openejb-jee</artifactId>
+                                </plugin>
+                            </plugins>
+                        </configuration>
+                    </plugin>
+
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 
 </project>

Modified: geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java Sat May  7 03:47:48 2011
@@ -41,6 +41,7 @@ import org.apache.geronimo.gbean.GBeanDa
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
+import org.apache.geronimo.j2ee.deployment.model.naming.ResourceRefType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.j2ee.jndi.JndiScope;
@@ -55,11 +56,10 @@ import org.apache.geronimo.openejb.OpenE
 import org.apache.geronimo.openejb.SingletonDeploymentGBean;
 import org.apache.geronimo.openejb.StatefulDeploymentGBean;
 import org.apache.geronimo.openejb.StatelessDeploymentGBean;
-import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
+import org.apache.geronimo.openejb.deployment.model.GeronimoEjbJarType;
 import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
-import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.openejb.BeanContext;
 import org.apache.openejb.InterfaceType;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
@@ -398,7 +398,7 @@ public class EjbDeploymentBuilder {
             addEnc(gbean, bean, appName, deploymentId);
         }
 
-        OpenejbGeronimoEjbJarType geronimoOpenejb = ejbModule.getVendorDD();
+        GeronimoEjbJarType geronimoOpenejb = ejbModule.getVendorDD();
         for (EnterpriseBean bean: ejbJar.getEnterpriseBeans()) {
             String ejbName = bean.getEjbName().trim();
             GBeanData gbean = getEjbGBean(ejbName);
@@ -446,7 +446,7 @@ public class EjbDeploymentBuilder {
         Module module = ejbModule.newEJb(finder, bean);
         bind(bean, appName, ejbModule.getName(), deploymentId, module.getJndiContext());
 
-        OpenejbGeronimoEjbJarType geronimoOpenejb = ejbModule.getVendorDD();
+        GeronimoEjbJarType geronimoOpenejb = ejbModule.getVendorDD();
         namingBuilder.buildNaming(bean,
                 geronimoOpenejb,
                 module,
@@ -465,11 +465,11 @@ public class EjbDeploymentBuilder {
         //
     }
 
-    private void processResourceEnvironment(GBeanData gbean, Collection<ResourceRef> resourceRefs, OpenejbGeronimoEjbJarType geronimoOpenejb) throws DeploymentException {
-        GerResourceRefType[] gerResourceRefs = null;
+    private void processResourceEnvironment(GBeanData gbean, Collection<ResourceRef> resourceRefs, GeronimoEjbJarType geronimoOpenejb) throws DeploymentException {
+        List<ResourceRefType> gerResourceRefs = null;
 
         if (geronimoOpenejb != null) {
-            gerResourceRefs = geronimoOpenejb.getResourceRefArray();
+            gerResourceRefs = geronimoOpenejb.getResourceRef();
         }
 
         GBeanResourceEnvironmentBuilder refBuilder = new GBeanResourceEnvironmentBuilder(gbean);

Modified: geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java Sat May  7 03:47:48 2011
@@ -27,7 +27,7 @@ import org.apache.geronimo.j2ee.jndi.Jnd
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.openejb.GeronimoEjbInfo;
-import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
+import org.apache.geronimo.openejb.deployment.model.GeronimoEjbJarType;
 import org.apache.openejb.ClassLoaderUtil;
 import org.apache.openejb.config.ConfigurationFactory;
 import org.apache.openejb.core.TempClassLoader;
@@ -35,12 +35,11 @@ import org.apache.openejb.jee.EjbJar;
 import org.apache.openejb.jee.EnterpriseBean;
 import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.xbean.finder.ClassFinder;
-import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
  */
-public class EjbModule extends EJBModule<OpenejbGeronimoEjbJarType> {
+public class EjbModule extends EJBModule<GeronimoEjbJarType> {
     private GeronimoEjbInfo ejbInfo;
     private EjbDeploymentBuilder ejbDeploymentBuilder;
     private final org.apache.openejb.config.EjbModule ejbModule;
@@ -56,7 +55,7 @@ public class EjbModule extends EJBModule
                      String targetPath,
                      String originalSpecDD,
                      EjbJar specDD,
-                     OpenejbGeronimoEjbJarType vendorDD,
+                     GeronimoEjbJarType vendorDD,
                      Map<JndiKey, Map<String, Object>> jndiContext,
                      Module parentModule,
                      boolean shareJndi) {
@@ -143,8 +142,8 @@ public class EjbModule extends EJBModule
         return ejb;
     }
 
-    class Ejb extends Module<EnterpriseBean, XmlObject> {
-        protected Ejb(boolean standAlone, AbstractName moduleName, String name, Environment environment, JarFile moduleFile, String targetPath, EnterpriseBean specDD, XmlObject vendorDD, String originalSpecDD, String namespace, Map<JndiKey, Map<String, Object>> jndiContext, Module<?, ?> parentModule) {
+    class Ejb extends Module<EnterpriseBean, GeronimoEjbJarType> {
+        protected Ejb(boolean standAlone, AbstractName moduleName, String name, Environment environment, JarFile moduleFile, String targetPath, EnterpriseBean specDD, GeronimoEjbJarType vendorDD, String originalSpecDD, String namespace, Map<JndiKey, Map<String, Object>> jndiContext, Module<?, ?> parentModule) {
             super(standAlone, moduleName, name, environment, moduleFile, targetPath, specDD, vendorDD, originalSpecDD, namespace, jndiContext, parentModule);
         }
 

Modified: geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java Sat May  7 03:47:48 2011
@@ -17,6 +17,7 @@
 package org.apache.geronimo.openejb.deployment;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -48,7 +49,8 @@ import org.apache.geronimo.deployment.Mo
 import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.deployment.service.plan.ArtifactType;
+import org.apache.geronimo.deployment.service.plan.EnvironmentType;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
@@ -63,6 +65,8 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.j2ee.deployment.model.naming.EjbRefType;
+//import org.apache.geronimo.j2ee.deployment.model.naming.ResourceLocatorType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.j2ee.jndi.JndiScope;
@@ -81,7 +85,7 @@ import org.apache.geronimo.openejb.EjbDe
 import org.apache.geronimo.openejb.EjbModuleImpl;
 import org.apache.geronimo.openejb.GeronimoEjbInfo;
 import org.apache.geronimo.openejb.OpenEjbSystem;
-import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
+import org.apache.geronimo.openejb.deployment.model.GeronimoEjbJarType;
 import org.apache.geronimo.openwebbeans.SharedOwbContext;
 import org.apache.geronimo.persistence.PersistenceUnitGBean;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -136,10 +140,11 @@ import org.apache.openejb.jee.ServiceRef
 import org.apache.openejb.jee.jpa.unit.Persistence;
 import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
 import org.apache.openejb.jee.jpa.unit.TransactionType;
-import org.apache.openejb.jee.oejb2.EjbRefType;
-import org.apache.openejb.jee.oejb2.GeronimoEjbJarType;
+//import org.apache.openejb.jee.oejb2.EjbRefType;
 import org.apache.openejb.jee.oejb2.MessageDrivenBeanType;
 import org.apache.openejb.jee.oejb2.OpenejbJarType;
+//import org.apache.openejb.jee.oejb2.PatternType;
+//import org.apache.openejb.jee.oejb2.ResourceLocatorType;
 import org.apache.openejb.jee.oejb2.PatternType;
 import org.apache.openejb.jee.oejb2.ResourceLocatorType;
 import org.apache.openejb.loader.Options;
@@ -150,8 +155,6 @@ import org.apache.openejb.util.LinkResol
 import org.apache.openejb.util.UniqueDefaultLinkResolver;
 import org.apache.xbean.finder.ResourceFinder;
 import org.apache.xbean.osgi.bundle.util.BundleClassLoader;
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -169,7 +172,6 @@ import org.slf4j.LoggerFactory;
 public class EjbModuleBuilder implements ModuleBuilder, GBeanLifecycle, ModuleBuilderExtension {
     private static final Logger log = LoggerFactory.getLogger(EjbModuleBuilder.class);
 
-    private static final String OPENEJBJAR_NAMESPACE = XmlUtil.OPENEJBJAR_QNAME.getNamespaceURI();
     private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
     static {
         NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/openejb-jar", "http://openejb.apache.org/xml/ns/openejb-jar-2.3");
@@ -180,7 +182,6 @@ public class EjbModuleBuilder implements
         NAMESPACE_UPDATES.put("http://www.openejb.org/xml/ns/pkgen-2.0", "http://openejb.apache.org/xml/ns/pkgen-2.1");
     }
 
-    private final Environment defaultEnvironment;
     private final String defaultCmpJTADataSource;
     private final String defaultCmpNonJTADataSource;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
@@ -188,14 +189,12 @@ public class EjbModuleBuilder implements
     private final ResourceEnvironmentSetter resourceEnvironmentSetter;
     private final Collection<ModuleBuilderExtension> moduleBuilderExtensions;
 
-    public EjbModuleBuilder(@ParamAttribute(name = "defaultEnvironment")Environment defaultEnvironment,
-                            @ParamAttribute(name = "defaultCmpJTADataSource")String defaultCmpJTADataSource,
-                            @ParamAttribute(name = "defaultCmpNonJTADataSource")String defaultCmpNonJTADataSource,
-                            @ParamReference(name = "ModuleBuilderExtensions", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilderExtension> moduleBuilderExtensions,
-                            @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER)Collection<NamespaceDrivenBuilder> serviceBuilders,
-                            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER)NamingBuilder namingBuilders,
-                            @ParamReference(name = "ResourceEnvironmentSetter", namingType = NameFactory.MODULE_BUILDER)ResourceEnvironmentSetter resourceEnvironmentSetter) {
-        this.defaultEnvironment = defaultEnvironment;
+    public EjbModuleBuilder(@ParamAttribute(name = "defaultCmpJTADataSource") String defaultCmpJTADataSource,
+                            @ParamAttribute(name = "defaultCmpNonJTADataSource") String defaultCmpNonJTADataSource,
+                            @ParamReference(name = "ModuleBuilderExtensions", namingType = NameFactory.MODULE_BUILDER) Collection<ModuleBuilderExtension> moduleBuilderExtensions,
+                            @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER) Collection<NamespaceDrivenBuilder> serviceBuilders,
+                            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders,
+                            @ParamReference(name = "ResourceEnvironmentSetter", namingType = NameFactory.MODULE_BUILDER) ResourceEnvironmentSetter resourceEnvironmentSetter) {
         this.defaultCmpJTADataSource = defaultCmpJTADataSource;
         this.defaultCmpNonJTADataSource = defaultCmpNonJTADataSource;
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
@@ -225,12 +224,12 @@ public class EjbModuleBuilder implements
 
     @Override
     public void doStart() throws Exception {
-        XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
+//        XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
     @Override
     public void doStop() {
-        XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
+//        XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
     @Override
@@ -248,7 +247,8 @@ public class EjbModuleBuilder implements
 
 
     public String getSchemaNamespace() {
-        return EjbModuleBuilder.OPENEJBJAR_NAMESPACE;
+        return null;
+//        return EjbModuleBuilder.OPENEJBJAR_NAMESPACE;
     }
 
     @Override
@@ -308,13 +308,14 @@ public class EjbModuleBuilder implements
             throw new IllegalArgumentException("targetPath must not end with a '/'");
 
         ClassLoader classLoader = null;
+        // Get the geronimo-openejb.xml tree
+        boolean standAlone = earEnvironment == null;
         try {
             // verify we have a valid file
             String jarPath = moduleFile.getName();
 
             URL baseUrl = null;
 
-            Map<String, URL> descriptors = null;
 
             File jarFile = new File(moduleFile.getName());
 
@@ -324,46 +325,54 @@ public class EjbModuleBuilder implements
 
             ResourceFinder finder = new ResourceFinder("", classLoader, baseUrl);
 
-            descriptors = finder.getResourcesMap(ddDir);
+            Map<String, URL> descriptors = finder.getResourcesMap(ddDir);
 
             if (!isEjbModule(baseUrl, classLoader, descriptors)) {
                 releaseTempClassLoader(classLoader);
                 return null;
             }
 
-            // create the EJB Module
-            org.apache.openejb.config.EjbModule ejbModule = new org.apache.openejb.config.EjbModule(classLoader, null, jarPath, null, null);
-            ejbModule.getAltDDs().putAll(descriptors);
-
             if (specDDUrl != null) {
-                ejbModule.getAltDDs().put("ejb-jar.xml", specDDUrl);
+                descriptors.put("ejb-jar.xml", specDDUrl);
             }
 
+            GeronimoEjbJarType geronimoEjbJarType = null;
             // convert the vendor plan object to the ejbModule altDD map
-            XmlObject unknownXmlObject = null;
-            if (plan instanceof XmlObject) {
-                unknownXmlObject = (XmlObject) plan;
+            if (plan instanceof GeronimoEjbJarType) {
+                geronimoEjbJarType = (GeronimoEjbJarType) plan;
             } else if (plan != null) {
                 try {
-                    unknownXmlObject = XmlBeansUtil.parse(((File) plan).toURI().toURL(), XmlUtil.class.getClassLoader());
+                    InputStream in = new FileInputStream((File)plan);
+                    try {
+                        geronimoEjbJarType = XmlUtil.unmarshalGeronimoEjb(in, false);
+                    } finally {
+                        in.close();
+                    }
                 } catch (Exception e) {
                     throw new DeploymentException(e);
                 }
+            } else if (descriptors.containsKey("geronimo-openejb.xml")) {
+                URL planUrl = descriptors.remove("geronimo-openejb.xml");
+                InputStream in = planUrl.openStream();
+                try {
+                    geronimoEjbJarType = XmlUtil.unmarshalGeronimoEjb(in, false);
+                } finally {
+                    in.close();
+                }
             }
+            if (geronimoEjbJarType == null) {
+                // create default plan
+                String path = (standAlone) ? new File(moduleFile.getName()).getName() : targetPath;
+                geronimoEjbJarType = XmlUtil.createDefaultPlan(path, jarPath);
+            }
+            descriptors.remove("geronimo-openejb.xml");
 
-            if (unknownXmlObject != null) {
-                XmlCursor xmlCursor = unknownXmlObject.newCursor();
-                //
-                QName qname = xmlCursor.getName();
-                if (qname == null) {
-                    xmlCursor.toFirstChild();
-                    qname = xmlCursor.getName();
-                }
-                if (qname.getLocalPart().equals("openejb-jar")) {
-                    ejbModule.getAltDDs().put("openejb-jar.xml", xmlCursor.xmlText());
-                } else if (qname.getLocalPart().equals("ejb-jar") && qname.getNamespaceURI().equals("http://geronimo.apache.org/xml/ns/j2ee/ejb/openejb-2.0")) {
-                    ejbModule.getAltDDs().put("geronimo-openejb.xml", xmlCursor.xmlText());
-                }
+            // create the EJB Module
+            org.apache.openejb.config.EjbModule ejbModule = new org.apache.openejb.config.EjbModule(classLoader, null, jarPath, null, null);
+            ejbModule.getAltDDs().putAll(descriptors);
+
+            if (geronimoEjbJarType != null) {
+                ejbModule.getAltDDs().put("openejb-jar.xml", geronimoEjbJarType.getOpenejbJar());
             }
 
             // Read in the deploument desiptor files
@@ -374,25 +383,14 @@ public class EjbModuleBuilder implements
                 throw new DeploymentException("Failed parsing descriptors for module: " + moduleFile.getName(), e);
             }
 
-            // Get the geronimo-openejb.xml tree
-            boolean standAlone = earEnvironment == null;
-            GeronimoEjbJarType geronimoEjbJarType = (GeronimoEjbJarType) ejbModule.getAltDDs().get("geronimo-openejb.xml");
-            if (geronimoEjbJarType == null) {
-                // create default plan
-                String path = (standAlone) ? new File(moduleFile.getName()).getName() : targetPath;
-                geronimoEjbJarType = XmlUtil.createDefaultPlan(path, ejbModule.getEjbJar());
-                ejbModule.getAltDDs().put("geronimo-openejb.xml", geronimoEjbJarType);
-            }
-            OpenejbGeronimoEjbJarType geronimoOpenejb = XmlUtil.convertToXmlbeans(geronimoEjbJarType);
-
             // create the geronimo environment object
-            Environment environment = XmlUtil.buildEnvironment(geronimoEjbJarType.getEnvironment(), defaultEnvironment);
+            Environment environment = buildEnvironment(geronimoEjbJarType.getEnvironment());
             if (earEnvironment != null) {
-                EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
-                environment = earEnvironment;
-                if (!environment.getConfigId().isResolved()) {
-                    throw new IllegalStateException("EJB module ID should be fully resolved (not " + environment.getConfigId() + ")");
-                }
+//                EnvironmentBuilder.mergeEnvironments(earEnvironment, environment);
+//                environment = earEnvironment;
+//                if (!environment.getConfigId().isResolved()) {
+//                    throw new IllegalStateException("EJB module ID should be fully resolved (not " + environment.getConfigId() + ")");
+//                }
             } else {
                 idBuilder.resolve(environment, new File(moduleFile.getName()).getName(), "car");
             }
@@ -437,7 +435,7 @@ public class EjbModuleBuilder implements
             } else if (parentModule != null) {
                 context = Module.share(Module.APP, parentModule.getJndiContext());
             }
-            EjbModule module = new EjbModule(ejbModule, standAlone, moduleName, name, environment, moduleFile, targetPath, "", ejbJar, geronimoOpenejb, context, parentModule, subModule);
+            EjbModule module = new EjbModule(ejbModule, standAlone, moduleName, name, environment, moduleFile, targetPath, "", ejbJar, geronimoEjbJarType, context, parentModule, subModule);
 
             for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
                 try {
@@ -458,6 +456,19 @@ public class EjbModuleBuilder implements
             throw new DeploymentException(e);
         }
     }
+    private Environment buildEnvironment(EnvironmentType environmentType) {
+        Environment environment = new Environment();
+        ArtifactType artifactType = environmentType.getModuleId();
+        Artifact artifact = new Artifact(artifactType.getGroupId(), artifactType.getArtifactId(), artifactType.getVersion(), artifactType.getType());
+        environment.setConfigId(artifact);
+        environment.setBundleActivator(environmentType.getBundleActivator());
+        environment.addDynamicImportPackages(environmentType.getDynamicImportPackage());
+        environment.addExportPackages(environmentType.getExportPackage());
+        environment.addImportPackages(environmentType.getImportPackage());
+        environment.addRequireBundles(environmentType.getRequireBundle());
+
+        return environment;
+    }
 
     protected static void unmapReferences(EjbJar ejbJar, GeronimoEjbJarType geronimoEjbJarType) {
         Set<String> corbaEjbRefs = new TreeSet<String>();
@@ -659,9 +670,9 @@ public class EjbModuleBuilder implements
         ejbModule.setSpecDD(ejbJarType);*/
 
         // convert the plan to xmlbeans since geronimo naming is coupled on xmlbeans objects
-            OpenejbGeronimoEjbJarType geronimoOpenejb = XmlUtil.convertToXmlbeans(geronimoEjbJarType);
+//           GeronimoEjbJarType geronimoOpenejb = XmlUtil.convertToXmlbeans(geronimoEjbJarType);
 
-           ejbModule.getVendorDD().set(geronimoOpenejb);
+//           ejbModule.getVendorDD().set(geronimoOpenejb);
 
         // todo move namingBuilders.buildEnvironment() here when geronimo naming supports it
 

Modified: geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?rev=1100440&r1=1100439&r2=1100440&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java Sat May  7 03:47:48 2011
@@ -27,29 +27,24 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.JndiPlan;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationHelper;
+import org.apache.geronimo.j2ee.deployment.model.naming.EjbLocalRefType;
+import org.apache.geronimo.j2ee.deployment.model.naming.EjbRefType;
+import org.apache.geronimo.j2ee.deployment.model.naming.PatternType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.openejb.ClientEjbReference;
 import org.apache.geronimo.openejb.GeronimoEjbInfo;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.assembler.classic.AppInfo;
-import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.JndiEncBuilder;
 import org.apache.openejb.assembler.classic.JndiEncInfo;
 import org.apache.openejb.config.JndiEncInfoBuilder;
@@ -58,8 +53,6 @@ import org.apache.openejb.jee.EjbLocalRe
 import org.apache.openejb.jee.EjbRef;
 import org.apache.openejb.jee.InjectionTarget;
 import org.apache.openejb.jee.JndiConsumer;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.xmlbeans.XmlObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -69,36 +62,19 @@ import org.slf4j.LoggerFactory;
 public class EjbRefBuilder extends AbstractNamingBuilder {
     private static final Logger log = LoggerFactory.getLogger(EjbRefBuilder.class);
 
-    private final QNameSet ejbRefQNameSet;
-    private final QNameSet ejbLocalRefQNameSet;
     private final URI uri;
 
-    public EjbRefBuilder(Environment defaultEnvironment, String[] eeNamespaces, String host, int port) throws URISyntaxException {
-        super(defaultEnvironment);
+    public EjbRefBuilder(String host, int port) throws URISyntaxException {
+        super();
         if (host != null) {
             uri = new URI("ejbd", null, host, port, null, null, null);
         } else {
             uri = null;
         }
 
-        ejbRefQNameSet = buildQNameSet(eeNamespaces, "ejb-ref");
-        ejbLocalRefQNameSet = buildQNameSet(eeNamespaces, "ejb-local-ref");
-        ejbRefQNameSet.union(ejbLocalRefQNameSet);
     }
 
-    public QNameSet getSpecQNameSet() {
-        return ejbRefQNameSet;
-    }
-
-    public QNameSet getPlanQNameSet() {
-        return QNameSet.EMPTY;
-    }
-
-    protected boolean willMergeEnvironment(JndiConsumer specDD, XmlObject plan) {
-        return !specDD.getEjbRef().isEmpty() || !specDD.getEjbLocalRef().isEmpty();
-    }
-
-    public void buildNaming(JndiConsumer specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
+    public void buildNaming(JndiConsumer specDD, JndiPlan plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         // skip ejb modules... they have alreayd been processed
 //        if (module.getType() == ConfigurationModuleType.EJB) {
 //            return;
@@ -106,8 +82,8 @@ public class EjbRefBuilder extends Abstr
 
         // map the refs declared in the vendor plan, so we can match them to the spec references
         //TODO how do we tell openejb about these?
-        Map<String, GerEjbRefType> refMap = mapEjbRefs(plan);
-        Map<String, GerEjbLocalRefType> localRefMap = mapEjbLocalRefs(plan);
+        Map<String, EjbRefType> refMap = mapEjbRefs(plan);
+        Map<String, EjbLocalRefType> localRefMap = mapEjbLocalRefs(plan);
 
         // Discover and process any @EJB annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -210,15 +186,15 @@ public class EjbRefBuilder extends Abstr
         return value;
     }
 
-    private void addRefs(JndiConsumer jndiConsumer, Map<String, GerEjbRefType> refMap,
-            Map<String, GerEjbLocalRefType> localRefMap, Map<EARContext.Key, Object> sharedContext) {
+    private void addRefs(JndiConsumer jndiConsumer, Map<String, EjbRefType> refMap,
+            Map<String, EjbLocalRefType> localRefMap, Map<EARContext.Key, Object> sharedContext) {
 
         for (EjbRef spec_ejbRef : jndiConsumer.getEjbRef()) {
 
-            String refName = getStringValue(spec_ejbRef.getEjbRefName());
+            String refName = spec_ejbRef.getEjbRefName();
 
             // skip corba refs
-            GerEjbRefType ejbRefType = refMap.get(refName);
+            EjbRefType ejbRefType = refMap.get(refName);
 
             // merge info in alt-DD to spec DD.
             if (ejbRefType != null) {
@@ -231,7 +207,7 @@ public class EjbRefBuilder extends Abstr
                 spec_ejbRef.setEjbRefName(refName);
 
                 // ejb-ref-type
-                String refType = getStringValue(spec_ejbRef.getEjbRefType()==null?null:spec_ejbRef.getEjbRefType().name());
+                String refType = spec_ejbRef.getEjbRefType()==null?null:spec_ejbRef.getEjbRefType().name();
                 if ("SESSION".equalsIgnoreCase(refType)) {
                     spec_ejbRef.setEjbRefType(org.apache.openejb.jee.EjbRefType.SESSION);
                 } else if ("ENTITY".equalsIgnoreCase(refType)) {
@@ -241,34 +217,37 @@ public class EjbRefBuilder extends Abstr
                 }
 
                 // home
-                spec_ejbRef.setHome(getStringValue(spec_ejbRef.getHome()));
+                spec_ejbRef.setHome(spec_ejbRef.getHome());
 
                 // remote
-                spec_ejbRef.setRemote(getStringValue(spec_ejbRef.getRemote()));
+                spec_ejbRef.setRemote(spec_ejbRef.getRemote());
 
                 // ejb-link
-                spec_ejbRef.setEjbLink(getStringValue(spec_ejbRef.getEjbLink()));
+                spec_ejbRef.setEjbLink(spec_ejbRef.getEjbLink());
 
                 // mapped-name
-                spec_ejbRef.setMappedName(getStringValue(spec_ejbRef.getMappedName()));
+                spec_ejbRef.setMappedName(spec_ejbRef.getMappedName());
 
                 // handle external refs
                 
                 if (ejbRefType.getPattern() != null) {
                     // external ear ref
                     // set mapped name to the deploymentId of the external ref
-                    GerPatternType pattern = ejbRefType.getPattern();
+                    PatternType pattern = ejbRefType.getPattern();
                     String module = pattern.getModule();
+                    //TODO deal with filter
                     if (module == null) {
-                        module = pattern.getArtifactId();
+//                        module = pattern.get;
+                    }
+                    if (module != null) {
+                        String ejbName = pattern.getName();
+                        String deploymentId = module.trim() + "/" + ejbName;
+                        spec_ejbRef.setMappedName(deploymentId.trim());
                     }
-                    String ejbName = pattern.getName();
-                    String deploymentId = module.trim() + "/" + ejbName;
-                    spec_ejbRef.setMappedName(deploymentId.trim());
                 }
 
                 if (ejbRefType.getEjbLink() != null) {
-                    spec_ejbRef.setEjbLink(getStringValue(ejbRefType.getEjbLink()));
+                    spec_ejbRef.setEjbLink(ejbRefType.getEjbLink());
                 }
                     
 
@@ -279,10 +258,10 @@ public class EjbRefBuilder extends Abstr
                     List<InjectionTarget> injectionTargetsToAdd=new ArrayList<InjectionTarget>();
                     for (InjectionTarget injectionTargetType : spec_ejbRef.getInjectionTarget()) {
                         InjectionTarget newInjectionTarget = new InjectionTarget();
-                        newInjectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType
-                                .getInjectionTargetClass()));
-                        newInjectionTarget.setInjectionTargetName(getStringValue(injectionTargetType
-                                .getInjectionTargetName()));
+                        newInjectionTarget.setInjectionTargetClass(injectionTargetType
+                                .getInjectionTargetClass());
+                        newInjectionTarget.setInjectionTargetName(injectionTargetType
+                                .getInjectionTargetName());
                         injectionTargetsToAdd.add(newInjectionTarget);
                     }
                     spec_ejbRef.getInjectionTarget().addAll(injectionTargetsToAdd);
@@ -297,10 +276,10 @@ public class EjbRefBuilder extends Abstr
 
         for (EjbLocalRef localRefFromSpecDD : jndiConsumer.getEjbLocalRef()) {
 
-            String refName = getStringValue(localRefFromSpecDD.getEjbRefName());
+            String refName = localRefFromSpecDD.getEjbRefName();
 
             // skip corba refs
-            GerEjbLocalRefType ejbLocalRefType = localRefMap.get(refName);
+            EjbLocalRefType ejbLocalRefType = localRefMap.get(refName);
 
             // merge info in alt-DD to spec DD.
             if (ejbLocalRefType != null) {
@@ -309,7 +288,7 @@ public class EjbRefBuilder extends Abstr
                 localRefFromSpecDD.setEjbRefName(refName);
 
                 // ejb-ref-type
-                String refType = getStringValue(localRefFromSpecDD.getType());
+                String refType = localRefFromSpecDD.getType();
                 if ("SESSION".equalsIgnoreCase(refType)) {
                     localRefFromSpecDD.setEjbRefType(org.apache.openejb.jee.EjbRefType.SESSION);
                 } else if ("ENTITY".equalsIgnoreCase(refType)) {
@@ -317,29 +296,32 @@ public class EjbRefBuilder extends Abstr
                 }
 
                 // home
-                localRefFromSpecDD.setLocalHome(getStringValue(localRefFromSpecDD.getLocalHome()));
+                localRefFromSpecDD.setLocalHome(localRefFromSpecDD.getLocalHome());
 
                 // remote
-                localRefFromSpecDD.setLocal(getStringValue(localRefFromSpecDD.getLocal()));
+                localRefFromSpecDD.setLocal(localRefFromSpecDD.getLocal());
 
                 // ejb-link
-                localRefFromSpecDD.setEjbLink(getStringValue(localRefFromSpecDD.getEjbLink()));
+                localRefFromSpecDD.setEjbLink(localRefFromSpecDD.getEjbLink());
 
                 // mapped-name
-                localRefFromSpecDD.setMappedName(getStringValue(localRefFromSpecDD.getMappedName()));
+                localRefFromSpecDD.setMappedName(localRefFromSpecDD.getMappedName());
 
                 // handle external refs
                 if (ejbLocalRefType.getPattern() != null) {
                     // external ear ref
                     // set mapped name to the deploymentId of the external ref
-                    GerPatternType pattern = ejbLocalRefType.getPattern();
+                    PatternType pattern = ejbLocalRefType.getPattern();
                     String module = pattern.getModule();
-                    if (module == null) {
-                        module = pattern.getArtifactId();
+                    //TODO deal with filter
+//                    if (module == null) {
+//                        module = pattern.getArtifactId();
+//                    }
+                    if (module != null) {
+                        String ejbName = pattern.getName();
+                        String deploymentId = module.trim() + "/" + ejbName;
+                        localRefFromSpecDD.setMappedName(deploymentId.trim());
                     }
-                    String ejbName = pattern.getName();
-                    String deploymentId = module.trim() + "/" + ejbName;
-                    localRefFromSpecDD.setMappedName(deploymentId.trim());
                 }
 
                 // openejb handling of injection-targets
@@ -348,10 +330,10 @@ public class EjbRefBuilder extends Abstr
                     
                     for (InjectionTarget injectionTargetType : localRefFromSpecDD.getInjectionTarget()) {
                         InjectionTarget injectionTarget = new InjectionTarget();
-                        injectionTarget.setInjectionTargetClass(getStringValue(injectionTargetType
-                                .getInjectionTargetClass()));
-                        injectionTarget.setInjectionTargetName(getStringValue(injectionTargetType
-                                .getInjectionTargetName()));
+                        injectionTarget.setInjectionTargetClass(injectionTargetType
+                                .getInjectionTargetClass());
+                        injectionTarget.setInjectionTargetName(injectionTargetType
+                                .getInjectionTargetName());
                         injectionTargetsToAdd.add(injectionTarget);
                     }
                     
@@ -364,39 +346,29 @@ public class EjbRefBuilder extends Abstr
         }
     }
 
-    private Map<String, GerEjbRefType> mapEjbRefs(XmlObject plan) {
-        Map<String, GerEjbRefType> refMap = new HashMap<String, GerEjbRefType>();
+    private Map<String, EjbRefType> mapEjbRefs(JndiPlan plan) {
+        Map<String, EjbRefType> refMap = new HashMap<String, EjbRefType>();
 
         if (plan == null) {
             return refMap;
         }
 
-        QNameSet qnameSet = QNameSet.singleton(GerEjbRefDocument.type.getDocumentElementName());
-        XmlObject[] xmlObjects = plan.selectChildren(qnameSet);
-        if (xmlObjects != null) {
-            for (XmlObject xmlObject : xmlObjects) {
-                GerEjbRefType ref = (GerEjbRefType) xmlObject.copy().changeType(GerEjbRefType.type);
+            for (EjbRefType ref: plan.getEjbRef()) {
                 refMap.put(ref.getRefName().trim(), ref);
             }
-        }
         return refMap;
     }
 
-    private Map<String, GerEjbLocalRefType> mapEjbLocalRefs(XmlObject plan) {
-        Map<String, GerEjbLocalRefType> refMap = new HashMap<String, GerEjbLocalRefType>();
+    private Map<String, EjbLocalRefType> mapEjbLocalRefs(JndiPlan plan) {
+        Map<String, EjbLocalRefType> refMap = new HashMap<String, EjbLocalRefType>();
 
         if (plan == null) {
             return refMap;
         }
 
-        QNameSet qnameSet = QNameSet.singleton(GerEjbLocalRefDocument.type.getDocumentElementName());
-        XmlObject[] xmlObjects = plan.selectChildren(qnameSet);
-        if (xmlObjects != null) {
-            for (XmlObject xmlObject : xmlObjects) {
-                GerEjbLocalRefType ref = (GerEjbLocalRefType) xmlObject.copy().changeType(GerEjbLocalRefType.type);
+            for (EjbLocalRefType ref: plan.getEjbLocalRef()) {
                 refMap.put(ref.getRefName().trim(), ref);
             }
-        }
         return refMap;
     }
 
@@ -428,12 +400,10 @@ public class EjbRefBuilder extends Abstr
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EjbRefBuilder.class, NameFactory.MODULE_BUILDER);
 
-        infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
-        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
         infoBuilder.addAttribute("host", String.class, true);
         infoBuilder.addAttribute("port", int.class, true);
 
-        infoBuilder.setConstructor(new String[]{"defaultEnvironment", "eeNamespaces", "host", "port"});
+        infoBuilder.setConstructor(new String[]{"host", "port"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }



Mime
View raw message