geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1145437 - in /geronimo/server/trunk/plugins: j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/ openejb/geronimo-openejb-builder/s...
Date Tue, 12 Jul 2011 02:27:06 GMT
Author: djencks
Date: Tue Jul 12 02:27:05 2011
New Revision: 1145437

URL: http://svn.apache.org/viewvc?rev=1145437&view=rev
Log:
GERONIMO-6043 gbean reordering so initorder can work

Added:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
  (with props)
Modified:
    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/Module.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/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/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.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/src/main/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/test/java/org/apache/geronimo/tomcat/AbstractWebModuleTest.java

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -686,6 +686,14 @@ public class EARConfigBuilder implements
                 }
             }
 
+            AbstractName appJndiName = naming.createChildName(earContext.getModuleName(),
"ApplicationJndi", "ApplicationJndi");
+            earContext.getGeneralData().put(EARContext.APPLICATION_JNDI_NAME_KEY, appJndiName);
+            GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);
+            appContexts.setAttribute("globalContextSegment", applicationInfo.getJndiContext().get(JndiScope.global));
+            appContexts.setAttribute("applicationContextMap", applicationInfo.getJndiContext().get(JndiScope.app));
+            appContexts.setReferencePattern("GlobalContext", globalContextAbstractName);
+            earContext.addGBean(appContexts);
+
             // add gbeans declared in the geronimo-application.xml
             if (geronimoApplication != null) {
                 serviceBuilders.build(geronimoApplication, earContext, earContext);
@@ -740,8 +748,6 @@ public class EARConfigBuilder implements
                 namingBuilders.buildNaming(applicationInfo.getSpecDD(), applicationInfo.getVendorDD(),
applicationInfo, earContext.getGeneralData());
             }
 
