geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r493252 - in /geronimo/server/branches/1.2: configs/client-deployer/src/plan/ configs/connector-deployer/src/plan/ configs/geronimo-gbean-deployer/ configs/j2ee-deployer/ configs/j2ee-deployer/src/plan/ configs/openejb-deployer/src/plan/ mo...
Date Sat, 06 Jan 2007 00:25:35 GMT
Author: djencks
Date: Fri Jan  5 16:25:34 2007
New Revision: 493252

URL: http://svn.apache.org/viewvc?view=rev&rev=493252
Log:
GERONIMO-2686 register ModuleConfigurers, port from trunk. I can't find an openejb version
to go with 1.2, so openejb may not compile

Added:
    geronimo/server/branches/1.2/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/jsr88/ClientConfiguration.java
      - copied unchanged from r493181, geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/jsr88/ClientConfiguration.java
    geronimo/server/branches/1.2/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/jsr88/ClientConfigurer.java
      - copied unchanged from r493181, geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/jsr88/ClientConfigurer.java
Modified:
    geronimo/server/branches/1.2/configs/client-deployer/src/plan/plan.xml
    geronimo/server/branches/1.2/configs/connector-deployer/src/plan/plan.xml
    geronimo/server/branches/1.2/configs/geronimo-gbean-deployer/pom.xml
    geronimo/server/branches/1.2/configs/j2ee-deployer/pom.xml
    geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml
    geronimo/server/branches/1.2/configs/openejb-deployer/src/plan/plan.xml
    geronimo/server/branches/1.2/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
    geronimo/server/branches/1.2/modules/geronimo-deploy-config/src/main/java/org/apache/geronimo/deployment/ModuleConfigurer.java
    geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/pom.xml
    geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/server/branches/1.2/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/jsr88/EARConfigurer.java
    geronimo/server/branches/1.2/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/WARConfigurer.java

Modified: geronimo/server/branches/1.2/configs/client-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/client-deployer/src/plan/plan.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/client-deployer/src/plan/plan.xml (original)
+++ geronimo/server/branches/1.2/configs/client-deployer/src/plan/plan.xml Fri Jan  5 16:25:34
2007
@@ -88,4 +88,6 @@
     </gbean>
 
 
+    <gbean name="ClientConfigurer" class="org.apache.geronimo.client.builder.jsr88.ClientConfigurer"/>
+
 </module>

Modified: geronimo/server/branches/1.2/configs/connector-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/connector-deployer/src/plan/plan.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/connector-deployer/src/plan/plan.xml (original)
+++ geronimo/server/branches/1.2/configs/connector-deployer/src/plan/plan.xml Fri Jan  5 16:25:34
2007
@@ -85,4 +85,6 @@
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
     </gbean>
 
+    <gbean name="RARConfigurer" class="org.apache.geronimo.connector.deployment.RARConfigurer"/>
+
 </module>

Modified: geronimo/server/branches/1.2/configs/geronimo-gbean-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/geronimo-gbean-deployer/pom.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/geronimo-gbean-deployer/pom.xml (original)
+++ geronimo/server/branches/1.2/configs/geronimo-gbean-deployer/pom.xml Fri Jan  5 16:25:34
2007
@@ -54,6 +54,12 @@
             <artifactId>geronimo-j2ee-deployment_1.1_spec</artifactId>
         </dependency>
 
+        <!-- jsr88 dconfigbean support base classes -->
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-deploy-config</artifactId>
+            <version>${version}</version>
+        </dependency>
         <!-- Thirdparty Dependencies -->
         
         <dependency>

Modified: geronimo/server/branches/1.2/configs/j2ee-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/j2ee-deployer/pom.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/j2ee-deployer/pom.xml (original)
+++ geronimo/server/branches/1.2/configs/j2ee-deployer/pom.xml Fri Jan  5 16:25:34 2007
@@ -92,6 +92,7 @@
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
             <version>${version}</version>
+            <scope>test</scope>
         </dependency>
 
         <dependency>

