geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r901935 [3/3] - in /geronimo/server/trunk: framework/configs/karaf-framework/src/main/filtered-resources/etc/ framework/configs/rmi-naming/src/main/plan/ framework/modules/geronimo-core/src/main/java/org/apache/geronimo/validator/ framework...
Date Fri, 22 Jan 2010 00:10:56 GMT
Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Fri Jan 22 00:10:53 2010
@@ -20,14 +20,21 @@
 import java.util.Collection;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Map;
+
 import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.NamingException;
 
+import org.apache.geronimo.j2ee.jndi.ApplicationJndi;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.EJB;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.UndeployException;
 import org.apache.openejb.NoSuchApplicationException;
@@ -41,6 +48,8 @@
     private static final Logger log = LoggerFactory.getLogger(EjbModuleImpl.class);
     private final J2EEServer server;
     private final J2EEApplication application;
+    private final ApplicationJndi applicationJndi;
+    private final Context moduleContext;
     private final String deploymentDescriptor;
     private final String objectName;
     private final Collection<? extends EJB> ejbs;
@@ -49,13 +58,15 @@
     private final OpenEjbSystem openEjbSystem;
     private final EjbJarInfo ejbJarInfo;
 
-    public EjbModuleImpl(String objectName, J2EEServer server, J2EEApplication application,
String deploymentDescriptor, Collection<? extends EJB> ejbs, ClassLoader classLoader,
OpenEjbSystem openEjbSystem, EjbJarInfo ejbJarInfo) {
+    public EjbModuleImpl(String objectName, J2EEServer server, J2EEApplication application,
ApplicationJndi applicationJndi, Map<String, Object> moduleJndi, String deploymentDescriptor,
Collection<? extends EJB> ejbs, ClassLoader classLoader, Kernel kernel, OpenEjbSystem
openEjbSystem, EjbJarInfo ejbJarInfo) throws NamingException {
         this.objectName = objectName;
         ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
 
         this.server = server;
         this.application = application;
+        this.applicationJndi = applicationJndi;
+        this.moduleContext = EnterpriseNamingContext.livenReferences(moduleJndi, null, kernel,
classLoader, "module/");
         this.deploymentDescriptor = deploymentDescriptor;
         this.ejbs = ejbs;
 
@@ -117,6 +128,13 @@
         return result;
     }
 
+    public ApplicationJndi getApplicationJndi() {
+        return applicationJndi;
+    }
+
+    public Context getModuleContext() {
+        return moduleContext;
+    }
 
     protected void start() throws Exception {
         openEjbSystem.createEjbJar(ejbJarInfo, classLoader);

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImplGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImplGBean.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImplGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImplGBean.java
Fri Jan 22 00:10:53 2010
@@ -17,22 +17,41 @@
 package org.apache.geronimo.openejb;
 
 import java.util.Collection;
+import java.util.Map;
 
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import javax.naming.NamingException;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+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.gbean.annotation.ParamSpecial;
+import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.jndi.ApplicationJndi;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.EJB;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 
 /**
+ * This starts before the ejb gbeans
+ * 
  * @version $Revision$ $Date$
  */
+@GBean(j2eeType = NameFactory.EJB_MODULE)
 public final class EjbModuleImplGBean extends EjbModuleImpl implements GBeanLifecycle {
-    public EjbModuleImplGBean(String objectName, J2EEServer server, J2EEApplication application,
String deploymentDescriptor, Collection<? extends EJB> ejbs, ClassLoader classLoader,
OpenEjbSystem openEjbSystem, EjbJarInfo ejbJarInfo) {
-        super(objectName, server, application, deploymentDescriptor, ejbs, classLoader, openEjbSystem,
ejbJarInfo);
+    public EjbModuleImplGBean(@ParamSpecial(type = SpecialAttributeType.objectName) String
objectName,
+                              @ParamReference(name = "J2EEServer", namingType = NameFactory.J2EE_SERVER)
J2EEServer server,
+                              @ParamReference(name = "J2EEApplication", namingType = NameFactory.J2EE_APPLICATION)
J2EEApplication application,
+                              @ParamReference(name = "ApplicationJndi", namingType = "GBEAN")
ApplicationJndi applicationJndi,
+                              @ParamAttribute(name = "moduleJndi") Map<String, Object>
moduleJndi,
+                              @ParamAttribute(name = "deploymentDescriptor") String deploymentDescriptor,
+                              @ParamReference(name = "EJBCollection") Collection<? extends
EJB> ejbs,
+                              @ParamSpecial(type = SpecialAttributeType.classLoader) ClassLoader
classLoader,
+                              @ParamSpecial(type = SpecialAttributeType.kernel)Kernel kernel,
@ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
+                              @ParamAttribute(name = "ejbJarInfo") EjbJarInfo ejbJarInfo)
throws NamingException {
+        super(objectName, server, application, applicationJndi, moduleJndi, deploymentDescriptor,
ejbs, classLoader, kernel, openEjbSystem, ejbJarInfo);
     }
 
     public void doStart() throws Exception {
@@ -47,37 +66,4 @@
         stop();
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EjbModuleImplGBean.class,
NameFactory.EJB_MODULE);
-        infoBuilder.addReference("J2EEServer", J2EEServer.class);
-        infoBuilder.addReference("J2EEApplication", J2EEApplication.class);
-
-        infoBuilder.addAttribute("deploymentDescriptor", String.class, true);
-
-        infoBuilder.addReference("EJBCollection", EJB.class);
-
-        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
-
-        infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
-        infoBuilder.addAttribute("ejbJarInfo", EjbJarInfo.class, true);
-
-        infoBuilder.setConstructor(new String[]{
-                "objectName",
-                "J2EEServer",
-                "J2EEApplication",
-                "deploymentDescriptor",
-                "EJBCollection",
-                "classLoader",
-                "OpenEjbSystem",
-                "ejbJarInfo"
-        });
-
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Modified: geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceContextRefBuilder.java
Fri Jan 22 00:10:53 2010
@@ -139,7 +139,7 @@
 
                 PersistenceContextReference reference = new PersistenceContextReference(module.getConfigId(),
persistenceUnitNameQuery, transactionScoped, properties);
 
-                NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + persistenceContextRefName,
reference);
+                put(persistenceContextRefName, reference, NamingBuilder.JNDI_KEY.get(componentContext));
             } catch (DeploymentException e) {
                 problems.add(e);
             }
@@ -151,7 +151,7 @@
                 String persistenceContextRefName = gerPersistenceContextRef.getPersistenceContextRefName();
                 GerPersistenceContextTypeType.Enum persistenceContextType = gerPersistenceContextRef.getPersistenceContextType();
                 boolean transactionScoped = persistenceContextType == null || !persistenceContextType.equals(GerPersistenceContextTypeType.EXTENDED);
-                Map properties = new HashMap();
+                Map<String, String> properties = new HashMap<String, String>();
                 addProperties(gerPersistenceContextRef, properties);
 
 
@@ -161,7 +161,7 @@
 
                 PersistenceContextReference reference = new PersistenceContextReference(module.getConfigId(),
persistenceUnitNameQuery, transactionScoped, properties);
 
-                getJndiContextMap(componentContext).put(ENV + persistenceContextRefName,
reference);
+                put(persistenceContextRefName, reference, NamingBuilder.JNDI_KEY.get(componentContext));
             } catch (DeploymentException e) {
                 problems.add(e);
             }

Modified: geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20-builder/src/main/java/org/apache/geronimo/persistence/builder/PersistenceUnitRefBuilder.java
Fri Jan 22 00:10:53 2010
@@ -125,7 +125,7 @@
 
                 PersistenceUnitReference reference = new PersistenceUnitReference(module.getConfigId(),
persistenceUnitNameQuery);
 
-                NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + persistenceUnitRefName,
reference);
+                put(persistenceUnitRefName, reference, NamingBuilder.JNDI_KEY.get(componentContext));
             } catch (DeploymentException e) {
                 problems.add(e);
             }
