geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r535381 [1/2] - in /geronimo/server/trunk: configs/client-deployer/src/plan/ modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ mod...
Date Fri, 04 May 2007 21:04:20 GMT
Author: djencks
Date: Fri May  4 14:04:18 2007
New Revision: 535381

URL: http://svn.apache.org/viewvc?view=rev&rev=535381
Log:
GERONIMO-3134 GERONIMO-3136 Fix app client refs including ejb refs.  Get a lot closer to jpa working on the app client

Modified:
    geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
    geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
    geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
    geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/TSSLinkBuilder.java
    geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/AbstractBuilderCollection.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
    geronimo/server/trunk/modules/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
    geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml Fri May  4 14:04:18 2007
@@ -31,15 +31,18 @@
         <reference name="ServiceBuilders">
             <name>GBeanBuilder</name>
         </reference>
+        <references name="ModuleBuilderExtensions">
+            <pattern>
+                <name>PersistenceUnitBuilder</name>
+            </pattern>
+        </references>
         <references name="NamingBuilders">
             <pattern>
                 <name>GBeanRefBuilder</name>
             </pattern>
-<!--  temporariy removed to avoid duplicate loading of rmi-naming in client & server until we can get client/server specific jpa configs created.
             <pattern>
-                <name>PersistenceContextRefBuilder</name>
+                <name>PersistenceUnitRefBuilder</name>
             </pattern>
--->
             <pattern>
                 <name>ClientResourceRefBuilder</name>
             </pattern>

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java Fri May  4 14:04:18 2007
@@ -35,7 +35,6 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.ClassLoading;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
@@ -69,7 +68,7 @@
         return specDD.selectChildren(serviceRefQNameSet).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         List<ServiceRefType> serviceRefsUntyped = convert(specDD.selectChildren(serviceRefQNameSet), JEE_CONVERTER, ServiceRefType.class, ServiceRefType.type);
         XmlObject[] gerServiceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_SERVICE_REF_QNAME_SET);
         Map serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);

Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Fri May  4 14:04:18 2007
@@ -65,6 +65,7 @@
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
 import org.apache.geronimo.j2ee.deployment.SecurityBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApplicationClient;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
@@ -109,6 +110,7 @@
     private final SingleElementCollection securityBuilder;
     private final NamespaceDrivenBuilderCollection serviceBuilder;
     private final NamingBuilderCollection namingBuilders;
+    private final Collection<ModuleBuilderExtension> moduleBuilderExtensions;
 
     private final Collection<Repository> repositories;
 
@@ -123,7 +125,8 @@
             ModuleBuilder connectorModuleBuilder,
             NamespaceDrivenBuilder securityBuilder,
             NamespaceDrivenBuilder serviceBuilder,
-            Collection namingBuilders) {
+            Collection<NamingBuilder> namingBuilders,
+            Collection<ModuleBuilderExtension> moduleBuilderExtensions) {
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionManagerObjectName,
@@ -132,7 +135,8 @@
                 repositories, new SingleElementCollection(connectorModuleBuilder),
                 new SingleElementCollection(securityBuilder),
                 serviceBuilder == null ? Collections.EMPTY_SET : Collections.singleton(serviceBuilder),
-                namingBuilders == null ? Collections.EMPTY_SET : namingBuilders);
+                namingBuilders == null ? Collections.EMPTY_SET : namingBuilders,
+                moduleBuilderExtensions);
     }
 
     public AppClientModuleBuilder(AbstractNameQuery transactionManagerObjectName,
@@ -141,19 +145,23 @@
             Collection<Repository> repositories,
             Collection connectorModuleBuilder,
             Collection securityBuilder,
-            Collection serviceBuilder,
-            Collection namingBuilders,
+            Collection<NamespaceDrivenBuilder> serviceBuilder,
+            Collection<NamingBuilder> namingBuilders,
+            Collection<ModuleBuilderExtension> moduleBuilderExtensions,
             Environment defaultClientEnvironment,
-            Environment defaultServerEnvironment) {
+            Environment defaultServerEnvironment
+    ) {
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionManagerObjectName,
                 connectionTrackerObjectName,
                 corbaGBeanObjectName,
-                repositories, new SingleElementCollection(connectorModuleBuilder),
+                repositories,
+                new SingleElementCollection(connectorModuleBuilder),
                 new SingleElementCollection(securityBuilder),
                 serviceBuilder,
-                namingBuilders);
+                namingBuilders,
+                moduleBuilderExtensions);
     }
 
     private AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -164,7 +172,9 @@
             Collection<Repository> repositories,
             SingleElementCollection connectorModuleBuilder,
             SingleElementCollection securityBuilder,
-            Collection serviceBuilder, Collection namingBuilders) {
+            Collection<NamespaceDrivenBuilder> serviceBuilder,
+            Collection<NamingBuilder> namingBuilders,
+            Collection<ModuleBuilderExtension> moduleBuilderExtensions) {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
@@ -175,6 +185,7 @@
         this.securityBuilder = securityBuilder;
         this.serviceBuilder = new NamespaceDrivenBuilderCollection(serviceBuilder, GBeanBuilder.SERVICE_QNAME);
         this.namingBuilders = new NamingBuilderCollection(namingBuilders, GerAbstractNamingEntryDocument.type.getDocumentElementName());
+        this.moduleBuilderExtensions = moduleBuilderExtensions;
     }
 
 
@@ -329,7 +340,11 @@
         // Create the AnnotatedApp interface for the AppClientModule
         AnnotatedApplicationClient annotatedApplicationClient = new AnnotatedApplicationClient(appClient);
 