Modified: geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml (original)
+++ geronimo/server/branches/1.2/configs/j2ee-deployer/src/plan/plan.xml Fri Jan  5 16:25:34
2007
@@ -147,4 +147,6 @@
         <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
     </gbean>
 
+    <gbean name="EARConfigurer" class="org.apache.geronimo.j2ee.jsr88.EARConfigurer"/>
+
 </module>

Modified: geronimo/server/branches/1.2/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/configs/openejb-deployer/src/plan/plan.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/branches/1.2/configs/openejb-deployer/src/plan/plan.xml Fri Jan  5 16:25:34
2007
@@ -113,4 +113,6 @@
 
     <gbean name="WebServiceEJBLinkTemplate" class="org.apache.openejb.server.axis.WSContainerGBean"/>
 
+    <!--gbean name="EJBConfigurer" class="org.apache.openejb.deployment.EjbConfigurer"/-->
+
 </module>

Modified: geronimo/server/branches/1.2/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/RARConfigurer.java
Fri Jan  5 16:25:34 2007
@@ -52,6 +52,10 @@
         }
     }
 
+    public ModuleType getModuleType() {
+        return ModuleType.RAR;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {

Modified: geronimo/server/branches/1.2/modules/geronimo-deploy-config/src/main/java/org/apache/geronimo/deployment/ModuleConfigurer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-deploy-config/src/main/java/org/apache/geronimo/deployment/ModuleConfigurer.java?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-deploy-config/src/main/java/org/apache/geronimo/deployment/ModuleConfigurer.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-deploy-config/src/main/java/org/apache/geronimo/deployment/ModuleConfigurer.java
Fri Jan  5 16:25:34 2007
@@ -19,6 +19,7 @@
 
 import javax.enterprise.deploy.spi.DeploymentConfiguration;
 import javax.enterprise.deploy.model.DeployableObject;
+import javax.enterprise.deploy.shared.ModuleType;
 
 /**
  * Interface to be implemented by the deployment subsystem for any type
@@ -33,4 +34,10 @@
      * @return the vendor-specific deployment configuration, or null a configurer cannot
handle the DeployableObject
      */
     DeploymentConfiguration createConfiguration(DeployableObject deployable);
+
+    /**
+     * Supply the module type this configurer handles for indexing
+     * @return ModuleType handled by this Configurer.
+     */
+    ModuleType getModuleType();
 }

Modified: geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/pom.xml?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/pom.xml (original)
+++ geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/pom.xml Fri Jan  5 16:25:34
2007
@@ -41,8 +41,9 @@
         </dependency>
 
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-j2ee-deployment_1.1_spec</artifactId>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-deploy-config</artifactId>
+            <version>${version}</version>
         </dependency>
         
         <dependency>

Modified: geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
Fri Jan  5 16:25:34 2007
@@ -19,8 +19,12 @@
 import java.io.File;
 import java.io.InputStream;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.HashMap;
 
 import javax.enterprise.deploy.model.DeployableObject;
 import javax.enterprise.deploy.shared.DConfigBeanVersionType;
@@ -36,7 +40,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-//import org.apache.geronimo.connector.deployment.RARConfigurer;
+import org.apache.geronimo.deployment.ModuleConfigurer;
 import org.apache.geronimo.deployment.plugin.TargetImpl;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.deployment.plugin.local.CommandSupport;
@@ -46,13 +50,14 @@
 import org.apache.geronimo.deployment.plugin.local.StopCommand;
 import org.apache.geronimo.deployment.plugin.local.UndeployCommand;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.management.State;
-//import org.apache.geronimo.web.deployment.WARConfigurer;
 
 
 /**
@@ -60,15 +65,27 @@
  */
 public abstract class JMXDeploymentManager implements DeploymentManager {
     private static final Log log = LogFactory.getLog(JMXDeploymentManager.class);
+    private static final AbstractNameQuery CONFIGURER_QUERY = new AbstractNameQuery(ModuleConfigurer.class.getName());
 
     protected Kernel kernel;
     private ConfigurationManager configurationManager;
     private CommandContext commandContext;
+    private Map moduleConfigurers = new HashMap();
 
     protected void initialize(Kernel kernel) {
         this.kernel = kernel;
         configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
         commandContext = new CommandContext(true, true, null, null, false);
+        Set configurerNames = kernel.listGBeans(CONFIGURER_QUERY);
+        for (Iterator iterator = configurerNames.iterator(); iterator.hasNext(); ) {
+            AbstractName name = (AbstractName) iterator.next();
+            try {
+                ModuleConfigurer configurer = (ModuleConfigurer) kernel.getGBean(name);
+                moduleConfigurers.put(configurer.getModuleType(), configurer);
+            } catch (GBeanNotFoundException e) {
+                log.warn("No gbean found for name returned in query : " + name);
+            }
+        }
     }
 
     public void setAuthentication(String username, String password) {
@@ -152,10 +169,10 @@
                         List list = CommandSupport.loadChildren(kernel, name);
                         TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, name,
(String[]) list.toArray(new String[list.size()]));
                         moduleID.setType(CommandSupport.convertModuleType(info.getType()));
-                        if(moduleID.getChildTargetModuleID() != null) {
+                        if (moduleID.getChildTargetModuleID() != null) {
                             for (int k = 0; k < moduleID.getChildTargetModuleID().length;
k++) {
                                 TargetModuleIDImpl child = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[k];
-                                if(CommandSupport.isWebApp(kernel, child.getModuleID()))
{
+                                if (CommandSupport.isWebApp(kernel, child.getModuleID()))
{
                                     child.setType(ModuleType.WAR);
                                 }
                             }
@@ -280,23 +297,14 @@
     }
 
     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)) {
-            try {
-                Class cls = Class.forName("org.apache.openejb.deployment.EJBConfigurer");
-                return (DeploymentConfiguration)cls.getMethod("createConfiguration", new
Class[]{DeployableObject.class}).invoke(cls.newInstance(), new Object[]{dObj});
-            } catch (Exception e) {
-                log.error("Unable to invoke EJB deployer", e);
-            }
-        } else if(dObj.getType().equals(ModuleType.RAR)) {
-//            return new RARConfigurer().createConfiguration(dObj);
-        } else if(dObj.getType().equals(ModuleType.WAR)) {
-//            return new WARConfigurer().createConfiguration(dObj);
+        if (dObj == null) {
+            throw new NullPointerException("No deployable object supplied to configure");
+        }
+        ModuleConfigurer configurer = (ModuleConfigurer) moduleConfigurers.get(dObj.getType());
+        if (configurer == null) {
+            throw new InvalidModuleException("No configurer for module type: " + dObj.getType()
+ " registered");
         }
-        throw new InvalidModuleException("Not supported");
+        return configurer.createConfiguration(dObj);
     }
 
     protected DistributeCommand createDistributeCommand(Target[] targetList, File moduleArchive,
File deploymentPlan) {

Modified: geronimo/server/branches/1.2/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/jsr88/EARConfigurer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/jsr88/EARConfigurer.java?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/jsr88/EARConfigurer.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/jsr88/EARConfigurer.java
Fri Jan  5 16:25:34 2007
@@ -41,6 +41,10 @@
         }
     }
 
+    public ModuleType getModuleType() {
+        return ModuleType.EAR;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {

Modified: geronimo/server/branches/1.2/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/WARConfigurer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/1.2/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/WARConfigurer.java?view=diff&rev=493252&r1=493251&r2=493252
==============================================================================
--- geronimo/server/branches/1.2/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/WARConfigurer.java
(original)
+++ geronimo/server/branches/1.2/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/WARConfigurer.java
Fri Jan  5 16:25:34 2007
@@ -22,6 +22,9 @@
 import javax.enterprise.deploy.spi.DeploymentConfiguration;
 
 import org.apache.geronimo.deployment.ModuleConfigurer;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * @version $Rev$ $Date$
@@ -33,5 +36,21 @@
         } else {
             return null;
         }
+    }
+
+    public ModuleType getModuleType() {
+        return ModuleType.WAR;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(WARConfigurer.class,
NameFactory.DEPLOYMENT_CONFIGURER);
+        infoFactory.addInterface(ModuleConfigurer.class);
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
     }
 }



Mime
View raw message