geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r932532 - in /geronimo/server/trunk/plugins: client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/ j2ee/geronimo-j2ee-builder/src/ma...
Date Fri, 09 Apr 2010 17:54:14 GMT
Author: djencks
Date: Fri Apr  9 17:54:13 2010
New Revision: 932532

URL: http://svn.apache.org/viewvc?rev=932532&view=rev
Log:
GERONIMO-5150 type safe shared data in EARContext

Modified:
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionTest.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Fri Apr  9 17:54:13 2010
@@ -634,10 +634,10 @@ public class AppClientModuleBuilder impl
         //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")) {
+        Map<EARContext.Key, Object> generalData = earContext.getGeneralData();
+        for (Map.Entry<EARContext.Key, Object> entry : generalData.entrySet()) {
+            EARContext.Key key = entry.getKey();
+            if (key.getClass().getName().startsWith("org.apache.geronimo.openejb.deployment.EjbModuleBuilder$EarData")) {
                 appClientDeploymentContext.getGeneralData().put(key, entry.getValue());
                 break;
             }
@@ -684,7 +684,7 @@ public class AppClientModuleBuilder impl
                 AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.class);
                 try {
-                    Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key, Object>();
+                    Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
                     buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, jndiContextName);
                     Configuration localConfiguration = appClientDeploymentContext.getConfiguration();
                     Configuration remoteConfiguration = earContext.getConfiguration();

Modified: geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/corba/geronimo-corba-builder/src/main/java/org/apache/geronimo/corba/deployment/OpenEjbCorbaRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -28,8 +28,10 @@ import org.apache.geronimo.common.Deploy
 import org.apache.geronimo.gbean.AbstractNameQuery;
 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.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.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -42,6 +44,7 @@ import org.apache.geronimo.xbeans.javaee
 import org.apache.geronimo.corba.proxy.CORBAProxyReference;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