-        return new AppClientModule(standAlone, moduleName, clientBaseName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, mainClass, gerAppClient, specDD, resourceModules, annotatedApplicationClient);
+        AppClientModule module = new AppClientModule(standAlone, moduleName, clientBaseName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, mainClass, gerAppClient, specDD, resourceModules, annotatedApplicationClient);
+        for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
+            mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, clientEnvironment, null, earName, naming, idBuilder);
+        }
+        return module;
     }
 
     GerApplicationClientType getGeronimoAppClient(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, ApplicationClientType appClient, Environment environment) throws DeploymentException {
@@ -491,9 +506,8 @@
                     corbaGBeanObjectName
             );
             appClientModule.setEarContext(appClientDeploymentContext);
-            appClientModule.setRootEarContext(earContext);
-            // extract the app client jar file into a standalone packed jar file and add the contents to the output
-//            JarFile moduleFile = module.getModuleFile();
+            appClientModule.setRootEarContext(appClientDeploymentContext);
+
             try {
                 appClientDeploymentContext.addIncludeAsPackedJar(URI.create(module.getTargetPath()), moduleFile);
             } catch (IOException e) {
@@ -518,6 +532,9 @@
             getConnectorModuleBuilder().installModule(connectorModule.getModuleFile(), appClientDeploymentContext, connectorModule, configurationStores, targetConfigurationStore, repositories);
         }
 
+        for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
+            mbe.installModule(module.getModuleFile(), appClientDeploymentContext, module, configurationStores, targetConfigurationStore, repositories);
+        }
     }
 
     public void initContext(EARContext earContext, Module clientModule, ClassLoader cl) throws DeploymentException {
@@ -527,6 +544,9 @@
         for (ConnectorModule connectorModule : appClientModule.getResourceModules()) {
             getConnectorModuleBuilder().initContext(appClientModule.getEarContext(), connectorModule, cl);
         }
+        for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
+            mbe.initContext(earContext, clientModule, cl);
+        }
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader earClassLoader, Collection repositories) throws DeploymentException {
@@ -547,7 +567,6 @@
             if (!module.isStandAlone()) {
                 appClientModuleGBeanData.setReferencePattern("J2EEApplication", earContext.getModuleName());
             }
-// below    appClientModuleGBeanData.setAttribute("deploymentDescriptor", appClientModule.getOriginalSpecDD());
 
         } catch (Exception e) {
             throw new DeploymentException("Unable to initialize AppClientModule GBean", e);
@@ -559,6 +578,17 @@
         }
 
         EARContext appClientDeploymentContext = appClientModule.getEarContext();
+        //Share the ejb info with the ear.
+        //TODO this might be too much, but I don't want to impose a dependency on geronimo-openejb to get
+        //EjbModuleBuilder.EarData.class
+        Map<Object, Object> generalData = earContext.getGeneralData();
+        for (Map.Entry<Object, Object> entry : generalData.entrySet()) {
+            Object key = entry.getKey();
+            if (key instanceof Class && ((Class)key).getName().equals("org.apache.geronimo.openejb.deployment.EjbModuleBuilder$EarData")) {
+                appClientDeploymentContext.getGeneralData().put(key, entry.getValue());
+                break;
+            }
+        }
 
         // Create a Module ID Builder defaulting to similar settings to use for any children we create
         ModuleIDBuilder idBuilder = new ModuleIDBuilder();
@@ -568,7 +598,7 @@
             try {
 
                 //register the message destinations in the app client ear context.
-                namingBuilders.initContext(appClient, geronimoAppClient, appClientDeploymentContext.getConfiguration(), earContext.getConfiguration(), appClientModule);
+                namingBuilders.initContext(appClient, geronimoAppClient, appClientModule);
                 // extract the client Jar file into a standalone packed jar file and add the contents to the output
                 URI moduleBase = new URI(appClientModule.getTargetPath());
                 try {
@@ -613,7 +643,7 @@
                         appClientModule.setClassFinder(createAppClientClassFinder(appClient, appClientModule));
                     }
 
-                    namingBuilders.buildNaming(appClient, geronimoAppClient, localConfiguration, remoteConfiguration, appClientModule, buildingContext);
+                    namingBuilders.buildNaming(appClient, geronimoAppClient, appClientModule, buildingContext);
 
                     if (!appClient.getMetadataComplete()) {
                         appClient.setMetadataComplete(true);
@@ -666,6 +696,11 @@
                 }
                 appClientDeploymentContext.addGBean(appClientContainerGBeanData);
 
+                //TODO this may definitely not be the best place for this!
+                for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
+                    mbe.addGBeans(appClientDeploymentContext, appClientModule, appClientClassLoader, repositories);
+                }
+
                 // get the configuration data
                 earContext.addAdditionalDeployment(appClientDeploymentContext.getConfigurationData());
             } finally {
@@ -833,6 +868,7 @@
         infoBuilder.addReference("SecurityBuilder", SecurityBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class, NameFactory.MODULE_BUILDER);
 
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -844,6 +880,7 @@
                 "SecurityBuilder",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ModuleBuilderExtensions",
                 "defaultClientEnvironment",
                 "defaultServerEnvironment",
         });

Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java Fri May  4 14:04:18 2007
@@ -36,7 +36,7 @@
     private AppClientModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, Collections.EMPTY_LIST, null, null, null, null);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, Collections.EMPTY_LIST, null, null, null, null, Collections.EMPTY_LIST);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Fri May  4 14:04:18 2007
@@ -25,7 +25,6 @@
 
 import javax.annotation.Resource;
 import javax.naming.Reference;
