geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r500176 - in /geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb: EjbModuleImpl.java OpenEjbSystem.java OpenEjbSystemGBean.java
Date Fri, 26 Jan 2007 08:14:25 GMT
Author: dblevins
Date: Fri Jan 26 00:14:24 2007
New Revision: 500176

URL: http://svn.apache.org/viewvc?view=rev&rev=500176
Log:
Hooked up the new undeploy code

Modified:
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java?view=diff&rev=500176&r1=500175&r2=500176
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbModuleImpl.java
Fri Jan 26 00:14:24 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/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java?view=diff&rev=500176&r1=500175&r2=500176
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
Fri Jan 26 00:14:24 2007
@@ -23,6 +23,8 @@
 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.config.ClientModule;
 import org.apache.openejb.config.EjbModule;
 import org.apache.openejb.assembler.classic.ClientInfo;
@@ -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/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?view=diff&rev=500176&r1=500175&r2=500176
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
Fri Jan 26 00:14:24 2007
@@ -29,6 +29,8 @@
 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;
@@ -164,6 +166,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