@@ -143,7 +143,7 @@
 
                 PersistenceUnitReference reference = new PersistenceUnitReference(module.getConfigId(),
persistenceUnitNameQuery);
 
-                NamingBuilder.JNDI_KEY.get(componentContext).put(ENV + PersistenceUnitRefName,
reference);
+                put(PersistenceUnitRefName, reference, NamingBuilder.JNDI_KEY.get(componentContext));
             } catch (DeploymentException e) {
                 problems.add(e);
             }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Fri Jan 22 00:10:53 2010
@@ -22,6 +22,7 @@
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -33,6 +34,7 @@
 import javax.transaction.TransactionManager;
 import javax.transaction.UserTransaction;
 
+import org.apache.geronimo.j2ee.jndi.ApplicationJndi;
 import org.apache.tomcat.InstanceManager;
 import org.apache.catalina.Context;
 import org.apache.catalina.LifecycleListener;
@@ -138,7 +140,7 @@
             @ParamAttribute(name = "contextPath") String contextPath,
             @ParamAttribute(name = "deploymentDescriptor") String originalSpecDD,
             @ParamAttribute(name = "configurationBaseUrl") URL configurationBaseUrl,
-            @ParamAttribute(name = "modulePath")String modulePath,
+            @ParamAttribute(name = "modulePath") String modulePath,
             @ParamAttribute(name = "securityHolder") SecurityHolder securityHolder,
             @ParamAttribute(name = "virtualServer") String virtualServer,
             @ParamAttribute(name = "componentContext") Map<String, Object> componentContext,
@@ -164,6 +166,7 @@
             @ParamReference(name = "ContextCustomizer") RuntimeCustomizer contextCustomizer,
             @ParamReference(name = "J2EEServer") J2EEServer server,
             @ParamReference(name = "J2EEApplication") J2EEApplication application,
+            @ParamReference(name = "ApplicationJndi") ApplicationJndi applicationJndi,
             @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel)
             throws Exception {
         assert classLoader != null;
@@ -200,7 +203,18 @@
         this.securityHolder = securityHolder;
 
         userTransaction = new GeronimoUserTransaction(transactionManager);
-        this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext,
userTransaction, kernel, classLoader);
+        Set<javax.naming.Context> contexts = new LinkedHashSet<javax.naming.Context>(3);
+        javax.naming.Context localContext = EnterpriseNamingContext.livenReferences(componentContext,
userTransaction, kernel, classLoader, "comp/");
+        contexts.add(localContext);
+        if (applicationJndi != null) {
+            if (applicationJndi.getApplicationContext() != null) {
+                contexts.add(applicationJndi.getApplicationContext());
+            }
+            if (applicationJndi.getGlobalContext() != null) {
+                contexts.add(applicationJndi.getGlobalContext());
+            }
+        }
+        this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(contexts);
 
         this.unshareableResources = unshareableResources;
         this.applicationManagedSecurityResources = applicationManagedSecurityResources;

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=901935&r1=901934&r2=901935&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Fri Jan 22 00:10:53 2010
@@ -20,7 +20,6 @@
 import org.apache.geronimo.connector.outbound.connectiontracking.GeronimoTransactionListener;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.osgi.MockBundleContext;
-import org.apache.geronimo.kernel.osgi.MockBundle;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.deploy.PrincipalInfo;
@@ -110,7 +109,7 @@
                 null,
                 null,
                 null,
-                null);
+                null, null);
         app.doStart();
         return app;
     }



Mime
View raw message