-import javax.naming.LinkRef;
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
@@ -36,6 +35,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -87,7 +87,7 @@
         return specDD.selectChildren(adminOjbectRefQNameSet).length > 0 || specDD.selectChildren(messageDestinationRefQNameSet).length > 0;
     }
 
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+    public void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException {
         List<MessageDestinationType> specDestinations = convert(specDD.selectChildren(messageDestinationQNameSet), JEE_CONVERTER, MessageDestinationType.class, MessageDestinationType.type);
         XmlObject[] gerDestinations = plan.selectChildren(GER_MESSAGE_DESTINATION_QNAME_SET);
         Map<String, GerMessageDestinationType> nameMap = new HashMap<String, GerMessageDestinationType>();
@@ -110,8 +110,7 @@
     }
 
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
-
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         XmlObject[] gerResourceEnvRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_ADMIN_OBJECT_REF_QNAME_SET);
         Map<String, GerResourceEnvRefType> refMap = mapResourceEnvRefs(gerResourceEnvRefsUntyped);
         Map<String, Map<String, GerMessageDestinationType>> messageDestinations = module.getRootEarContext().getMessageDestinations();
@@ -121,7 +120,7 @@
 
             // Process all the annotations for this naming builder type
             try {
-                ResourceAnnotationHelper.processAnnotations(module.getAnnotatedApp(), module.getClassFinder(), new AdminObjectRefProcessor(localConfiguration, refMap, messageDestinations));
+                ResourceAnnotationHelper.processAnnotations(module.getAnnotatedApp(), module.getClassFinder(), new AdminObjectRefProcessor(refMap, messageDestinations, module.getEarContext()));
             }
             catch (Exception e) {
                 log.warn("Unable to process @Resource annotations for module" + module.getName(), e);
@@ -148,7 +147,7 @@
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 } else {
                     AbstractNameQuery containerId = getAdminObjectContainerId(name, gerResourceEnvRef);
-                    Reference ref = buildAdminObjectReference(localConfiguration, remoteConfiguration, containerId, iface);
+                    Reference ref = buildAdminObjectReference(module, containerId, iface);
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 }
             } catch (UnresolvedReferenceException e) {
@@ -207,7 +206,7 @@
             //try to resolve ref based only matching resource-ref-name
             //throws exception if it can't locate ref.
             AbstractNameQuery containerId = buildAbstractNameQuery(null, moduleURI, linkName, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
-            Reference ref = buildAdminObjectReference(localConfiguration, remoteConfiguration, containerId, iface);
+            Reference ref = buildAdminObjectReference(module, containerId, iface);
             getJndiContextMap(componentContext).put(ENV + name, ref);
 
         }
@@ -246,13 +245,14 @@
     }
 
 