-            AbstractName appJndiName = naming.createChildName(earContext.getModuleName(),
"ApplicationJndi", "ApplicationJndi");
-            earContext.getGeneralData().put(EARContext.APPLICATION_JNDI_NAME_KEY, appJndiName);
             // each module can now add it's GBeans
             for (Module<?,?> module : modules) {
                 if (createPlanMode.get()) {
@@ -761,12 +767,6 @@ public class EARConfigBuilder implements
                 throw new DeploymentException();
             }
 
-            GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);
-            appContexts.setAttribute("globalContextSegment", applicationInfo.getJndiContext().get(JndiScope.global));
-            appContexts.setAttribute("applicationContextMap", applicationInfo.getJndiContext().get(JndiScope.app));
-            appContexts.setReferencePattern("GlobalContext", globalContextAbstractName);
-            earContext.addGBean(appContexts);
-
             // it's the caller's responsibility to close the context...
             return earContext;
         } catch (GBeanAlreadyExistsException e) {

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?rev=1145437&r1=1145436&r2=1145437&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
Tue Jul 12 02:27:05 2011
@@ -20,6 +20,7 @@ import java.net.URI;
 import java.util.Comparator;
 import java.util.EnumSet;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.jar.JarFile;
@@ -28,8 +29,10 @@ import org.apache.geronimo.common.Deploy
 import org.apache.geronimo.deployment.Deployable;
 import org.apache.geronimo.deployment.DeployableJarFile;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.j2ee.jndi.JndiScope;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -58,6 +61,7 @@ public abstract class Module<T, U> {
     private String originalSpecDD;
     private AbstractFinder classFinder;
 
+    private final Map<AbstractName, GBeanData> gbeans = new LinkedHashMap<AbstractName,
GBeanData>();
     protected final Map sharedContext = new HashMap();
     protected final LinkedHashSet<Module<?, ?>> modules;
     protected final LinkedHashSet<String> moduleLocations;
@@ -202,6 +206,19 @@ public abstract class Module<T, U> {
         return namespace;
     }
 
+    public void addGBean(GBeanData gbean) throws GBeanAlreadyExistsException {
+        if (gbeans.containsKey(gbean.getAbstractName())) {
+            throw new GBeanAlreadyExistsException(gbean.getAbstractName().toString());
+        }
+        gbeans.put(gbean.getAbstractName(), gbean);
+    }
+
+    public void flushGBeansToContext() throws GBeanAlreadyExistsException {
+        for (GBeanData data: gbeans.values()) {
+            earContext.addGBean(data);
+        }
+    }
+
     public int hashCode() {
         return moduleURI.hashCode();
     }

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -251,15 +251,15 @@ public abstract class AbstractWebModuleB
 
     protected void addGBeanDependencies(EARContext earContext, GBeanData webModuleData) {
         log.debug("Adding dependencies to web module: " + webModuleData.getAbstractName());
-        Configuration earConfiguration = earContext.getConfiguration();
-        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_CONNECTION_FACTORY_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, ADMIN_OBJECT_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, STATELESS_SESSION_BEAN_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, STATEFUL_SESSION_BEAN_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, SINGLETON_BEAN_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_BEAN_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, ENTITY_BEAN_PATTERN),
webModuleData);
-        addDependencies(earContext.findGBeanDatas(earConfiguration, EJB_MODULE_PATTERN),
webModuleData);
+//        Configuration earConfiguration = earContext.getConfiguration();
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_CONNECTION_FACTORY_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, ADMIN_OBJECT_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, STATELESS_SESSION_BEAN_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, STATEFUL_SESSION_BEAN_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, SINGLETON_BEAN_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, MANAGED_BEAN_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, ENTITY_BEAN_PATTERN),
webModuleData);
+//        addDependencies(earContext.findGBeanDatas(earConfiguration, EJB_MODULE_PATTERN),
webModuleData);
     }
 
     private void addDependencies(LinkedHashSet<GBeanData> dependencies, GBeanData webModuleData)
{
@@ -720,9 +720,9 @@ public abstract class AbstractWebModuleB
         if (moduleContext.getServerName() != null) {
             webModuleData.setReferencePattern("J2EEServer", moduleContext.getServerName());
         }
-        if (!webModule.isStandAlone()) {
-            webModuleData.setReferencePattern("J2EEApplication", earContext.getModuleName());
-        }
+//        if (!webModule.isStandAlone()) {
+//            webModuleData.setReferencePattern("J2EEApplication", earContext.getModuleName());
+//        }
         webModuleData.setAttribute("holder", holder);
         //Add dependencies on managed connection factories and ejbs in this app
         //This is overkill, but allows for people not using java:comp context (even though
we don't support it)

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -184,7 +184,7 @@ public class EjbDeploymentBuilder {
             gbean.setReferencePattern("OpenEjbSystem", new AbstractNameQuery(null, Collections.EMPTY_MAP,
OpenEjbSystem.class.getName()));
 
             try {
-                earContext.addGBean(gbean);
+                ejbModule.addGBean(gbean);
             } catch (GBeanAlreadyExistsException e) {
                 throw new DeploymentException("Could not add entity bean to context", e);
             }

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -87,6 +87,7 @@ import org.apache.geronimo.naming.deploy
 import org.apache.geronimo.openejb.EjbContainer;
 import org.apache.geronimo.openejb.EjbDeployment;
 import org.apache.geronimo.openejb.EjbModuleImpl;
+import org.apache.geronimo.openejb.EjbModuleStarter;
 import org.apache.geronimo.openejb.GeronimoEjbInfo;
 import org.apache.geronimo.openejb.OpenEjbSystem;
 import org.apache.geronimo.openejb.cdi.SharedOwbContext;
@@ -814,9 +815,16 @@ public class EjbModuleBuilder implements
 
        
         GBeanData ejbModuleGBeanData = new GBeanData(ejbModule.getModuleName(), EjbModuleImpl.class);
+        AbstractName starterName = earContext.getNaming().createChildName(ejbModule.getModuleName(),
"EjbModuleStarter", "EjbModuleStarter");
+        GBeanData ejbModuleStarterGBeanData = new GBeanData(starterName, EjbModuleStarter.class);
+        ejbModuleStarterGBeanData.setReferencePattern("EjbModule", ejbModule.getModuleName());
+        ejbModuleStarterGBeanData.setReferencePattern("OpenEjbSystem", new AbstractNameQuery(null,
Collections.EMPTY_MAP, OpenEjbSystem.class.getName()));
         try {
 
-          earContext.addGBean(ejbModuleGBeanData);
+            //sets up the openejb infrastructure; happens before web modules start
+            earContext.addGBean(ejbModuleGBeanData);
+            //starts the ejbs; happens in module order (which may be before or after web
modules)
+            ejbModule.addGBean(ejbModuleStarterGBeanData);
             
         } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException("Could not add ejb module gbean", e);
@@ -1156,6 +1164,12 @@ public class EjbModuleBuilder implements
         EjbModule ejbModule = (EjbModule) module;
         EjbDeploymentBuilder ejbDeploymentBuilder = ejbModule.getEjbBuilder();
 
+        //push the gbeans into the configuration
+        try {
+            ejbModule.flushGBeansToContext();
+        } catch (GBeanAlreadyExistsException e) {
+            throw new DeploymentException("Name conflict between ejb modules", e);
+        }
         // add enc
         String moduleName = module.getName();
         

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -23,6 +23,7 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.management.ObjectName;
 import javax.naming.NamingException;
@@ -37,7 +38,6 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 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;
@@ -179,15 +179,27 @@ public class EjbModuleImpl implements EJ
         if (appContext == null) {
             throw new IllegalStateException("Not started");
         }
-        return appContext.get(WebBeansContext.class);
+        return appContext.getWebBeansContext();
+    }
+
+    public Map<String, EjbDeployment> getEjbDeploymentMap() {
+        return ejbs;
+    }
+
+    public AppInfo getAppInfo() {
+        return appInfo;
+    }
+
+    public AppContext getAppContext() {
+        return appContext;
     }
 
     public void doStart() throws Exception {
-        appContext = openEjbSystem.createApplication(appInfo, classLoader);
-        for (String deploymentId: ejbs.keySet()) {
-            BeanContext beanContext = openEjbSystem.getDeploymentInfo(deploymentId);
-            GeronimoThreadContextListener.get().getEjbDeployment((BeanContext) beanContext);
-        }
+        appContext = openEjbSystem.createApplication(appInfo, classLoader, false);
+//        for (String deploymentId: ejbs.keySet()) {
+//            BeanContext beanContext = openEjbSystem.getDeploymentInfo(deploymentId);
+//            GeronimoThreadContextListener.get().getEjbDeployment((BeanContext) beanContext);
+//        }
     }
 
     public void doStop() {

Added: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java?rev=1145437&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
(added)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
Tue Jul 12 02:27:05 2011
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.openejb;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.naming.NameAlreadyBoundException;
+import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.annotation.GBean;
+import org.apache.geronimo.gbean.annotation.ParamReference;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.openejb.BeanContext;
+import org.apache.openejb.Container;
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.assembler.classic.EjbResolver;
+import org.apache.openejb.loader.SystemInstance;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+@GBean(j2eeType = NameFactory.EJB_MODULE + "Starter")
+public class EjbModuleStarter implements GBeanLifecycle {
+    private static final Logger logger = LoggerFactory.getLogger(EjbModuleStarter.class);
+
+    private final EjbModuleImpl ejbModule;
+    private final OpenEjbSystem openEjbSystem;
+
+    public EjbModuleStarter(@ParamReference(name = "EjbModule", namingType = NameFactory.EJB_MODULE)EjbModuleImpl
ejbModule,
+                            @ParamReference(name = "OpenEjbSystem")OpenEjbSystem openEjbSystem)
{
+        this.ejbModule = ejbModule;
+        this.openEjbSystem = openEjbSystem;
+    }
+
+    @Override
+    public void doStart() throws Exception {
+        List<BeanContext> allDeployments = ejbModule.getAppContext().getDeployments();
+        //start code from openejb assembler
+
+                // deploy
+                for (BeanContext deployment : allDeployments) {
+                    try {
+                        Container container = deployment.getContainer();
+                        container.deploy(deployment);
+                        logger.info("createApplication.createdEjb" + deployment.getDeploymentID()
+ deployment.getEjbName() + container.getContainerID());
+                        if (logger.isDebugEnabled()) {
+                            for (Map.Entry<Object, Object> entry : deployment.getProperties().entrySet())
{
+                                logger.info("createApplication.createdEjb.property" + deployment.getEjbName()
+ entry.getKey() + entry.getValue());
+                            }
+                        }
+                    } catch (OpenEJBException e) {
+                        logger.warn("Apparent double start of ejb?? ", e);
+                    } catch (Throwable t) {
+                        throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'.
 Exception: "+t.getClass()+": "+t.getMessage(), t);
+                    }
+                }
+
+                // start
+                for (BeanContext deployment : allDeployments) {
+                    try {
+                        Container container = deployment.getContainer();
+                        container.start(deployment);
+                        logger.info("createApplication.startedEjb" + deployment.getDeploymentID()
+ deployment.getEjbName() + container.getContainerID());
+                    } catch (Throwable t) {
+                        throw new OpenEJBException("Error starting '"+deployment.getEjbName()+"'.
 Exception: "+t.getClass()+": "+t.getMessage(), t);
+                    }
+                }
+        EjbResolver globalEjbResolver = SystemInstance.get().getComponent(EjbResolver.class);
+        globalEjbResolver.addAll(ejbModule.getAppInfo().ejbJars);
+
+        for (String deploymentId: ejbModule.getEjbDeploymentMap().keySet()) {
+            BeanContext beanContext = openEjbSystem.getDeploymentInfo(deploymentId);
+            GeronimoThreadContextListener.get().getEjbDeployment((BeanContext) beanContext);
+        }
+    }
+
+    @Override
+    public void doStop() throws Exception {
+    }
+
+    @Override
+    public void doFail() {
+    }
+}

Propchange: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleStarter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java?rev=1145437&r1=1145436&r2=1145437&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
Tue Jul 12 02:27:05 2011
@@ -48,7 +48,7 @@ public class MEJBGBean implements GBeanL
         //A dummy URL MEJBGBean.class.getResource( "" ).toString() to avoid the "java.net.MalformedURLException:
no protocol: MEJBGBean" when startup
         EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(new EjbModule(cl, getClass().getSimpleName(),
MEJBGBean.class.getResource( "" ).toString(), ejbJar, null));
         GeronimoEjbInfo ejbInfo = new GeronimoEjbInfo(ejbJarInfo, null);
-        openEjbSystem.createApplication(ejbInfo.createAppInfo(), cl);
+        openEjbSystem.createApplication(ejbInfo.createAppInfo(), cl, true);
 	}
 
     static {

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java?rev=1145437&r1=1145436&r2=1145437&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
Tue Jul 12 02:27:05 2011
@@ -54,7 +54,7 @@ public interface OpenEjbSystem {
 
     BeanContext getDeploymentInfo(String deploymentId);
 
-    AppContext createApplication(AppInfo appInfo, ClassLoader classLoader) throws NamingException,
IOException, OpenEJBException;
+    AppContext createApplication(AppInfo appInfo, ClassLoader classLoader, boolean start)
throws NamingException, IOException, OpenEJBException;
     
     void removeApplication(AppInfo appInfo, ClassLoader classLoader) throws UndeployException,
NoSuchApplicationException;
     

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?rev=1145437&r1=1145436&r2=1145437&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
Tue Jul 12 02:27:05 2011
@@ -441,7 +441,7 @@ public class OpenEjbSystemGBean implemen
         }
     }
 
-    public AppContext createApplication(AppInfo appInfo, ClassLoader classLoader) throws
NamingException, IOException, OpenEJBException {
+    public AppContext createApplication(AppInfo appInfo, ClassLoader classLoader, boolean
start) throws NamingException, IOException, OpenEJBException {
         Set<AbstractName> names = kernel.listGBeans(new AbstractNameQuery(ResourceAdapterWrapper.class.getName()));
         for (AbstractName name : names) {
             try {
@@ -454,7 +454,7 @@ public class OpenEjbSystemGBean implemen
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(classLoader);
         try {
-            return assembler.createApplication(appInfo, classLoader);
+            return assembler.createApplication(appInfo, classLoader, start);
         } finally {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -491,7 +491,7 @@ public class TomcatModuleBuilder extends
             contextPath = "/" + contextPath;
         }
         try {
-            moduleContext.addGBean(webModuleData);
+            module.addGBean(webModuleData);
             Map<String, String> contextAttributes = new HashMap<String, String>();
             webModuleData.setAttribute("contextPath", contextPath);
             // unsharableResources, applicationManagedSecurityResources
@@ -735,6 +735,7 @@ public class TomcatModuleBuilder extends
                 earContext.addFile(module.getTargetPathURI().resolve("WEB-INF/web.xml"),
specDeploymentPlan);
             }
             webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
+            module.flushGBeansToContext();
             module.addAsChildConfiguration();
         } catch (DeploymentException de) {
             throw de;

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -163,7 +163,6 @@ public class TomcatWebAppContext impleme
             @ParamAttribute(name = "holder") Holder holder,
             @ParamReference(name = "ContextCustomizer") RuntimeCustomizer contextCustomizer,
             @ParamReference(name = "J2EEServer") J2EEServer server,
-            @ParamReference(name = "J2EEApplication") J2EEApplication application,
             @ParamReference(name = "ContextSource") ContextSource contextSource,
             @ParamReference(name = "applicationPolicyConfigurationManager") ApplicationPolicyConfigurationManager
applicationPolicyConfigurationManager,
             @ParamAttribute(name = "deploymentAttributes") Map<String, Object> deploymentAttributes,

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=1145437&r1=1145436&r2=1145437&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
Tue Jul 12 02:27:05 2011
@@ -136,7 +136,6 @@ public abstract class AbstractWebModuleT
                 null,   //holder
                 null,   //contextCustomizer
                 null,   //server
-                null,   //application
                 contextSource,  //contextSource
                 (ApplicationPolicyConfigurationManager)runAsSource,   //applicationPolicyConfigurationManager
                 //listenerClassNames



Mime
View raw message