geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r500428 - in /geronimo/server/branches/2.0-M2/modules: geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/ geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/ geronimo-openejb/src/main/j...
Date Sat, 27 Jan 2007 00:23:14 GMT
Author: dblevins
Date: Fri Jan 26 16:23:13 2007
New Revision: 500428

URL: http://svn.apache.org/viewvc?view=rev&rev=500428
Log:
Merging openejb-specific changes from trunk r500343

Modified:
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
    geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Fri Jan 26 16:23:13 2007
@@ -52,7 +52,7 @@
 import org.apache.openejb.jee.MessageDrivenBean;
 import org.apache.openejb.jee.EntityBean;
 import org.apache.openejb.jee.SessionBean;
-import org.apache.openejb.alt.config.ejb.EjbDeployment;
+import org.apache.openejb.jee.oejb3.EjbDeployment;
 import org.apache.geronimo.openejb.StatelessDeploymentGBean;
 import org.apache.geronimo.openejb.StatefulDeploymentGBean;
 import org.apache.geronimo.openejb.EntityDeploymentGBean;

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModule.java
Fri Jan 26 16:23:13 2007
@@ -23,7 +23,7 @@
 import org.apache.geronimo.j2ee.deployment.EJBModule;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.openejb.xbeans.ejbjar.OpenejbGeronimoEjbJarType;
-import org.apache.openejb.alt.config.ejb.OpenejbJar;
+import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.jee.EjbJar;
 import org.apache.xmlbeans.XmlObject;
@@ -65,8 +65,8 @@
         this.specDD = specDD;
     }
 