-    private Reference buildAdminObjectReference(Configuration localConfiguration, Configuration remoteConfiguration, AbstractNameQuery containerId, Class iface) throws DeploymentException {
+    private Reference buildAdminObjectReference(Module module, AbstractNameQuery containerId, Class iface) throws DeploymentException {
+        Configuration localConfiguration = module.getEarContext().getConfiguration();
         try {
             localConfiguration.findGBean(containerId);
         } catch (GBeanNotFoundException e) {
             throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId());
         }
-        return new ResourceReference(getConfigId(localConfiguration, remoteConfiguration), containerId, iface);
+        return new ResourceReference(module.getConfigId(), containerId, iface);
     }
 
     private static AbstractNameQuery getAdminObjectContainerId(String name, GerResourceEnvRefType gerResourceEnvRef) {
@@ -295,14 +295,14 @@
     }
 
     public static class AdminObjectRefProcessor extends ResourceAnnotationHelper.ResourceProcessor {
-        private final Configuration localConfiguration;
+        private final EARContext earContext;
         private final Map<String, GerResourceEnvRefType> refMap;
         private final Map<String, Map<String, GerMessageDestinationType>> messageDestinations;
 
-        public AdminObjectRefProcessor(Configuration localConfiguration, Map<String, GerResourceEnvRefType> refMap, Map<String, Map<String, GerMessageDestinationType>> messageDestinations) {
-            this.localConfiguration = localConfiguration;
+        public AdminObjectRefProcessor(Map<String, GerResourceEnvRefType> refMap, Map<String, Map<String, GerMessageDestinationType>> messageDestinations, EARContext earContext) {
             this.refMap = refMap;
             this.messageDestinations = messageDestinations;
+            this.earContext = earContext;
         }
 
         public boolean processResource(AnnotatedApp annotatedApp, Resource annotation, Class cls, Method method, Field field) throws DeploymentException {
@@ -355,7 +355,7 @@
                     //look for an JCAAdminObject gbean with the right name
                     AbstractNameQuery containerId = buildAbstractNameQuery(null, null, resourceName, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
                     try {
-                        localConfiguration.findGBean(containerId);
+                        earContext.findGBean(containerId);
                     } catch (GBeanNotFoundException e) {
                         //not identifiable as an admin object ref
                         return false;

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Fri May  4 14:04:18 2007
@@ -47,7 +47,6 @@
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -98,7 +97,7 @@
         return specDD.selectChildren(resourceRefQNameSet).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
 
         // Discover and process any @Resource annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -145,7 +144,7 @@
                 }
                 AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
                 if (corbaName != null) {
-                    Artifact[] moduleId = getConfigId(localConfiguration, remoteConfiguration);
+                    Artifact[] moduleId = module.getConfigId();
                     Map context = getJndiContextMap(componentContext);
                     context.put(ENV + name, new ORBReference(moduleId, corbaName));
                 }
@@ -164,9 +163,9 @@
                 try {
                     AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);
 
-                    localConfiguration.findGBean(containerId);
+                    module.getEarContext().findGBean(containerId);
 
-                    Reference ref = new ResourceReference(getConfigId(localConfiguration, remoteConfiguration), containerId, iface);
+                    Reference ref = new ResourceReference(module.getConfigId(), containerId, iface);
                     getJndiContextMap(componentContext).put(ENV + name, ref);
                 } catch (GBeanNotFoundException e) {
 
@@ -189,7 +188,7 @@
                         errorMessage.append(gerResourceRef.getPattern());
                     }
                     errorMessage.append("\nSearch conducted in current module and dependencies:\n");
-                    for (Dependency dependency : localConfiguration.getEnvironment().getDependencies()) {
+                    for (Dependency dependency : module.getEnvironment().getDependencies()) {
                         errorMessage.append(dependency).append("\n");
                     }
                     errorMessage.append(")");

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java Fri May  4 14:04:18 2007
@@ -50,7 +50,6 @@
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
@@ -72,10 +71,6 @@
     protected void setUp() throws Exception {
         super.setUp();
         Artifact id = new Artifact("test", "test", "", "car");
-        configuration = new Configuration(Collections.EMPTY_LIST,
-                new ConfigurationData(id, naming),
-                new ConfigurationResolver(id, null),
-                null);
         module  = new ConnectorModule(false, new AbstractName(id, Collections.singletonMap("name", "test")), null, null, "foo", null, null, null, null);
         EARContext earContext = new EARContext(new File("foo"), null, new Environment(new Artifact("foo", "bar", "1.0", "car")), ConfigurationModuleType.EAR, naming,
                 new ConfigurationManager() {
@@ -221,6 +216,7 @@
                 }, null, null, null, null, null, null, null, null);
         module.setEarContext(earContext);
         module.setRootEarContext(earContext);
+        configuration = earContext.getConfiguration();
         baseName = naming.createRootName(configuration.getId(), "testRoot", NameFactory.RESOURCE_ADAPTER_MODULE);
     }
 
@@ -255,12 +251,12 @@
     public void testMessageDestinations() throws Exception {
         XmlObject specDD = parse(SPECDD1);
         XmlObject plan = parse(PLAN1);
-        adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+        adminObjectRefBuilder.initContext(specDD, plan, module);
         AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
         AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
         configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
         configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
-        adminObjectRefBuilder.buildNaming(specDD, plan, configuration, configuration, module, componentContext);
+        adminObjectRefBuilder.buildNaming(specDD, plan, module, componentContext);
         assertEquals(2, NamingBuilder.JNDI_KEY.get(componentContext).size());
     }
 
@@ -279,12 +275,12 @@
     public void testMessageDestinationsWithModule() throws Exception {
         XmlObject specDD = parse(SPECDD1);
         XmlObject plan = parse(PLAN2);
-        adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+        adminObjectRefBuilder.initContext(specDD, plan, module);
         AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
         AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
         configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
         configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
-        adminObjectRefBuilder.buildNaming(specDD, plan, configuration, configuration, module, componentContext);
+        adminObjectRefBuilder.buildNaming(specDD, plan, module, componentContext);
         assertEquals(2, NamingBuilder.JNDI_KEY.get(componentContext).size());
     }
 
@@ -296,7 +292,7 @@
         XmlObject specDD = parse(SPECDD2);
         XmlObject plan = parse(PLAN1);
         try {
-            adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+            adminObjectRefBuilder.initContext(specDD, plan, module);
             fail("tried to register a GerMessageDestination witout a MessageDestination and it succeeded");
         } catch (DeploymentException e) {
 

Modified: geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/CorbaRefBuilder.java Fri May  4 14:04:18 2007
@@ -22,7 +22,6 @@
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.QNameSet;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -56,13 +55,13 @@
 //        return false;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
-        if (matchesDefaultEnvironment(localConfiguration.getEnvironment())) {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+        if (matchesDefaultEnvironment(module.getEnvironment())) {
             CorbaGBeanNameSource corbaGBeanNameSource = (CorbaGBeanNameSource) corbaGBeanNameSourceCollection.getElement();
             if (corbaGBeanNameSource != null) {
                 AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
                 if (corbaName != null) {
-                    Artifact[] moduleId = getConfigId(localConfiguration, remoteConfiguration);
+                    Artifact[] moduleId = module.getConfigId();
                     Map context = getJndiContextMap(componentContext);
                     context.put("ORB", new ORBReference(moduleId, corbaName));
                     context.put("HandleDelegate", new HandleDelegateReference(moduleId, corbaName));

Modified: geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java Fri May  4 14:04:18 2007
@@ -33,7 +33,6 @@
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.openejb.deployment.EjbRefBuilder;
 import org.apache.geronimo.schema.NamespaceElementConverter;
 import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefDocument;
@@ -93,34 +92,34 @@
 //        return false;
 //    }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         XmlObject[] ejbRefsUntyped = convert(specDD.selectChildren(ejbRefQNameSet), JEE_CONVERTER, EjbRefType.type);
         XmlObject[] gerEjbRefsUntyped = plan == null ? NO_REFS : convert(plan.selectChildren(GER_EJB_REF_QNAME_SET), OPENEJB_CONVERTER, GerEjbRefType.type);
         Map ejbRefMap = mapEjbRefs(gerEjbRefsUntyped);
         ClassLoader cl = module.getEarContext().getClassLoader();
 
-        for (int i = 0; i < ejbRefsUntyped.length; i++) {
-            EjbRefType ejbRef = (EjbRefType) ejbRefsUntyped[i];
+        for (XmlObject anEjbRefsUntyped : ejbRefsUntyped) {
+            EjbRefType ejbRef = (EjbRefType) anEjbRefsUntyped;
 
             String ejbRefName = getStringValue(ejbRef.getEjbRefName());
             addInjections(ejbRefName, ejbRef.getInjectionTargetArray(), componentContext);
             GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
 
-            Reference ejbReference = addEJBRef(localConfiguration, remoteConfiguration, module.getModuleURI(), ejbRef, remoteRef, cl);
+            Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, cl);
             if (ejbReference != null) {
                 getJndiContextMap(componentContext).put(ENV + ejbRefName, ejbReference);
             }
         }
     }
 
-    private Reference addEJBRef(Configuration localConfiguration, Configuration earConfiguration, URI moduleURI, EjbRefType ejbRef, GerEjbRefType remoteRef, ClassLoader cl) throws DeploymentException {
+    private Reference addEJBRef(Module module, EjbRefType ejbRef, GerEjbRefType remoteRef, ClassLoader cl) throws DeploymentException {
         Reference ejbReference = null;
         if (remoteRef != null && remoteRef.isSetNsCorbaloc()) {
             String refName = getStringValue(ejbRef.getEjbRefName());
             String home = getStringValue(ejbRef.getHome());
             String remote = getStringValue(ejbRef.getRemote());
 
-            verifyInterfaces(refName, moduleURI, cl, remote, home);
+            verifyInterfaces(refName, module.getModuleURI(), cl, remote, home);
 
             try {
                 // create the cssBean query
@@ -135,13 +134,13 @@
 
                 // verify the cssBean query is valid
                 try {
-                    localConfiguration.findGBean(cssBean);
+                    module.getEarContext().findGBean(cssBean);
                 } catch (GBeanNotFoundException e) {
-                    throw new DeploymentException("Could not find css bean matching " + cssBean + " from configuration " + localConfiguration.getId());
+                    throw new DeploymentException("Could not find css bean matching " + cssBean + " from configuration " + module.getConfigId());
                 }
 
                 // create ref
-                ejbReference = new CORBAProxyReference(getConfigId(localConfiguration, earConfiguration), cssBean, new URI(remoteRef.getNsCorbaloc().trim()), remoteRef.getName().trim(), home);
+                ejbReference = new CORBAProxyReference(module.getConfigId(), cssBean, new URI(remoteRef.getNsCorbaloc().trim()), remoteRef.getName().trim(), home);
             } catch (URISyntaxException e) {
                 throw new DeploymentException("Could not construct CORBA NameServer URI: " + remoteRef.getNsCorbaloc(), e);
             }

Modified: geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/TSSLinkBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/TSSLinkBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/TSSLinkBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/TSSLinkBuilder.java Fri May  4 14:04:18 2007
@@ -35,7 +35,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
@@ -72,7 +71,7 @@
 //                plan.selectChildren(TSS_QNAME).length > 0);
 //    }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         if (plan == null) {
             return;
         }
@@ -88,11 +87,11 @@
             String moduleString = moduleURI == null ? null : moduleURI.toString();
             AbstractNameQuery tssBeanName = ENCConfigBuilder.buildAbstractNameQuery(null, moduleString, tssLink, NameFactory.EJB_MODULE, NameFactory.EJB_MODULE);
             try {
-                localConfiguration.findGBean(tssBeanName);
+                module.getEarContext().findGBean(tssBeanName);
             } catch (GBeanNotFoundException e) {
                 tssBeanName = ENCConfigBuilder.buildAbstractNameQuery(null, null, tssLink, null, NameFactory.EJB_MODULE);
                 try {
-                    localConfiguration.findGBean(tssBeanName);
+                    module.getEarContext().findGBean(tssBeanName);
                 } catch (GBeanNotFoundException e1) {
                     throw new DeploymentException("No tss bean found", e);
                 }
@@ -103,7 +102,7 @@
             tssLinkData.setReferencePattern("EJB", ejbName);
             tssLinkData.setReferencePattern("TSSBean", tssBeanName);
             try {
-                localConfiguration.addGBean(tssLinkData);
+                module.getEarContext().addGBean(tssLinkData);
             } catch (GBeanAlreadyExistsException e) {
                 throw new DeploymentException("tss link gbean already present", e);
             }
@@ -117,7 +116,7 @@
             tssLinkData.setReferencePattern("EJB", ejbName);
             tssLinkData.setReferencePattern("TSSBean", tssBeanName);
             try {
-                localConfiguration.addGBean(tssLinkData);
+                module.getEarContext().addGBean(tssLinkData);
             } catch (GBeanAlreadyExistsException e) {
                 throw new DeploymentException("tss link gbean already present", e);
             }

Modified: geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/AbstractBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/AbstractBuilderCollection.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/AbstractBuilderCollection.java (original)
+++ geronimo/server/trunk/modules/geronimo-deployment/src/main/java/org/apache/geronimo/deployment/AbstractBuilderCollection.java Fri May  4 14:04:18 2007
@@ -18,37 +18,36 @@
 
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Iterator;
 
 import javax.xml.namespace.QName;
 
-import org.apache.xmlbeans.QNameSet;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.ReferenceCollection;
-import org.apache.geronimo.gbean.ReferenceCollectionListener;
 import org.apache.geronimo.gbean.ReferenceCollectionEvent;
+import org.apache.geronimo.gbean.ReferenceCollectionListener;
+import org.apache.xmlbeans.QNameSet;
 
 /**
  * @version $Rev$ $Date$
  */
-public abstract class AbstractBuilderCollection {
-    protected final Collection builders;
+public abstract class AbstractBuilderCollection<T> {
+    protected final Collection<T> builders;
     protected final QName basePlanElementName;
     protected QNameSet specQNames = QNameSet.EMPTY;
     protected QNameSet planQNames = QNameSet.EMPTY;
 
-    protected AbstractBuilderCollection(Collection builders, final QName basePlanElementName) {
+    protected AbstractBuilderCollection(Collection<T> builders, final QName basePlanElementName) {
         this.builders = builders == null ? Collections.EMPTY_SET : builders;
         this.basePlanElementName = basePlanElementName;
         if (builders instanceof ReferenceCollection) {
             ((ReferenceCollection) builders).addReferenceCollectionListener(new ReferenceCollectionListener() {
 
                 public void memberAdded(ReferenceCollectionEvent event) {
-                    addBuilder(event.getMember());
+                    addBuilder((T) event.getMember());
                 }
 
                 public void memberRemoved(ReferenceCollectionEvent event) {
-                    Object builder = event.getMember();
+                    T builder = (T) event.getMember();
                     QNameSet builderSpecQNames = ((AbstractNamespaceBuilder) builder).getSpecQNameSet();
                     specQNames = specQNames.intersect(builderSpecQNames.inverse());
                     QNameSet builderPlanQNames = ((AbstractNamespaceBuilder) builder).getPlanQNameSet();
@@ -57,14 +56,13 @@
                 }
             });
         }
-        for (Iterator iterator = this.builders.iterator(); iterator.hasNext();) {
-            Object builder = iterator.next();
+        for (T builder : this.builders) {
             addBuilder(builder);
         }
     }
 
 
-    protected void addBuilder(Object builder) {
+    protected void addBuilder(T builder) {
         QNameSet builderSpecQNames = ((AbstractNamespaceBuilder) builder).getSpecQNameSet();
         QNameSet builderPlanQNames = ((AbstractNamespaceBuilder) builder).getPlanQNameSet();
         if (builderSpecQNames == null) {

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java Fri May  4 14:04:18 2007
@@ -24,6 +24,7 @@
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
@@ -193,4 +194,15 @@
     public void setClassFinder(ClassFinder classFinder) {
         this.classFinder = classFinder;
     }
+
+    public Artifact[] getConfigId() {
+        if (earContext == null) {
+            throw new NullPointerException("No ear context set");
+        }
+        if (rootEarContext == null || rootEarContext == earContext || rootEarContext.getConfigID().equals(earContext.getConfigID())) {
+            return new Artifact[] {earContext.getConfigID()};
+        }
+        return new Artifact[] {rootEarContext.getConfigID(), earContext.getConfigID()};
+    }
+    
 }

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java Fri May  4 14:04:18 2007
@@ -70,9 +70,9 @@
 
     void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) throws DeploymentException;
 
-    void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException;
+    void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException;
     
-    void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException;
+    void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException;
 
     public interface Key<T> {
         T get(Map context);

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java Fri May  4 14:04:18 2007
@@ -18,44 +18,39 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.AbstractBuilderCollection;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
  */
-public class NamingBuilderCollection extends AbstractBuilderCollection implements NamingBuilder {
+public class NamingBuilderCollection extends AbstractBuilderCollection<NamingBuilder> implements NamingBuilder {
 
-    public NamingBuilderCollection(Collection builders, final QName basePlanElementName) {
+    public NamingBuilderCollection(Collection<NamingBuilder> builders, final QName basePlanElementName) {
         super(builders, basePlanElementName);
     }
 
     public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) throws DeploymentException {
-        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
-            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
+        for (NamingBuilder namingBuilder : builders) {
             namingBuilder.buildEnvironment(specDD, plan, environment);
         }
     }
 
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
-        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
-            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
-            namingBuilder.initContext(specDD, plan, localConfiguration, remoteConfiguration, module);
+    public void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException {
+        for (NamingBuilder namingBuilder : builders) {
+            namingBuilder.initContext(specDD, plan, module);
         }
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localContext, Configuration remoteContext, Module module, Map componentContext) throws DeploymentException {
-        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
-            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
-            namingBuilder.buildNaming(specDD, plan, localContext, remoteContext, module, componentContext);
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+        for (NamingBuilder namingBuilder : builders) {
+            namingBuilder.buildNaming(specDD, plan, module, componentContext);
         }
     }
 

Modified: geronimo/server/trunk/modules/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/modules/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java Fri May  4 14:04:18 2007
@@ -58,7 +58,6 @@
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 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.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.schema.SchemaConversionUtils;
@@ -150,7 +149,7 @@
         ClassFinder classFinder = createJspClassFinder(webApp, webModule, listenerNames);
         webModule.setClassFinder(classFinder);
 
-        namingBuilders.buildNaming(webApp, jettyWebApp, moduleContext.getConfiguration(), earConfiguration, webModule, buildingContext);
+        namingBuilders.buildNaming(webApp, jettyWebApp, webModule, buildingContext);
 
         //only try to install it if reference will work.
         //Some users (tomcat?) may have back doors into jasper that make adding this gbean unnecessary.

Modified: geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java Fri May  4 14:04:18 2007
@@ -28,7 +28,6 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.naming.deployment.ServiceRefBuilder;
@@ -64,11 +63,9 @@
     }
 
     public void buildNaming(XmlObject specDD,
-                            XmlObject plan,
-                            Configuration localConfiguration,
-                            Configuration remoteConfiguration,
-                            Module module,
-                            Map componentContext) throws DeploymentException {       
+            XmlObject plan,
+            Module module,
+            Map componentContext) throws DeploymentException {
         List<ServiceRefType> serviceRefsUntyped = convert(specDD.selectChildren(serviceRefQNameSet), JEE_CONVERTER, ServiceRefType.class, ServiceRefType.type);
         XmlObject[] gerServiceRefsUntyped = plan == null ? NO_REFS : plan.selectChildren(GER_SERVICE_REF_QNAME_SET);
         Map serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);

Modified: geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java Fri May  4 14:04:18 2007
@@ -156,7 +156,7 @@
         ClassFinder classFinder = createMyFacesClassFinder(webApp, webModule);
         webModule.setClassFinder(classFinder);
 
-        namingBuilders.buildNaming(webApp, jettyWebApp, moduleContext.getConfiguration(), earConfiguration, webModule, buildingContext);
+        namingBuilders.buildNaming(webApp, jettyWebApp, webModule, buildingContext);
 
         AbstractName providerName = moduleContext.getNaming().createChildName(moduleName, "jsf-lifecycle", "jsf");
         GBeanData providerData = new GBeanData(providerName, LifecycleProviderGBean.GBEAN_INFO);

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Fri May  4 14:04:18 2007
@@ -117,7 +117,7 @@
         return false;
     }
 
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+    public void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException {
     }
 
     protected Map<String, Object> getJndiContextMap(Map sharedContext) {

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java Fri May  4 14:04:18 2007
@@ -17,10 +17,10 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.util.Map;
-import java.util.List;
-import java.lang.reflect.Method;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.List;
+import java.util.Map;
 
 import javax.annotation.Resource;
 
@@ -29,19 +29,17 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
-import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.naming.reference.KernelReference;
+import org.apache.geronimo.xbeans.javaee.DescriptionType;
 import org.apache.geronimo.xbeans.javaee.EnvEntryType;
-import org.apache.geronimo.xbeans.javaee.JndiNameType;
 import org.apache.geronimo.xbeans.javaee.EnvEntryTypeValuesType;
 import org.apache.geronimo.xbeans.javaee.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee.JndiNameType;
 import org.apache.geronimo.xbeans.javaee.XsdStringType;
-import org.apache.geronimo.xbeans.javaee.DescriptionType;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 
@@ -57,13 +55,8 @@
     public EnvironmentEntryBuilder(String[] eeNamespaces) {
         envEntryQNameSet = buildQNameSet(eeNamespaces, "env-entry");
     }
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
-    }
-
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
-    }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
 
         // Discover and process any @Resource annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -94,7 +87,7 @@
                 } else if ("java.lang.String".equals(type)) {
                     value = text;
                 } else if ("java.lang.Character".equals(type)) {
-                    value = new Character(text.charAt(0));
+                    value = text.charAt(0);
                 } else if ("java.lang.Boolean".equals(type)) {
                     value = Boolean.valueOf(text);
                 } else if ("java.lang.Byte".equals(type)) {

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java Fri May  4 14:04:18 2007
@@ -17,31 +17,29 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.util.Set;
-import java.util.HashSet;
 import java.util.Arrays;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
 import javax.xml.namespace.QName;
 
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.ClassLoading;
-import org.apache.geronimo.naming.reference.GBeanReference;
-import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.ClassLoading;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.naming.reference.GBeanReference;
+import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerGbeanRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
@@ -50,19 +48,12 @@
     private static final QName GBEAN_REF_QNAME = GerGbeanRefDocument.type.getDocumentElementName();
     private static final QNameSet GBEAN_REF_QNAME_SET = QNameSet.singleton(GBEAN_REF_QNAME);
 
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
-    }
-
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
-    }
-
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         if (plan == null) {
             return;
         }
-        XmlObject[] gbeanRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GBEAN_REF_QNAME_SET);
-        for (int i = 0; i < gbeanRefsUntyped.length; i++) {
-            XmlObject gbeanRefUntyped = gbeanRefsUntyped[i];
+        XmlObject[] gbeanRefsUntyped = plan.selectChildren(GBEAN_REF_QNAME_SET);
+        for (XmlObject gbeanRefUntyped : gbeanRefsUntyped) {
             GerGbeanRefType gbeanRef = (GerGbeanRefType) gbeanRefUntyped.copy().changeType(GerGbeanRefType.type);
             if (gbeanRef == null) {
                 throw new DeploymentException("Could not read gbeanRef " + gbeanRefUntyped + " as the correct xml type");
@@ -70,17 +61,16 @@
             GerPatternType[] gbeanLocatorArray = gbeanRef.getPatternArray();
 
             String[] interfaceTypesArray = gbeanRef.getRefTypeArray();
-            Set interfaceTypes = new HashSet(Arrays.asList(interfaceTypesArray));
-            Set queries = new HashSet();
-            for (int j = 0; j < gbeanLocatorArray.length; j++) {
-                GerPatternType patternType = gbeanLocatorArray[j];
+            Set<String> interfaceTypes = new HashSet<String>(Arrays.asList(interfaceTypesArray));
+            Set<AbstractNameQuery> queries = new HashSet<AbstractNameQuery>();
+            for (GerPatternType patternType : gbeanLocatorArray) {
                 AbstractNameQuery abstractNameQuery = ENCConfigBuilder.buildAbstractNameQuery(patternType, null, null, interfaceTypes);
                 queries.add(abstractNameQuery);
             }
 
             GBeanData gBeanData;
             try {
-                gBeanData = localConfiguration.findGBeanData(queries);
+                gBeanData = module.getEarContext().getConfiguration().findGBeanData(queries);
             } catch (GBeanNotFoundException e) {
                 throw new DeploymentException("Could not resolve reference at deploy time for queries " + queries, e);
             }
@@ -98,7 +88,7 @@
 
             String refName = gbeanRef.getRefName();
 
-            NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + refName, new GBeanReference(getConfigId(localConfiguration, remoteConfiguration), queries, gBeanType));
+            NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + refName, new GBeanReference(module.getConfigId(), queries, gBeanType));
 
         }
     }

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java Fri May  4 14:04:18 2007
@@ -30,7 +30,6 @@
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.QNameSet;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
@@ -50,7 +49,7 @@
  * @version $Rev$ $Date$
  */
 public class LifecycleMethodBuilder extends AbstractNamingBuilder {
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         // skip ejb modules... they have alreayd been processed
         if (module.getType() == ConfigurationModuleType.EJB) {
             return;

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java Fri May  4 14:04:18 2007
@@ -38,7 +38,6 @@
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
 import org.apache.geronimo.j2ee.deployment.annotation.WebServiceRefAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
@@ -90,8 +89,6 @@
 
     public void buildNaming(XmlObject specDD,
             XmlObject plan,
-            Configuration localConfiguration,
-            Configuration remoteConfiguration,
             Module module,
             Map componentContext) throws DeploymentException {
 

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java Fri May  4 14:04:18 2007
@@ -25,7 +25,6 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -56,11 +55,11 @@
         }
     }
 
-    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+    public void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException {
         checkUnavailable(specDD);
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         checkUnavailable(specDD);
     }
 

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java Fri May  4 14:04:18 2007
@@ -24,7 +24,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 
@@ -33,7 +32,7 @@
  */
 public class UserTransactionRefBuilder extends AbstractNamingBuilder {
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
 //        EARContext rootContext = module.getRootEarContext();
 //        UserTransaction userTransaction = rootContext.getUserTransaction();
 //        if (userTransaction != null) {

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java Fri May  4 14:04:18 2007
@@ -117,7 +117,7 @@
         } finally {
             cursor.dispose();
         }
-        environmentEntryBuilder.buildNaming(doc, null, null, null, null, componentContext);
+        environmentEntryBuilder.buildNaming(doc, null, null, componentContext);
         Context context = EnterpriseNamingContext.createEnterpriseNamingContext(NamingBuilder.JNDI_KEY.get(componentContext));
         Set actual = new HashSet();
         for (NamingEnumeration e = context.listBindings("env"); e.hasMore();) {

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java Fri May  4 14:04:18 2007
@@ -325,8 +325,6 @@
 
         namingBuilder.buildNaming(xmlbeansEjb,
                 geronimoOpenejb,
-                ejbModule.getEarContext().getConfiguration(),
-                earContext.getConfiguration(),
                 ejbModule, buildingContext);
 
         Map compContext = NamingBuilder.JNDI_KEY.get(buildingContext);

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java Fri May  4 14:04:18 2007
@@ -456,8 +456,6 @@
         if (ejbJarType.getAssemblyDescriptor() != null) {
             namingBuilder.initContext(ejbJarType.getAssemblyDescriptor(),
                     geronimoOpenejb,
-                    ejbModule.getEarContext().getConfiguration(),
-                    earContext.getConfiguration(),
                     ejbModule);
         }
 

Modified: geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java Fri May  4 14:04:18 2007
@@ -37,7 +37,6 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
@@ -99,7 +98,7 @@
         return specDD.selectChildren(ejbRefQNameSet).length > 0 || specDD.selectChildren(ejbLocalRefQNameSet).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         // skip ejb modules... they have alreayd been processed
         if (module.getType() == ConfigurationModuleType.EJB) {
             return;

Modified: geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java?view=diff&rev=535381&r1=535380&r2=535381
==============================================================================
--- geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-persistence-jpa10-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java Fri May  4 14:04:18 2007
@@ -77,7 +77,7 @@
         return plan != null && plan.selectChildren(PersistenceContextRefBuilder.GER_PERSISTENCE_CONTEXT_REF_QNAME_SET).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
 
         // Discover and process any @PersistenceContextRef annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -87,6 +87,7 @@
         List<PersistenceContextRefType> specPersistenceContextRefsUntyped = convert(specDD.selectChildren(PERSISTENCE_CONTEXT_REF_QNAME_SET), JEE_CONVERTER, PersistenceContextRefType.class, PersistenceContextRefType.type);
         Map<String, GerPersistenceContextRefType> gerPersistenceContextRefsUntyped = getGerPersistenceContextRefs(plan);
         List<DeploymentException> problems = new ArrayList<DeploymentException>();
+        Configuration localConfiguration = module.getEarContext().getConfiguration();
         for (PersistenceContextRefType persistenceContextRef : specPersistenceContextRefsUntyped) {
             try {
                 String persistenceContextRefName = persistenceContextRef.getPersistenceContextRefName().getStringValue().trim();
@@ -136,7 +137,7 @@
                     checkForGBean(localConfiguration, persistenceUnitNameQuery, true);
                 }
 
-                PersistenceContextReference reference = new PersistenceContextReference(getConfigId(localConfiguration, remoteConfiguration), persistenceUnitNameQuery, transactionScoped, properties);
+                PersistenceContextReference reference = new PersistenceContextReference(module.getConfigId(), persistenceUnitNameQuery, transactionScoped, properties);
 
                 NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + persistenceContextRefName, reference);
             } catch (DeploymentException e) {
@@ -158,7 +159,7 @@
 
                 checkForGBean(localConfiguration, persistenceUnitNameQuery, true);
 
-                PersistenceContextReference reference = new PersistenceContextReference(getConfigId(localConfiguration, remoteConfiguration), persistenceUnitNameQuery, transactionScoped, properties);
+                PersistenceContextReference reference = new PersistenceContextReference(module.getConfigId(), persistenceUnitNameQuery, transactionScoped, properties);
 
                 getJndiContextMap(componentContext).put(ENV + persistenceContextRefName, reference);
             } catch (DeploymentException e) {



Mime
View raw message