+import org.osgi.framework.Bundle;
 
 /**
  * Installs ejb refs that use corba transport into jndi context.
@@ -92,34 +95,34 @@ public class OpenEjbCorbaRefBuilder exte
 //        return false;
 //    }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) 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();
+        Bundle bundle = module.getEarContext().getDeploymentBundle();
 
         for (XmlObject anEjbRefsUntyped : ejbRefsUntyped) {
             EjbRefType ejbRef = (EjbRefType) anEjbRefsUntyped;
 
             String ejbRefName = getStringValue(ejbRef.getEjbRefName());
-            addInjections(ejbRefName, ejbRef.getInjectionTargetArray(), componentContext);
+            addInjections(ejbRefName, ejbRef.getInjectionTargetArray(), sharedContext);
             GerEjbRefType remoteRef = (GerEjbRefType) ejbRefMap.get(ejbRefName);
 
-            Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, cl);
+            Reference ejbReference = addEJBRef(module, ejbRef, remoteRef, bundle);
             if (ejbReference != null) {
-                getJndiContextMap(componentContext).put(ENV + ejbRefName, ejbReference);
+                put(ejbRefName, ejbReference, JNDI_KEY.get(sharedContext));
             }
         }
     }
 
-    private Reference addEJBRef(Module module, EjbRefType ejbRef, GerEjbRefType remoteRef, ClassLoader cl) throws DeploymentException {
+    private Reference addEJBRef(Module module, EjbRefType ejbRef, GerEjbRefType remoteRef, Bundle bundle) 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, module.getModuleURI(), cl, remote, home);
+            verifyInterfaces(refName, module.getModuleURI(), bundle, remote, home);
 
             try {
                 // create the cssBean query
@@ -148,14 +151,14 @@ public class OpenEjbCorbaRefBuilder exte
         return ejbReference;
     }
 
-    private void verifyInterfaces(String refName, URI moduleURI, ClassLoader cl, String remote, String home) throws DeploymentException {
+    private void verifyInterfaces(String refName, URI moduleURI, Bundle bundle, String remote, String home) throws DeploymentException {
         try {
-            assureInterface(remote, "javax.ejb.EJBObject", "Remote", cl);
+            assureInterface(remote, "javax.ejb.EJBObject", "Remote", bundle);
         } catch (DeploymentException e) {
             throw new DeploymentException("Error processing 'remote' element for EJB Reference '" + refName + "' for module '" + moduleURI + "': " + e.getMessage(), e);
         }
         try {
-            assureInterface(home, "javax.ejb.EJBHome", "Home", cl);
+            assureInterface(home, "javax.ejb.EJBHome", "Home", bundle);
         } catch (DeploymentException e) {
             throw new DeploymentException("Error processing 'home' element for EJB Reference '" + refName + "' for module '" + moduleURI + "': " + e.getMessage(), e);
         }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Fri Apr  9 17:54:13 2010
@@ -554,7 +554,7 @@ public class EARConfigBuilder implements
             );
             applicationInfo.setEarContext(earContext);
             applicationInfo.setRootEarContext(earContext);
-            earContext.getGeneralData().put(ModuleList.class, applicationInfo.getModuleLocations());
+            earContext.getGeneralData().put(EARContext.MODULE_LIST_KEY, applicationInfo.getModuleLocations());
 
             // Copy over all files that are _NOT_ modules (e.g. META-INF and APP-INF files)
             ModuleList moduleLocations = applicationInfo.getModuleLocations();
@@ -581,7 +581,7 @@ public class EARConfigBuilder implements
                         earContext.addFile(URI.create(entry.getName()), earFile, entry);
                     }
                 }
-                earContext.getGeneralData().put(ClassPathList.class, libClasspath);
+                earContext.getGeneralData().put(EARContext.CLASS_PATH_LIST_KEY, libClasspath);
             }
 
             GerApplicationType geronimoApplication = (GerApplicationType) applicationInfo.getVendorDD();

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java Fri Apr  9 17:54:13 2010
@@ -21,7 +21,9 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.ClassPathList;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.ModuleList;
 import org.apache.geronimo.deployment.ResourceContext;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -35,7 +37,6 @@ import org.osgi.framework.BundleContext;
  * @version $Rev:386276 $ $Date$
  */
 public class EARContext extends DeploymentContext {
-    public static final String APPLICATION_JNDI_NAME_KEY = "AppplicationJndiName";
 
     private final AbstractNameQuery serverName;
     private final AbstractNameQuery transactionManagerObjectName;
@@ -48,7 +49,7 @@ public class EARContext extends Deployme
 
     private final Map  messageDestinations;
 
-    private final Map<Object,Object> generalData = new HashMap<Object,Object>();
+    private final Map<Key,Object> generalData = new HashMap<Key,Object>();
 
     public EARContext(File baseDir,
                       File inPlaceConfigurationDir,
@@ -198,7 +199,7 @@ public class EARContext extends Deployme
         return messageDestinations;
     }
 
-    public Map<Object,Object> getGeneralData() {
+    public Map<Key,Object> getGeneralData() {
         return generalData;
     }
 
@@ -209,4 +210,32 @@ public class EARContext extends Deployme
     public void setHasSecurity(boolean hasSecurity) {
         this.hasSecurity = hasSecurity;
     }
+
+    public static interface Key<T> {
+        T get(Map<Key, Object> context);
+    }
+
+    public static final Key<ClassPathList> CLASS_PATH_LIST_KEY = new Key<ClassPathList>() {
+
+        @Override
+        public ClassPathList get(Map<Key, Object> context) {
+            return (ClassPathList) context.get(this);
+        }
+    };
+    public static final Key<ModuleList> MODULE_LIST_KEY = new Key<ModuleList>() {
+
+        @Override
+        public ModuleList get(Map<Key, Object> context) {
+            return (ModuleList) context.get(this);
+        }
+    };
+
+    public static final Key<AbstractName> APPLICATION_JNDI_NAME_KEY = new Key<AbstractName>() {
+
+        @Override
+        public AbstractName get(Map<Key, Object> context) {
+            return (AbstractName) context.get(this);
+        }
+    };
+
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java Fri Apr  9 17:54:13 2010
@@ -38,9 +38,9 @@ public interface NamingBuilder extends A
     XmlObject[] NO_REFS = new XmlObject[] {};
     String ENV = "env/";
 
-    Key<Map<JndiKey, Map<String, Object>>> JNDI_KEY = new Key<Map<JndiKey, Map<String, Object>>>() {
+    EARContext.Key<Map<JndiKey, Map<String, Object>>> JNDI_KEY = new EARContext.Key<Map<JndiKey, Map<String, Object>>>() {
 
-        public Map<JndiKey, Map<String, Object>> get(Map context) {
+        public Map<JndiKey, Map<String, Object>> get(Map<EARContext.Key, Object> context) {
             Map<JndiKey, Map<String, Object>> result = (Map<JndiKey, Map<String, Object>>) context.get(this);
             if (result == null) {
                 result = new HashMap<JndiKey, Map<String, Object>>();
@@ -49,9 +49,9 @@ public interface NamingBuilder extends A
             return result;
         }
     };
-    Key<Holder> INJECTION_KEY = new Key<Holder>() {
+    EARContext.Key<Holder> INJECTION_KEY = new EARContext.Key<Holder>() {
 
-        public Holder get(Map context) {
+        public Holder get(Map<EARContext.Key, Object> context) {
             Holder result = (Holder) context.get(this);
             if (result == null) {
                 result = new Holder();
@@ -60,9 +60,9 @@ public interface NamingBuilder extends A
             return result;
         }
     };
-    Key<AbstractName> GBEAN_NAME_KEY = new Key<AbstractName>() {
+    EARContext.Key<AbstractName> GBEAN_NAME_KEY = new EARContext.Key<AbstractName>() {
 
-        public AbstractName get(Map context) {
+        public AbstractName get(Map<EARContext.Key, Object> context) {
             return (AbstractName) context.get(this);
         }
     };
@@ -71,17 +71,11 @@ public interface NamingBuilder extends A
 
     void initContext(XmlObject specDD, XmlObject plan, Module module) throws DeploymentException;
     
-    void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException;
+    void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException;
 
     /**
      * Returns sort order priority.  Lower numbers indicate higher priority.
      */
     int getPriority();
-    
-    public interface Key<T> {
-        T get(Map context);
-    }
-
-
 
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java Fri Apr  9 17:54:13 2010
@@ -30,7 +30,6 @@ import org.apache.geronimo.common.Deploy
 import org.apache.geronimo.deployment.AbstractBuilderCollection;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.gbean.annotation.GBean;
-import org.apache.geronimo.gbean.annotation.ParamAttribute;
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.xmlbeans.XmlObject;
@@ -57,16 +56,16 @@ public class NamingBuilderCollection ext
         }
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         for (NamingBuilder namingBuilder : getSortedBuilders()) {
             if (EARConfigBuilder.createPlanMode.get().booleanValue()) {
                 try {
-                    namingBuilder.buildNaming(specDD, plan, module, componentContext);
+                    namingBuilder.buildNaming(specDD, plan, module, sharedContext);
                 } catch (Exception e) {
                     // ignore exceptions & continue processing with rest of the builders
                 }
             } else {
-                namingBuilder.buildNaming(specDD, plan, module, componentContext);
+                namingBuilder.buildNaming(specDD, plan, module, sharedContext);
             }
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionTest.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionTest.java Fri Apr  9 17:54:13 2010
@@ -94,7 +94,7 @@ public class NamingBuilderCollectionTest
         public void buildNaming(XmlObject specDD,
                                 XmlObject plan,
                                 Module module,
-                                Map componentContext) throws DeploymentException {
+                                Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
             this.callList.add("buildNaming");
             this.callList.add(this);
         }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Fri Apr  9 17:54:13 2010
@@ -35,6 +35,7 @@ import org.apache.geronimo.gbean.Abstrac
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.j2ee.annotation.Injection;
+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.jndi.JndiKey;
@@ -148,7 +149,7 @@ public abstract class AbstractNamingBuil
         scope.put(key, value);
     }
     
-    protected Object lookupJndiContextMap(Map sharedContext, String key) {
+    protected Object lookupJndiContextMap(Map<EARContext.Key, Object> sharedContext, String key) {
         JndiKey jndiKey;
         if (key.startsWith("java:")) {
             int pos = key.indexOf("/", 5);
@@ -164,11 +165,11 @@ public abstract class AbstractNamingBuil
         return scope.get(key);
     }
     
-    protected Map<JndiKey, Map<String, Object>> getJndiContextMap(Map sharedContext) {
+    protected Map<JndiKey, Map<String, Object>> getJndiContextMap(Map<EARContext.Key, Object> sharedContext) {
         return NamingBuilder.JNDI_KEY.get(sharedContext);
     }
 
-    protected AbstractName getGBeanName(Map sharedContext) {
+    protected AbstractName getGBeanName(Map<EARContext.Key, Object> sharedContext) {
         return GBEAN_NAME_KEY.get(sharedContext);
     }
 
@@ -304,7 +305,7 @@ public abstract class AbstractNamingBuil
     }
 
 
-    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
+    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map<EARContext.Key, Object> sharedContext) {
         Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
         for (InjectionTargetType injectionTarget : injectionTargetArray) {
             String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java Fri Apr  9 17:54:13 2010
@@ -30,6 +30,7 @@ import org.apache.geronimo.deployment.xm
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
@@ -80,7 +81,7 @@ public class EnvironmentEntryBuilder ext
         doStop();
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
 
         // Discover and process any @Resource annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -136,8 +137,8 @@ public class EnvironmentEntryBuilder ext
                 // perform resource injection only if there is a value specified
                 // see Java EE 5 spec, section EE.5.4.1.3
                 if (value != null) {
-                    addInjections(name, envEntry.getInjectionTargetArray(), componentContext);
-                    put(name, value, getJndiContextMap(componentContext));
+                    addInjections(name, envEntry.getInjectionTargetArray(), sharedContext);
+                    put(name, value, getJndiContextMap(sharedContext));
                 }
             } catch (NumberFormatException e) {
                 throw new DeploymentException("Invalid env-entry value for name: " + name, e);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -29,6 +29,7 @@ import org.apache.geronimo.gbean.Abstrac
 import org.apache.geronimo.gbean.GBeanData;
 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.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -49,7 +50,7 @@ public class GBeanRefBuilder extends Abs
     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 buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         if (plan == null) {
             return;
         }
@@ -89,7 +90,7 @@ public class GBeanRefBuilder extends Abs
 
             String refName = gbeanRef.getRefName();
 
-            put(refName, new GBeanReference(module.getConfigId(), queries, gBeanType), NamingBuilder.JNDI_KEY.get(componentContext));
+            put(refName, new GBeanReference(module.getConfigId(), queries, gBeanType), NamingBuilder.JNDI_KEY.get(sharedContext));
 
         }
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/LifecycleMethodBuilder.java Fri Apr  9 17:54:13 2010
@@ -33,6 +33,7 @@ import org.apache.geronimo.gbean.GBeanIn
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.j2ee.annotation.LifecycleMethod;
+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.annotation.AnnotatedApp;
@@ -49,7 +50,7 @@ import org.apache.xmlbeans.XmlObject;
  * @version $Rev$ $Date$
  */
 public class LifecycleMethodBuilder extends AbstractNamingBuilder {
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         // skip ejb modules... they have alreayd been processed
         if (module.getType() == ConfigurationModuleType.EJB) {
             return;
@@ -92,7 +93,7 @@ public class LifecycleMethodBuilder exte
         }
         Map<String, LifecycleMethod> postConstructs = map(postConstructMap);
         Map<String, LifecycleMethod> preDestroys = map(preDestroyMap);
-        Holder holder = NamingBuilder.INJECTION_KEY.get(componentContext);
+        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
         holder.addPostConstructs(postConstructs);
         holder.addPreDestroys(preDestroys);
     }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/SwitchingServiceRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -29,6 +29,7 @@ import org.apache.geronimo.common.Deploy
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
 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.Module;
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.j2ee.deployment.annotation.ResourceAnnotationHelper;
@@ -89,7 +90,7 @@ public class SwitchingServiceRefBuilder 
     public void buildNaming(XmlObject specDD,
             XmlObject plan,
             Module module,
-            Map componentContext) throws DeploymentException {
+            Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
 
         // Discover and process any @WebServiceRef annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -125,18 +126,18 @@ public class SwitchingServiceRefBuilder 
             Class serviceInterfaceClass = loadClass(serviceInterfaceName, bundle);
 
             InjectionTargetType[] injections = serviceRefType.getInjectionTargetArray();
-            addInjections(name, injections, componentContext);
+            addInjections(name, injections, sharedContext);
 
             if (jaxrpcClass.isAssignableFrom(serviceInterfaceClass)) {
                 // class jaxrpc handler
                 ServiceRefBuilder jaxrpcBuilder = getJAXRCPBuilder();
                 jaxrpcBuilder.buildNaming(serviceRef, gerServiceRefType,
-                        module, componentContext);
+                        module, sharedContext);
             } else if (jaxwsClass.isAssignableFrom(serviceInterfaceClass)) {
                 // calll jaxws handler
                 ServiceRefBuilder jaxwsBuilder = getJAXWSBuilder();
                 jaxwsBuilder.buildNaming(serviceRef, gerServiceRefType, module,
-                        componentContext);
+                        sharedContext);
             } else {
                 throw new DeploymentException(serviceInterfaceName
                         + " does not extend "

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -21,6 +21,7 @@ import java.util.Map;
 
 import javax.xml.namespace.QName;
 
+import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
@@ -59,7 +60,7 @@ public class UnavailableRefBuilder imple
         checkUnavailable(specDD);
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         checkUnavailable(specDD);
     }
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -22,6 +22,7 @@ import java.util.Map;
 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.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.xmlbeans.QNameSet;
@@ -32,7 +33,7 @@ import org.apache.xmlbeans.XmlObject;
  */
 public class UserTransactionRefBuilder extends AbstractNamingBuilder {
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
 //        EARContext rootContext = module.getRootEarContext();
 //        UserTransaction userTransaction = rootContext.getUserTransaction();
 //        if (userTransaction != null) {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java Fri Apr  9 17:54:13 2010
@@ -92,7 +92,13 @@ public class GeronimoSecurityBuilderImpl
     public static final String GERONIMO_SECURITY_NAMESPACE = "http://geronimo.apache.org/xml/ns/security-2.0";
     private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
 
-    private static final String ROLE_MAPPER_DATA_NAME = "roleMapperDataName";
+    public static final EARContext.Key<AbstractNameQuery> ROLE_MAPPER_DATA_NAME = new EARContext.Key<AbstractNameQuery>() {
+
+        @Override
+        public AbstractNameQuery get(Map<EARContext.Key, Object> context) {
+            return (AbstractNameQuery) context.get(this);
+        }
+    };
 
     static {
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/loginconfig", "http://geronimo.apache.org/xml/ns/loginconfig-2.0");
@@ -214,7 +220,7 @@ public class GeronimoSecurityBuilderImpl
         if (earContext.isHasSecurity()) {
             //Be sure to only set once per app
             earContext.setHasSecurity(false);
-            AbstractNameQuery roleMapperDataName = (AbstractNameQuery)earContext.getGeneralData().get(ROLE_MAPPER_DATA_NAME);
+            AbstractNameQuery roleMapperDataName = ROLE_MAPPER_DATA_NAME.get(earContext.getGeneralData());
             if (roleMapperDataName == null) {
                 roleMapperDataName = defaultRoleMappingName;
                 EnvironmentBuilder.mergeEnvironments(earContext.getConfiguration().getEnvironment(), defaultEnvironment);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java Fri Apr  9 17:54:13 2010
@@ -117,29 +117,45 @@ import org.xml.sax.SAXException;
  * @version $Rev$ $Date$
  */
 public abstract class AbstractWebModuleBuilder implements ModuleBuilder {
+    private static final Logger log = LoggerFactory.getLogger(AbstractWebModuleBuilder.class);
 
     //are we combining all web apps into one bundle in an ear?
     //TODO eliminate this
     protected static final boolean COMBINED_BUNDLE = true;
 
-    public final static NamingBuilder.Key<GBeanData> DEFAULT_JSP_SERVLET_KEY = new NamingBuilder.Key<GBeanData>() {
-
-        public GBeanData get(Map context) {
+    public final static EARContext.Key<GBeanData> DEFAULT_JSP_SERVLET_KEY = new EARContext.Key<GBeanData>() {
+        public GBeanData get(Map<EARContext.Key, Object> context) {
             return (GBeanData) context.get(this);
         }
     };
 
-    private static final Logger log = LoggerFactory.getLogger(AbstractWebModuleBuilder.class);
+    public static final EARContext.Key<Boolean> WEB_MODULE_HAS_SECURITY_REALM = new EARContext.Key<Boolean>() {
 
-    private static final QName TAGLIB = new QName(SchemaConversionUtils.JAVAEE_NAMESPACE, "taglib");
+        @Override
+        public Boolean get(Map<EARContext.Key, Object> context) {
+            return (Boolean) context.get(this);
+        }
+    };
 
-    private static final String LINE_SEP = System.getProperty("line.separator");
+    public static final EARContext.Key<List<String>> EXCLUDED_JAR_URLS = new EARContext.Key<List<String>>() {
 
-    public static final String WEB_MODULE_HAS_SECURITY_REALM = "WEB_MODULE_HAS_SECURITY_REALM";
+        @Override
+        public List<String> get(Map<EARContext.Key, Object> context) {
+            return (List<String>) context.get(this);
+        }
+    };
+
+    public static final EARContext.Key<Boolean> EXCLUDED_ANNOTATION_SCAN_JAR_URLS = new EARContext.Key<Boolean>() {
 
-    public static final String EXCLUDED_JAR_URLS = "EXCLUDED_JAR_URLS";
+        @Override
+        public Boolean get(Map<EARContext.Key, Object> context) {
+            return (Boolean) context.get(this);
+        }
+    };
 
-    public static final String EXCLUDED_ANNOTATION_SCAN_JAR_URLS = "EXCLUDED_ANNOTATION_SCAN_JAR_URLS";
+    private static final QName TAGLIB = new QName(SchemaConversionUtils.JAVAEE_NAMESPACE, "taglib");
+
+    private static final String LINE_SEP = System.getProperty("line.separator");
 
     protected static final AbstractNameQuery MANAGED_CONNECTION_FACTORY_PATTERN;
 
@@ -336,7 +352,7 @@ public abstract class AbstractWebModuleB
             // and the url class loader will not pick up a manifest from an unpacked dir
             //GERONIMO-4972 this can't be correct for one-bundle deployments.
             moduleContext.addManifestClassPath(warFile, RELATIVE_MODULE_BASE_URI);
-            moduleContext.getGeneralData().put(ClassPathList.class, manifestcp);
+            moduleContext.getGeneralData().put(EARContext.CLASS_PATH_LIST_KEY, manifestcp);
         } catch (IOException e) {
             throw new DeploymentException("Problem deploying war", e);
         } finally {
@@ -368,8 +384,8 @@ public abstract class AbstractWebModuleB
         WebModule webModule = (WebModule) module;
         //complete manifest classpath
         EARContext moduleContext = webModule.getEarContext();
-        ClassPathList manifestcp = (ClassPathList) moduleContext.getGeneralData().get(ClassPathList.class);
-        ModuleList moduleLocations = (ModuleList) webModule.getRootEarContext().getGeneralData().get(ModuleList.class);
+        ClassPathList manifestcp = EARContext.CLASS_PATH_LIST_KEY.get(moduleContext.getGeneralData());
+        ModuleList moduleLocations = EARContext.MODULE_LIST_KEY.get(webModule.getRootEarContext().getGeneralData());
         URI baseUri = URI.create(webModule.getTargetPath());
         URI resolutionUri = invertURI(baseUri);
         earContext.getCompleteManifestClassPath(webModule.getDeployable(), baseUri, resolutionUri, manifestcp, moduleLocations);
@@ -678,7 +694,7 @@ public abstract class AbstractWebModuleB
 
     protected void configureBasicWebModuleAttributes(WebAppType webApp, XmlObject vendorPlan, EARContext moduleContext, EARContext earContext, WebModule webModule, GBeanData webModuleData)
             throws DeploymentException {
-        Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key, Object>();
+        Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
         buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleContext.getModuleName());
         //get partial jndi context from earContext.
         Map<JndiKey, Map<String, Object>> jndiContext = new HashMap<JndiKey, Map<String, Object>>(NamingBuilder.JNDI_KEY.get(earContext.getGeneralData()));
@@ -704,7 +720,7 @@ public abstract class AbstractWebModuleB
         AbstractName contextSourceName = moduleContext.getNaming().createChildName(webModuleData.getAbstractName(), "ContextSource", "ContextSource");
         GBeanData contextSourceData = new GBeanData(contextSourceName, WebContextSource.class);
         contextSourceData.setAttribute("componentContext", compContext);
-        contextSourceData.setReferencePattern("ApplicationJndi", (AbstractName) earContext.getGeneralData().get(EARContext.APPLICATION_JNDI_NAME_KEY));
+        contextSourceData.setReferencePattern("ApplicationJndi", EARContext.APPLICATION_JNDI_NAME_KEY.get(earContext.getGeneralData()));
         contextSourceData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerName());
         try {
             moduleContext.addGBean(contextSourceData);

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java Fri Apr  9 17:54:13 2010
@@ -148,7 +148,7 @@ public class JspModuleBuilderExtension i
         GBeanData webAppData = (GBeanData) sharedContext.get(WebModule.WEB_APP_DATA);
 
         AbstractName moduleName = module.getModuleName();
-        Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key, Object>();
+        Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
         buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);
 
         //use the same jndi context as the web app

Modified: geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/jaxws/geronimo-jaxws-builder/src/main/java/org/apache/geronimo/jaxws/builder/JAXWSServiceRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -29,6 +29,7 @@ import javax.xml.ws.Service;
 import javax.xml.ws.handler.Handler;
 
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.jaxws.HandlerChainsUtils;
 import org.apache.geronimo.kernel.repository.Environment;
@@ -71,16 +72,15 @@ public abstract class JAXWSServiceRefBui
     public void buildNaming(XmlObject specDD,
             XmlObject plan,
             Module module,
-            Map componentContext) throws DeploymentException {
+            Map<EARContext.Key, Object> 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);
+        Map<String, GerServiceRefType> serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);
 
         for (ServiceRefType serviceRef : serviceRefsUntyped) {
             String name = getStringValue(serviceRef.getServiceRefName());
             addInjections(name, serviceRef.getInjectionTargetArray(), componentContext);
-            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
-            serviceRefMap.remove(name);
+            GerServiceRefType serviceRefType = serviceRefMap.remove(name);
             buildNaming(serviceRef, serviceRefType, module, componentContext);
         }
 
@@ -103,7 +103,7 @@ public abstract class JAXWSServiceRefBui
         buildNaming(serviceRefType, gerServiceRefType, module, componentContext);
     }
 
-    public void buildNaming(ServiceRefType serviceRef, GerServiceRefType gerServiceRef, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(ServiceRefType serviceRef, GerServiceRefType gerServiceRef, Module module, Map<EARContext.Key, Object> componentContext) throws DeploymentException {
         Bundle bundle = module.getEarContext().getDeploymentBundle();
         String name = getStringValue(serviceRef.getServiceRefName());
 
@@ -172,8 +172,8 @@ public abstract class JAXWSServiceRefBui
                                          QName serviceQName, URI wsdlURI, Class serviceReferenceType,
                                          Map<Class, PortComponentRefType> portComponentRefMap) throws DeploymentException;
 
-    private static Map mapServiceRefs(XmlObject[] refs) {
-        Map refMap = new HashMap();
+    private static Map<String, GerServiceRefType> mapServiceRefs(XmlObject[] refs) {
+        Map<String, GerServiceRefType> refMap = new HashMap<String, GerServiceRefType>();
         if (refs != null) {
             for (int i = 0; i < refs.length; i++) {
                 GerServiceRefType ref = (GerServiceRefType) refs[i].copy()

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Fri Apr  9 17:54:13 2010
@@ -93,6 +93,7 @@ import org.apache.geronimo.naming.deploy
 import org.apache.geronimo.schema.ElementConverter;
 import org.apache.geronimo.schema.NamespaceElementConverter;
 import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.jaas.ConfigurationFactory;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
@@ -140,7 +141,6 @@ import org.slf4j.LoggerFactory;
 @GBean(j2eeType=NameFactory.MODULE_BUILDER)
 public class JettyModuleBuilder extends AbstractWebModuleBuilder implements GBeanLifecycle {
     private static final Logger log = LoggerFactory.getLogger(JettyModuleBuilder.class);
-    static final String ROLE_MAPPER_DATA_NAME = "roleMapperDataName";
 
     private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
     private static final Map<String, ElementConverter> GERONIMO_SCHEMA_CONVERSIONS = new HashMap<String, ElementConverter>();
@@ -668,7 +668,7 @@ public class JettyModuleBuilder extends 
         }
         String securityRealmName = jettyWebApp.getSecurityRealmName().trim();
         webModuleData.setAttribute("securityRealmName", securityRealmName);
-        webModuleData.setReferencePattern("RunAsSource", (AbstractNameQuery)earContext.getGeneralData().get(ROLE_MAPPER_DATA_NAME));
+        webModuleData.setReferencePattern("RunAsSource", GeronimoSecurityBuilderImpl.ROLE_MAPPER_DATA_NAME.get(earContext.getGeneralData()));
 
         /**
          * TODO - go back to commented version when possible.

Modified: geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java (original)
+++ geronimo/server/trunk/plugins/myfaces/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java Fri Apr  9 17:54:13 2010
@@ -140,7 +140,7 @@ public class MyFacesModuleBuilderExtensi
             ((Collection<String>) value).add(CONTEXT_LISTENER_NAME);
         }
         AbstractName moduleName = moduleContext.getModuleName();
-        Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key, Object>();
+        Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
         buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleName);
 
         //use the same jndi context as the web app

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java Fri Apr  9 17:54:13 2010
@@ -398,7 +398,7 @@ public class EjbDeploymentBuilder {
         //
 
         // Geronimo uses a map to pass data to the naming build and for the results data
-        Map<Object, Object> buildingContext = new HashMap<Object, Object>();
+        Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key, Object>();
         Map<JndiKey, Map<String, Object>> jndiContext = new HashMap<JndiKey, Map<String, Object>>();
         buildingContext.put(NamingBuilder.JNDI_KEY, jndiContext);
         buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, gbean.getAbstractName());

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java Fri Apr  9 17:54:13 2010
@@ -255,7 +255,7 @@ public class EjbModuleBuilder implements
             unknownXmlObject = (XmlObject) plan;
         } else if (plan != null) {
             try {
-                unknownXmlObject = XmlBeansUtil.parse(((File) plan).toURL(), XmlUtil.class.getClassLoader());
+                unknownXmlObject = XmlBeansUtil.parse(((File) plan).toURI().toURL(), XmlUtil.class.getClassLoader());
             } catch (Exception e) {
                 throw new DeploymentException(e);
             }
@@ -445,10 +445,10 @@ public class EjbModuleBuilder implements
     }
 
     private void installModule(Module module, EARContext earContext) throws DeploymentException {
-        EarData earData = (EarData) earContext.getGeneralData().get(EarData.class);
+        EarData earData = EarData.KEY.get(earContext.getGeneralData());
         if (earData == null) {
             earData = new EarData();
-            earContext.getGeneralData().put(EarData.class, earData);
+            earContext.getGeneralData().put(EarData.KEY, earData);
         }
         earData.addEjbModule((EjbModule) module);
 
@@ -525,7 +525,7 @@ public class EjbModuleBuilder implements
         ModuleList moduleLocations = (ModuleList) module.getRootEarContext().getGeneralData().get(ModuleList.class);
         URI baseUri = URI.create(module.getTargetPath());
         moduleContext.getCompleteManifestClassPath(module.getDeployable(), baseUri, URI.create("."), manifestcp, moduleLocations);
-        moduleContext.getGeneralData().put(ClassPathList.class, manifestcp);
+        moduleContext.getGeneralData().put(EARContext.CLASS_PATH_LIST_KEY, manifestcp);
 
         for (ModuleBuilderExtension builder : moduleBuilderExtensions) {
             try {
@@ -538,7 +538,7 @@ public class EjbModuleBuilder implements
     }
 
     private EjbJarInfo getEjbJarInfo(EARContext earContext, EjbModule ejbModule, Bundle bundle) throws DeploymentException {
-        EarData earData = (EarData) earContext.getGeneralData().get(EarData.class);
+        EarData earData = EarData.KEY.get(earContext.getGeneralData());
         if (earData.getEjbJars().isEmpty()) {
 
             ClassLoader bundleLoader = new BundleClassLoader(bundle);
@@ -912,6 +912,14 @@ public class EjbModuleBuilder implements
     }
 
     public static class EarData {
+        public static final EARContext.Key<EarData> KEY = new EARContext.Key<EarData>() {
+
+            @Override
+            public EarData get(Map<EARContext.Key, Object> context) {
+                return (EarData) context.get(this);
+            }
+        };
+
         private final Map<String, EjbModule> ejbModules = new TreeMap<String, EjbModule>();
         private final Map<String, EjbJarInfo> ejbJars = new TreeMap<String, EjbJarInfo>();
 

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java Fri Apr  9 17:54:13 2010
@@ -20,43 +20,40 @@ package org.apache.geronimo.openejb.depl
 import java.io.Serializable;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
 import java.util.Set;
 import java.util.TreeSet;
-import java.util.Arrays;
-import java.util.ArrayList;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 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.Module;
 import org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
 import org.apache.geronimo.openejb.ClientEjbReference;
+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.geronimo.xbeans.javaee6.EjbLocalRefType;
 import org.apache.geronimo.xbeans.javaee6.EjbRefType;
 import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefDocument;
-import org.apache.geronimo.xbeans.geronimo.naming.GerEjbLocalRefType;
 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.assembler.classic.AppInfo;
 import org.apache.openejb.config.JndiEncInfoBuilder;
-import org.apache.openejb.config.AppModule;
 import org.apache.openejb.core.ivm.naming.IntraVmJndiReference;
 import org.apache.openejb.jee.EjbLocalRef;
 import org.apache.openejb.jee.EjbRef;
@@ -65,6 +62,8 @@ import org.apache.openejb.jee.JndiConsum
 import org.apache.openejb.jee.SessionBean;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Revision: 475950 $ $Date: 2006-11-16 14:18:14 -0800 (Thu, 16 Nov 2006) $
@@ -101,7 +100,7 @@ public class EjbRefBuilder extends Abstr
         return specDD.selectChildren(ejbRefQNameSet).length > 0 || specDD.selectChildren(ejbLocalRefQNameSet).length > 0;
     }
 
-    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
+    public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map<EARContext.Key, Object> sharedContext) throws DeploymentException {
         // skip ejb modules... they have alreayd been processed
 //        if (module.getType() == ConfigurationModuleType.EJB) {
 //            return;
@@ -117,7 +116,7 @@ public class EjbRefBuilder extends Abstr
         // Add the refs declaraed the the spec deployment descriptor (e.g., ejb-jar.xml or web.xml)
         List<EjbRefType> ejbRefs = convert(specDD.selectChildren(ejbRefQNameSet), JEE_CONVERTER, EjbRefType.class, EjbRefType.type);
         List<EjbLocalRefType> ejbLocalRefs = convert(specDD.selectChildren(ejbLocalRefQNameSet), JEE_CONVERTER, EjbLocalRefType.class, EjbLocalRefType.type);
-        addRefs(consumer, ejbRefs, refMap, ejbLocalRefs, localRefMap, componentContext);
+        addRefs(consumer, ejbRefs, refMap, ejbLocalRefs, localRefMap, sharedContext);
 
         // Discover and process any @EJB annotations (if !metadata-complete)
         if ((module != null) && (module.getClassFinder() != null)) {
@@ -133,12 +132,12 @@ public class EjbRefBuilder extends Abstr
             ejbRefs.addAll(module.getAnnotatedApp().getAmbiguousEjbRefs());
 
             // add the refs
-            addRefs(consumer, ejbRefs, refMap, ejbLocalRefs, localRefMap, componentContext);
+            addRefs(consumer, ejbRefs, refMap, ejbLocalRefs, localRefMap, sharedContext);
         }
 
         Map<String, Object> map = null;
         try {
-            EjbModuleBuilder.EarData earData = (EjbModuleBuilder.EarData) module.getRootEarContext().getGeneralData().get(EjbModuleBuilder.EarData.class);
+            EjbModuleBuilder.EarData earData = EjbModuleBuilder.EarData.KEY.get(module.getRootEarContext().getGeneralData());
             Collection<EjbJarInfo> ejbJars = Collections.emptySet();
             if (earData != null) {
                 ejbJars = earData.getEjbJars();
@@ -176,7 +175,7 @@ public class EjbRefBuilder extends Abstr
                     value = createClientRef(value);
                 }
                 if (value instanceof Serializable) {
-                    put(name, value, getJndiContextMap(componentContext));
+                    put(name, value, getJndiContextMap(sharedContext));
                 }
             }
         }
@@ -201,7 +200,12 @@ public class EjbRefBuilder extends Abstr
         return value;
     }
 
-    private void addRefs(JndiConsumer jndiConsumer, List<EjbRefType> ejbRefs, Map<String, GerEjbRefType> refMap, List<EjbLocalRefType> ejbLocalRefs, Map<String, GerEjbLocalRefType> localRefMap, Map componentContext) {
+    private void addRefs(JndiConsumer jndiConsumer,
+                         List<EjbRefType> ejbRefs,
+                         Map<String, GerEjbRefType> refMap,
+                         List<EjbLocalRefType> ejbLocalRefs,
+                         Map<String, GerEjbLocalRefType> localRefMap,
+                         Map<EARContext.Key, Object> sharedContext) {
         Set<String> declaredEjbRefs = new TreeSet<String>();
         for (EjbRef ejbRef : jndiConsumer.getEjbRef()) {
             declaredEjbRefs.add(ejbRef.getName());
@@ -278,7 +282,7 @@ public class EjbRefBuilder extends Abstr
                 }
             }
             //geronimo's handling of injection-target
-            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
+            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), sharedContext);
 
         }
 
@@ -346,7 +350,7 @@ public class EjbRefBuilder extends Abstr
                 }
             }
             //geronimo's handling of injection-target
-            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), componentContext);
+            addInjections(refName, xmlbeansRef.getInjectionTargetArray(), sharedContext);
         }
     }
 

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Fri Apr  9 17:54:13 2010
@@ -67,6 +67,7 @@ import org.apache.geronimo.kernel.util.J
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.jaas.ConfigurationFactory;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.tomcat.LifecycleListenerGBean;
@@ -103,7 +104,6 @@ import org.slf4j.LoggerFactory;
 public class TomcatModuleBuilder extends AbstractWebModuleBuilder implements GBeanLifecycle {
 
     private static final Logger log = LoggerFactory.getLogger(TomcatModuleBuilder.class);
-    static final String ROLE_MAPPER_DATA_NAME = "roleMapperDataName";
 
     private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
     private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
@@ -527,7 +527,7 @@ public class TomcatModuleBuilder extends
                 SecurityHolder securityHolder = new SecurityHolder();
                 String securityRealmName = tomcatWebApp.getSecurityRealmName().trim();
 
-                webModuleData.setReferencePattern("RunAsSource", (AbstractNameQuery)earContext.getGeneralData().get(ROLE_MAPPER_DATA_NAME));
+                webModuleData.setReferencePattern("RunAsSource", GeronimoSecurityBuilderImpl.ROLE_MAPPER_DATA_NAME.get(earContext.getGeneralData()));
                 webModuleData.setReferencePattern("ConfigurationFactory", new AbstractNameQuery(null, Collections.singletonMap("name", securityRealmName), ConfigurationFactory.class.getName()));
 
                 /**

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=932532&r1=932531&r2=932532&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Fri Apr  9 17:54:13 2010
@@ -55,6 +55,7 @@ import org.apache.geronimo.kernel.reposi
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.util.UnpackedJarFile;
 import org.apache.geronimo.security.SecurityNames;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.testsupport.TestSupport;
@@ -141,7 +142,7 @@ public class TomcatModuleBuilderTest ext
 //        jaccBeanData.setAttribute("principalRoleMap", new HashMap());
         jaccBeanData.setAttribute("roleDesignates", new HashMap());
         earContext.addGBean(jaccBeanData);
-        earContext.getGeneralData().put(TomcatModuleBuilder.ROLE_MAPPER_DATA_NAME, jaccBeanName);
+        earContext.getGeneralData().put(GeronimoSecurityBuilderImpl.ROLE_MAPPER_DATA_NAME, jaccBeanName);
         module.setEarContext(earContext);
         module.setRootEarContext(earContext);
         builder.initContext(earContext, module, bundle);



Mime
View raw message