-    public org.apache.openejb.alt.config.EjbModule getEjbModule() {
-        return new org.apache.openejb.alt.config.EjbModule(classLoader, getModuleFile().getName(),
ejbJar,  openejbJar);
+    public org.apache.openejb.config.EjbModule getEjbModule() {
+        return new org.apache.openejb.config.EjbModule(classLoader, getModuleFile().getName(),
ejbJar,  openejbJar);
     }
 
     public EjbJarInfo getEjbJarInfo() {

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Fri Jan 26 16:23:13 2007
@@ -69,7 +69,7 @@
 import org.apache.geronimo.xbeans.javaee.AssemblyDescriptorType;
 import org.apache.geronimo.xbeans.javaee.EjbJarType;
 import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.alt.config.ejb.OpenejbJar;
+import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.Cmp2Builder;
 import org.apache.openejb.assembler.classic.AppInfo;

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Fri Jan 26 16:23:13 2007
@@ -49,8 +49,8 @@
 import org.apache.geronimo.xbeans.javaee.EjbRefType;
 import org.apache.geronimo.xbeans.javaee.InjectionTargetType;
 import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.alt.config.AnnotationDeployer;
-import org.apache.openejb.alt.config.JndiEncInfoBuilder;
+import org.apache.openejb.config.AnnotationDeployer;
+import org.apache.openejb.config.JndiEncInfoBuilder;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.JndiEncBuilder;
 import org.apache.openejb.assembler.classic.JndiEncInfo;

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb-builder/src/test/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilderTest.java
Fri Jan 26 16:23:13 2007
@@ -27,8 +27,8 @@
 import org.apache.geronimo.openejb.OpenEjbSystem;
 import org.apache.geronimo.openejb.OpenEjbSystemGBean;
 import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
-import org.apache.openejb.alt.config.EjbModule;
-import org.apache.openejb.alt.config.ejb.OpenejbJar;
+import org.apache.openejb.config.EjbModule;
+import org.apache.openejb.jee.oejb3.OpenejbJar;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.jee.EjbJar;
 

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbContainer.java
Fri Jan 26 16:23:13 2007
@@ -17,8 +17,6 @@
 package org.apache.geronimo.openejb;
 
 import java.util.Properties;
-import java.util.Map;
-import java.util.HashMap;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
@@ -29,7 +27,6 @@
 import org.apache.openejb.assembler.classic.BmpEntityContainerInfo;
 import org.apache.openejb.assembler.classic.CmpEntityContainerInfo;
 import org.apache.openejb.assembler.classic.MdbContainerInfo;
-import org.apache.openejb.alt.config.Bean;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Fri Jan 26 16:23:13 2007
@@ -26,6 +26,7 @@
 import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.apache.geronimo.management.EJB;
 import org.apache.openejb.core.CoreDeploymentInfo;
+import org.apache.openejb.DeploymentInfo;
 
 public class EjbDeployment implements EJB {
     private final String objectName;
@@ -56,22 +57,22 @@
     private CoreDeploymentInfo deploymentInfo;
 
     public EjbDeployment(String objectName,
-            String deploymentId,
-            String ejbName,
-            String homeInterfaceName,
-            String remoteInterfaceName,
-            String localHomeInterfaceName,
-            String localInterfaceName,
-            String serviceEndpointInterfaceName,
-            String beanClassName,
-            ClassLoader classLoader,
-            Subject defaultSubject,
-            Subject runAs,
-            Context componentContext,
-            Set unshareableResources,
-            Set applicationManagedSecurityResources,
-            TrackedConnectionAssociator trackedConnectionAssociator,
-            OpenEjbSystem openEjbSystem) {
+                         String deploymentId,
+                         String ejbName,
+                         String homeInterfaceName,
+                         String remoteInterfaceName,
+                         String localHomeInterfaceName,
+                         String localInterfaceName,
+                         String serviceEndpointInterfaceName,
+                         String beanClassName,
+                         ClassLoader classLoader,
+                         Subject defaultSubject,
+                         Subject runAs,
+                         Context componentContext,
+                         Set unshareableResources,
+                         Set applicationManagedSecurityResources,
+                         TrackedConnectionAssociator trackedConnectionAssociator,
+                         OpenEjbSystem openEjbSystem) {
         this.objectName = objectName;
         this.deploymentId = deploymentId;
         this.ejbName = ejbName;
@@ -157,6 +158,14 @@
 
     public EJBLocalHome getEJBLocalHome() {
         return deploymentInfo.getEJBLocalHome();
+    }
+
+    public DeploymentInfo.BusinessLocalHome getBusinessLocalHome() {
+        return deploymentInfo.getBusinessLocalHome();
+    }
+
+    public DeploymentInfo.BusinessRemoteHome getBusinessRemoteHome() {
+        return deploymentInfo.getBusinessRemoteHome();
     }
 
     public String getObjectName() {

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Fri Jan 26 16:23:13 2007
@@ -19,6 +19,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Hashtable;
+import java.util.List;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
@@ -28,11 +29,17 @@
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.UndeployException;
+import org.apache.openejb.NoSuchApplicationException;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
 
 /**
  * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
  */
 public class EjbModuleImpl implements EJBModule {
+
+    private static final Log log = LogFactory.getLog(EjbModuleImpl.class);
     private final J2EEServer server;
     private final J2EEApplication application;
     private final String deploymentDescriptor;
@@ -117,8 +124,17 @@
     }
 
     protected void stop() {
-        // todo enable when remove is implemented
-        // openEjbSystem.removeEjbJar(ejbJarInfo, classLoader);
+        try {
+            openEjbSystem.removeEjbJar(ejbJarInfo, classLoader);
+        } catch (NoSuchApplicationException e) {
+            log.error("Module does not exist.", e);
+        } catch (UndeployException e) {
+            List<Throwable> causes = e.getCauses();
+            log.error(e.getMessage()+": Encountered "+causes.size()+" failures.");
+            for (Throwable throwable : causes) {
+                log.info(throwable);
+            }
+        }
     }
 
     /**

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
Fri Jan 26 16:23:13 2007
@@ -23,8 +23,10 @@
 import org.apache.openejb.Container;
 import org.apache.openejb.DeploymentInfo;
 import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.alt.config.ClientModule;
-import org.apache.openejb.alt.config.EjbModule;
+import org.apache.openejb.UndeployException;
+import org.apache.openejb.NoSuchApplicationException;
+import org.apache.openejb.config.ClientModule;
+import org.apache.openejb.config.EjbModule;
 import org.apache.openejb.assembler.classic.ClientInfo;
 import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.ContainerInfo;
@@ -47,4 +49,6 @@
     void createEjbJar(EjbJarInfo ejbJarInfo, ClassLoader classLoader) throws NamingException,
IOException, OpenEJBException;
 
     DeploymentInfo getDeploymentInfo(String deploymentId);
+
+    void removeEjbJar(EjbJarInfo ejbJarInfo, ClassLoader classLoader) throws UndeployException,
NoSuchApplicationException;
 }

Modified: geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?view=diff&rev=500428&r1=500427&r2=500428
==============================================================================
--- geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
(original)
+++ geronimo/server/branches/2.0-M2/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
Fri Jan 26 16:23:13 2007
@@ -29,12 +29,14 @@
 import org.apache.openejb.Container;
 import org.apache.openejb.DeploymentInfo;
 import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.UndeployException;
+import org.apache.openejb.NoSuchApplicationException;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.core.ServerFederation;
 import org.apache.openejb.util.proxy.Jdk13ProxyFactory;
-import org.apache.openejb.alt.config.ClientModule;
-import org.apache.openejb.alt.config.ConfigurationFactory;
-import org.apache.openejb.alt.config.EjbModule;
+import org.apache.openejb.config.ClientModule;
+import org.apache.openejb.config.ConfigurationFactory;
+import org.apache.openejb.config.EjbModule;
 import org.apache.openejb.assembler.classic.Assembler;
 import org.apache.openejb.assembler.classic.ClientInfo;
 import org.apache.openejb.assembler.classic.ContainerInfo;
@@ -58,6 +60,13 @@
     }
     public OpenEjbSystemGBean(TransactionManager transactionManager, Kernel kernel) throws
Exception {
         System.setProperty("duct tape","");
+        SystemInstance systemInstance = SystemInstance.get();
+
+        String format = systemInstance.getProperty("openejb.deploymentId.format");
+        if (format == null){
+            systemInstance.setProperty("openejb.deploymentId.format", "{moduleId}/{ejbName}");
+        }
+
         System.setProperty("openejb.naming", "xbean");
         if (transactionManager == null) {
             throw new NullPointerException("transactionManager is null");
@@ -164,6 +173,10 @@
         } finally {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }
+    }
+
+    public void removeEjbJar(EjbJarInfo ejbJarInfo, ClassLoader classLoader) throws UndeployException,
NoSuchApplicationException {
+        assembler.destroyApplication(ejbJarInfo.jarPath);
     }
 
     public DeploymentInfo getDeploymentInfo(String deploymentId) {



Mime
View raw message