geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r225334 - in /geronimo/trunk/modules/deploy-jsr88: project.xml src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Date Tue, 26 Jul 2005 15:50:45 GMT
Author: ammulder
Date: Tue Jul 26 08:50:41 2005
New Revision: 225334

URL: http://svn.apache.org/viewcvs?rev=225334&view=rev
Log:
Use reflection for OpenEJB lookups.

Modified:
    geronimo/trunk/modules/deploy-jsr88/project.xml
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java

Modified: geronimo/trunk/modules/deploy-jsr88/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/project.xml?rev=225334&r1=225333&r2=225334&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/project.xml (original)
+++ geronimo/trunk/modules/deploy-jsr88/project.xml Tue Jul 26 08:50:41 2005
@@ -122,12 +122,6 @@
         </dependency>
 
         <dependency>
-            <groupId>openejb</groupId>
-            <artifactId>openejb-builder</artifactId>
-            <version>${openejb_version}</version>
-        </dependency>
-
-        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-j2ee</artifactId>
             <version>${pom.currentVersion}</version>

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java?rev=225334&r1=225333&r2=225334&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/DisconnectedDeploymentManager.java
Tue Jul 26 08:50:41 2005
@@ -25,14 +25,18 @@
 import javax.enterprise.deploy.spi.exceptions.DConfigBeanVersionUnsupportedException;
 import javax.enterprise.deploy.spi.exceptions.TargetException;
 import javax.enterprise.deploy.model.DeployableObject;
+import javax.enterprise.deploy.model.DDBeanRoot;
+import javax.enterprise.deploy.model.DDBean;
+import javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
 import javax.enterprise.deploy.shared.DConfigBeanVersionType;
 import javax.enterprise.deploy.shared.ModuleType;
 import java.util.Locale;
+import java.util.Enumeration;
 import java.io.File;
 import java.io.InputStream;
+import java.io.FileNotFoundException;
 import org.apache.geronimo.connector.deployment.RARConfigurer;
 import org.apache.geronimo.web.deployment.WARConfigurer;
-import org.openejb.deployment.EJBConfigurer;
 
 /**
  * Implementation of a disconnected JSR88 DeploymentManager.
@@ -41,14 +45,19 @@
  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
  */
 public class DisconnectedDeploymentManager implements DeploymentManager {
-
     public DeploymentConfiguration createConfiguration(DeployableObject dObj) throws InvalidModuleException
{
         if(dObj.getType().equals(ModuleType.CAR)) {
             //todo: need a client configurer
         } else if(dObj.getType().equals(ModuleType.EAR)) {
             //todo: need an EAR configurer
         } else if(dObj.getType().equals(ModuleType.EJB)) {
-            return new EJBConfigurer().createConfiguration(dObj);
+            try {
+                Class cls = Class.forName("org.openejb.deployment.EJBConfigurer");
+                return (DeploymentConfiguration)cls.getMethod("createConfiguration", new
Class[]{DeployableObject.class}).invoke(cls.newInstance(), new Object[]{dObj});
+            } catch (Exception e) {
+                System.err.println("Unable to invoke EJB deployer");
+                e.printStackTrace();
+            }
         } else if(dObj.getType().equals(ModuleType.RAR)) {
             return new RARConfigurer().createConfiguration(dObj);
         } else if(dObj.getType().equals(ModuleType.WAR)) {
@@ -56,6 +65,51 @@
             // todo: Tomcat WARConfigurer
         }
         throw new InvalidModuleException("Not supported");
+    }
+
+    public static void main(String[] args) {
+        try {
+            Object o = new DisconnectedDeploymentManager().createConfiguration(new DeployableObject()
{
+                public ModuleType getType() {
+                    return ModuleType.EJB;  //To change body of implemented methods use File
| Settings | File Templates.
+                }
+
+                public DDBeanRoot getDDBeanRoot() {
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+
+                public DDBean[] getChildBean(String s) {
+                    return new DDBean[0];  //To change body of implemented methods use File
| Settings | File Templates.
+                }
+
+                public String[] getText(String s) {
+                    return new String[0];  //To change body of implemented methods use File
| Settings | File Templates.
+                }
+
+                public Class getClassFromScope(String s) {
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+
+                public String getModuleDTDVersion() {
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+
+                public DDBeanRoot getDDBeanRoot(String s) throws FileNotFoundException, DDBeanCreateException
{
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+
+                public Enumeration entries() {
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+
+                public InputStream getEntry(String s) {
+                    return null;  //To change body of implemented methods use File | Settings
| File Templates.
+                }
+            });
+            System.out.println("Class "+o.getClass().getName());
+        } catch (InvalidModuleException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+        }
     }
 
     public Locale[] getSupportedLocales() {

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?rev=225334&r1=225333&r2=225334&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Tue Jul 26 08:50:41 2005
@@ -54,7 +54,6 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.connector.deployment.RARConfigurer;
 import org.apache.geronimo.web.deployment.WARConfigurer;
-import org.openejb.deployment.EJBConfigurer;
 
 
 /**
@@ -276,7 +275,13 @@
         } else if(dObj.getType().equals(ModuleType.EAR)) {
             //todo: need an EAR configurer
         } else if(dObj.getType().equals(ModuleType.EJB)) {
-            return new EJBConfigurer().createConfiguration(dObj);
+            try {
+                Class cls = Class.forName("org.openejb.deployment.EJBConfigurer");
+                return (DeploymentConfiguration)cls.getMethod("createConfiguration", new
Class[]{DeployableObject.class}).invoke(cls.newInstance(), new Object[]{dObj});
+            } catch (Exception e) {
+                System.err.println("Unable to invoke EJB deployer");
+                e.printStackTrace();
+            }
         } else if(dObj.getType().equals(ModuleType.RAR)) {
             return new RARConfigurer().createConfiguration(dObj);
         } else if(dObj.getType().equals(ModuleType.WAR)) {



Mime
View raw message