geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r263877 - in /geronimo/trunk/modules: client-builder/src/java/org/apache/geronimo/client/builder/ deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/ deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/ deploy-jsr88/src...
Date Sun, 28 Aug 2005 14:05:30 GMT
Author: ammulder
Date: Sun Aug 28 07:05:10 2005
New Revision: 263877

URL: http://svn.apache.org/viewcvs?rev=263877&view=rev
Log:
Make web modules supply a context path
Use it to populate WebURL in our TargetModuleID (GERONIMO-934)
Update deploy tool to show child modules
Update deploy tool to show WebURL for web modules
Indicate which modules are started when you list-modules (GERONIMO-674)
Remove redundant constant for app client archives

Added:
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java
  (with props)
Modified:
    geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/jmx/JMXDeploymentManager.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
    geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
    geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContext.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java

Modified: geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Sun Aug 28 07:05:10 2005
@@ -348,7 +348,7 @@
                     }
                     appClientDeploymentContext = new EARContext(appClientDir,
                             clientConfigId,
-                            ConfigurationModuleType.APP_CLIENT,
+                            ConfigurationModuleType.CAR,
                             clientParentId,
                             kernel,
                             clientApplicationName,

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetImpl.java
Sun Aug 28 07:05:10 2005
@@ -19,13 +19,14 @@
 
 import javax.enterprise.deploy.spi.Target;
 import javax.management.ObjectName;
+import java.io.Serializable;
 
 /**
  *
  *
  * @version $Rev$ $Date$
  */
-public class TargetImpl implements Target {
+public class TargetImpl implements Target, Serializable {
     private final ObjectName name;
     private final String description;
 

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/TargetModuleIDImpl.java
Sun Aug 28 07:05:10 2005
@@ -19,13 +19,17 @@
 
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.shared.ModuleType;
+import java.io.Serializable;
 
 /**
  * 
  * 
  * @version $Rev$ $Date$
  */
-public class TargetModuleIDImpl implements TargetModuleID {
+public class TargetModuleIDImpl implements TargetModuleID, Serializable {
+    private String webURL;
+    private ModuleType type;
     private final Target target;
     private final String moduleID;
     private final TargetModuleID parentTargetModuleID;
@@ -42,10 +46,14 @@
         this.target = target;
         this.moduleID = moduleID;
         parentTargetModuleID = null;
-        childTargetModuleID = new TargetModuleID[childIDs.length];
-        for (int i = 0; i < childIDs.length; i++) {
-            String childID = childIDs[i];
-            childTargetModuleID[i] = new TargetModuleIDImpl(target, childID, this);
+        if(childIDs == null || childIDs.length == 0) {
+            childTargetModuleID = null;
+        } else {
+            childTargetModuleID = new TargetModuleID[childIDs.length];
+            for (int i = 0; i < childIDs.length; i++) {
+                String childID = childIDs[i];
+                childTargetModuleID[i] = new TargetModuleIDImpl(target, childID, this);
+            }
         }
     }
 
@@ -73,7 +81,19 @@
     }
 
     public String getWebURL() {
-        return null;
+        return webURL;
+    }
+
+    public void setWebURL(String webURL) {
+        this.webURL = webURL;
+    }
+
+    public ModuleType getType() {
+        return type;
+    }
+
+    public void setType(ModuleType type) {
+        this.type = type;
     }
 
     public String toString() {

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=263877&r1=263876&r2=263877&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
Sun Aug 28 07:05:10 2005
@@ -19,9 +19,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
+import java.util.*;
 import javax.enterprise.deploy.model.DeployableObject;
 import javax.enterprise.deploy.shared.DConfigBeanVersionType;
 import javax.enterprise.deploy.shared.ModuleType;
@@ -35,15 +33,12 @@
 import javax.enterprise.deploy.spi.status.ProgressObject;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.management.remote.JMXConnector;
 
 import org.apache.geronimo.deployment.plugin.TargetImpl;
 import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
-import org.apache.geronimo.deployment.plugin.local.DistributeCommand;
-import org.apache.geronimo.deployment.plugin.local.RedeployCommand;
-import org.apache.geronimo.deployment.plugin.local.StartCommand;
-import org.apache.geronimo.deployment.plugin.local.StopCommand;
-import org.apache.geronimo.deployment.plugin.local.UndeployCommand;
+import org.apache.geronimo.deployment.plugin.local.*;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.NoSuchStoreException;
@@ -54,6 +49,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.connector.deployment.RARConfigurer;
 import org.apache.geronimo.web.deployment.WARConfigurer;
+import org.apache.geronimo.gbean.GBeanQuery;
 
 
 /**
@@ -151,14 +147,28 @@
                 for (int j = 0; j < infos.size(); j++) {
                     ConfigurationInfo info = (ConfigurationInfo) infos.get(j);
                     if (filter.accept(info)) {
-                        TargetModuleID moduleID = new TargetModuleIDImpl(target, info.getConfigID().toString());
+                        String name = info.getConfigID().toString();
+                        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) {
+                            for (int k = 0; k < moduleID.getChildTargetModuleID().length;
k++) {
+                                TargetModuleIDImpl child = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[k];
+                                if(CommandSupport.isWebApp(kernel, child.getModuleID()))
{
+                                    child.setType(ModuleType.WAR);
+                                }
+                            }
+                        }
                         result.add(moduleID);
                     }
                 }
             }
+            CommandSupport.addWebURLs(kernel, result);
             return result.size() == 0 ? null : (TargetModuleID[]) result.toArray(new TargetModuleID[result.size()]);
         } catch (NoSuchStoreException e) {
             throw (TargetException) new TargetException(e.getMessage()).initCause(e);
+        } catch (MalformedObjectNameException e) {
+            throw new RuntimeException(e);
         }
     }
 

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
Sun Aug 28 07:05:10 2005
@@ -25,6 +25,7 @@
 import java.io.OutputStream;
 import java.io.FileOutputStream;
 import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.shared.ModuleType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.Target;
 import javax.management.ObjectName;
@@ -101,9 +102,7 @@
         Object[] args = {moduleArchive, deploymentPlan};
         List objectNames = (List) kernel.invoke(deployer, "deploy", args, DEPLOY_SIG);
         if (objectNames == null || objectNames.isEmpty()) {
-            DeploymentException deploymentException = new DeploymentException("Got empty
list");
-            deploymentException.printStackTrace();
-            throw deploymentException;
+            throw new DeploymentException("Server didn't deploy anything");
         }
         String parentName = (String) objectNames.get(0);
         String[] childIDs = new String[objectNames.size()-1];
@@ -111,9 +110,21 @@
             childIDs[j] = (String)objectNames.get(j+1);
         }
 
-        TargetModuleID moduleID = new TargetModuleIDImpl(target, parentName.toString(), childIDs);
+        TargetModuleIDImpl moduleID = new TargetModuleIDImpl(target, parentName.toString(),
childIDs);
+        if(isWebApp(kernel, parentName.toString())) {
+            moduleID.setType(ModuleType.WAR);
+        }
+        if(moduleID.getChildTargetModuleID() != null) {
+            for (int i = 0; i < moduleID.getChildTargetModuleID().length; i++) {
+                TargetModuleIDImpl id = (TargetModuleIDImpl) moduleID.getChildTargetModuleID()[i];
+                if(isWebApp(kernel, id.getModuleID())) {
+                    id.setType(ModuleType.WAR);
+                }
+            }
+        }
         addModule(moduleID);
         if(finished) {
+            addWebURLs(kernel);
             complete("Completed with id " + parentName);
         }
     }

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
Sun Aug 28 07:05:10 2005
@@ -17,15 +17,13 @@
 
 package org.apache.geronimo.deployment.plugin.local;
 
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 import java.io.StringWriter;
 import java.io.PrintWriter;
 import javax.enterprise.deploy.shared.ActionType;
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.shared.StateType;
+import javax.enterprise.deploy.shared.ModuleType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.enterprise.deploy.spi.exceptions.OperationUnsupportedException;
 import javax.enterprise.deploy.spi.status.ClientConfiguration;
@@ -33,9 +31,15 @@
 import javax.enterprise.deploy.spi.status.ProgressEvent;
 import javax.enterprise.deploy.spi.status.ProgressListener;
 import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.deployment.plugin.jmx.JMXDeploymentManager.CommandContext;
+import org.apache.geronimo.deployment.plugin.TargetModuleIDImpl;
 import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.gbean.GBeanQuery;
 
 /**
  * @version $Rev$ $Date$
@@ -235,5 +239,122 @@
 
     public void setCommandContext(CommandContext commandContext) {
         this.commandContext = commandContext;
+    }
+
+    public static ModuleType convertModuleType(ConfigurationModuleType type) {
+        if(type.getValue() == ConfigurationModuleType.WAR.getValue()) {
+            return ModuleType.WAR;
+        }
+        if(type.getValue() == ConfigurationModuleType.RAR.getValue()) {
+            return ModuleType.RAR;
+        }
+        if(type.getValue() == ConfigurationModuleType.EJB.getValue()) {
+            return ModuleType.EJB;
+        }
+        if(type.getValue() == ConfigurationModuleType.EAR.getValue()) {
+            return ModuleType.EAR;
+        }
+        if(type.getValue() == ConfigurationModuleType.CAR.getValue()) {
+            return ModuleType.CAR;
+        }
+        return null;
+    }
+
+    public static boolean isWebApp(Kernel kernel, String configName) {
+        try {
+            Set set = kernel.listGBeans(new ObjectName("*:j2eeType=WebModule,name="+configName+",*"));
+            return set.size() > 0;
+        } catch (MalformedObjectNameException e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    protected void addWebURLs(Kernel kernel) {
+        addWebURLs(kernel, moduleIDs);
+    }
+
+    public static void addWebURLs(Kernel kernel, List moduleIDs) {
+        Set webApps = null;
+        String url = null;
+        for (int i = 0; i < moduleIDs.size(); i++) {
+            TargetModuleIDImpl id = (TargetModuleIDImpl) moduleIDs.get(i);
+            if(id.getType() != null && id.getType().getValue() == ModuleType.WAR.getValue())
{
+                if(webApps == null) {
+                    webApps = kernel.listGBeans(new GBeanQuery(null, "org.apache.geronimo.management.geronimo.WebModule"));
+                    Set set = kernel.listGBeans(new GBeanQuery(null, "org.apache.geronimo.management.geronimo.WebConnector"));
+                    Map map = new HashMap();
+                    ObjectName connector = null;
+                    for (Iterator it = set.iterator(); it.hasNext();) {
+                        ObjectName name = (ObjectName) it.next();
+                        try {
+                            String protocol = (String) kernel.getAttribute(name, "protocol");
+                            map.put(protocol, name);
+                        } catch (Exception e) {}
+                        if((connector = (ObjectName) map.get("HTTP")) == null) {
+                            if((connector = (ObjectName) map.get("HTTPS")) == null) {
+                                connector = (ObjectName) map.get("AJP");
+                                if(connector != null) {
+                                    url = "ajp://";
+                                }
+                            } else {
+                                url = "https://";
+                            }
+                        } else {
+                            url = "http://";
+                        }
+                        if(connector != null) {
+                            try {
+                                url = url + kernel.getAttribute(connector, "host") + ":"
+ kernel.getAttribute(connector, "port");
+                            } catch (Exception e) {
+                                url = null;
+                            }
+                        }
+                    }
+                }
+                for (Iterator it = webApps.iterator(); it.hasNext();) {
+                    ObjectName name = (ObjectName) it.next();
+                    if(name.getKeyProperty("name").equals(id.getModuleID())) {
+                        try {
+                            id.setWebURL(url == null ? (String)kernel.getAttribute(name,
"contextPath") : url + kernel.getAttribute(name, "contextPath"));
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+            }
+            if(id.getChildTargetModuleID() != null) {
+                addWebURLs(kernel, Arrays.asList(id.getChildTargetModuleID()));
+            }
+        }
+    }
+
+    public static List loadChildren(Kernel kernel, String configName) throws MalformedObjectNameException
{
+        List kids = new ArrayList();
+        Set test = kernel.listGBeans(new ObjectName("*:J2EEApplication="+configName+",j2eeType=WebModule,*"));
+        for (Iterator it = test.iterator(); it.hasNext();) {
+            ObjectName child = (ObjectName) it.next();
+            String childName = child.getKeyProperty("name");
+            kids.add(childName);
+        }
+        test = kernel.listGBeans(new ObjectName("*:J2EEApplication="+configName+",j2eeType=EJBModule,*"));
+        for (Iterator it = test.iterator(); it.hasNext();) {
+            ObjectName child = (ObjectName) it.next();
+            String childName = child.getKeyProperty("name");
+            kids.add(childName);
+        }
+        test = kernel.listGBeans(new ObjectName("*:J2EEApplication="+configName+",j2eeType=AppClientModule,*"));
+        for (Iterator it = test.iterator(); it.hasNext();) {
+            ObjectName child = (ObjectName) it.next();
+            String childName = child.getKeyProperty("name");
+            kids.add(childName);
+        }
+        test = kernel.listGBeans(new ObjectName("*:J2EEApplication="+configName+",j2eeType=ResourceAdapterModule,*"));
+        for (Iterator it = test.iterator(); it.hasNext();) {
+            ObjectName child = (ObjectName) it.next();
+            String childName = child.getKeyProperty("name");
+            kids.add(childName);
+        }
+        return kids;
     }
 }

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/RedeployCommand.java
Sun Aug 28 07:05:10 2005
@@ -117,6 +117,7 @@
             } finally {
                 ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
+            addWebURLs(kernel);
             complete("Completed");
         } catch (Exception e) {
             doFail(e);

Modified: geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
(original)
+++ geronimo/trunk/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/StartCommand.java
Sun Aug 28 07:05:10 2005
@@ -19,7 +19,11 @@
 
 import java.net.URI;
 import java.util.List;
+import java.util.Set;
+import java.util.ArrayList;
+import java.util.Iterator;
 import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.shared.ModuleType;
 import javax.enterprise.deploy.spi.TargetModuleID;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
@@ -73,14 +77,30 @@
                         ObjectName name = (ObjectName) list.get(j);
                         kernel.startRecursiveGBean(name);
                         String configName = ObjectName.unquote(name.getKeyProperty("name"));
-                        addModule(new TargetModuleIDImpl(modules[i].getTarget(), configName));
+                        List kids = loadChildren(kernel, configName);
+                        TargetModuleIDImpl id = new TargetModuleIDImpl(modules[i].getTarget(),
configName,
+                                (String[]) kids.toArray(new String[kids.size()]));
+                        if(isWebApp(kernel, configName)) {
+                            id.setType(ModuleType.WAR);
+                        }
+                        if(id.getChildTargetModuleID() != null) {
+                            for (int k = 0; k < id.getChildTargetModuleID().length; k++)
{
+                                TargetModuleIDImpl child = (TargetModuleIDImpl) id.getChildTargetModuleID()[k];
+                                if(isWebApp(kernel, child.getModuleID())) {
+                                    child.setType(ModuleType.WAR);
+                                }
+                            }
+                        }
+                        addModule(id);
                     }
                 }
             } finally {
                 ConfigurationUtil.releaseConfigurationManager(kernel, configurationManager);
             }
+            addWebURLs(kernel);
             complete("Completed");
         } catch (Exception e) {
+            e.printStackTrace();
             doFail(e);
         }
     }

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandDistribute.java
Sun Aug 28 07:05:10 2005
@@ -148,7 +148,13 @@
         results = po.getResultTargetModuleIDs();
         for (int i = 0; i < results.length; i++) {
             TargetModuleID result = results[i];
-            out.println(DeployUtils.reformat(getAction()+" "+result.getModuleID()+(multipleTargets
? " to "+result.getTarget().getName() : ""), 4, 72));
+            out.println(DeployUtils.reformat(getAction()+" "+result.getModuleID()+(multipleTargets
? " to "+result.getTarget().getName() : "")+(result.getWebURL() == null || !getAction().equals("Deployed")
? "" : " @ "+result.getWebURL()), 4, 72));
+            if(result.getChildTargetModuleID() != null) {
+                for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
+                    TargetModuleID child = result.getChildTargetModuleID()[j];
+                    out.println(DeployUtils.reformat("  `-> "+child.getModuleID()+(child.getWebURL()
== null || !getAction().equals("Deployed") ? "" : " @ "+child.getWebURL()),4, 72));
+                }
+            }
         }
 
         // if any results failed then throw so that we'll return non-0

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandListModules.java
Sun Aug 28 07:05:10 2005
@@ -73,31 +73,51 @@
             }
         }
         final DeploymentManager mgr = connection.getDeploymentManager();
-        TargetModuleID[] results;
+        TargetModuleID[] running = null, notrunning = null;
         Target[] tlist = identifyTargets(targets, mgr);
         if(tlist.length == 0) {
             tlist = mgr.getTargets();
         }
         try {
-            if(started == null) {
-                results = mgr.getAvailableModules(null, tlist);
-            } else if(started.booleanValue()) {
-                results = mgr.getRunningModules(null, tlist);
-            } else {
-                results = mgr.getNonRunningModules(null, tlist);
+            if(started == null || started.booleanValue()) {
+                running = mgr.getRunningModules(null, tlist);
+            }
+            if(started == null || !started.booleanValue()) {
+                notrunning = mgr.getNonRunningModules(null, tlist);
             }
         } catch (TargetException e) {
             throw new DeploymentException("Unable to query modules", e);
         } catch (IllegalStateException e) {
             throw new DeploymentSyntaxException(e.getMessage());
         }
-        if(results == null) {
-            results = new TargetModuleID[0];
+        if(running == null) {
+            running = new TargetModuleID[0];
+        }
+        if(notrunning == null) {
+            notrunning = new TargetModuleID[0];
         }
-        out.println("Found "+results.length+" module"+(results.length != 1 ? "s" : ""));
-        for (int i = 0; i < results.length; i++) {
-            TargetModuleID result = results[i];
+
+        int total = running.length+notrunning.length;
+        out.println("Found "+total+" module"+(total != 1 ? "s" : ""));
+        for (int i = 0; i < running.length; i++) {
+            TargetModuleID result = running[i];
+            out.println("  + "+result.getModuleID()+(tlist.length > 1 ? " on "+result.getTarget().getName():
"")+(result.getWebURL() == null ? "" : " @ "+result.getWebURL()));
+            if(result.getChildTargetModuleID() != null) {
+                for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
+                    TargetModuleID child = result.getChildTargetModuleID()[j];
+                    out.println("      `-> "+child.getModuleID()+(child.getWebURL() ==
null ? "" : " @ "+child.getWebURL()));
+                }
+            }
+        }
+        for (int i = 0; i < notrunning.length; i++) {
+            TargetModuleID result = notrunning[i];
             out.println("    "+result.getModuleID()+(tlist.length > 1 ? " on "+result.getTarget().getName():
""));
+            if(result.getChildTargetModuleID() != null) {
+                for (int j = 0; j < result.getChildTargetModuleID().length; j++) {
+                    TargetModuleID child = result.getChildTargetModuleID()[j];
+                    out.println("      `-> "+child.getModuleID());
+                }
+            }
         }
     }
 }

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandRedeploy.java
Sun Aug 28 07:05:10 2005
@@ -121,7 +121,13 @@
         TargetModuleID[] done = po.getResultTargetModuleIDs();
         for(int i = 0; i < done.length; i++) {
             TargetModuleID id = done[i];
-            out.println(DeployUtils.reformat("Redeployed "+id.getModuleID()+(multiple ? "
on "+id.getTarget().getName() : ""), 4, 72));
+            out.println(DeployUtils.reformat("Redeployed "+id.getModuleID()+(multiple ? "
on "+id.getTarget().getName() : "")+(id.getWebURL() == null ? "" : " @ "+id.getWebURL()),
4, 72));
+            if(id.getChildTargetModuleID() != null) {
+                for (int j = 0; j < id.getChildTargetModuleID().length; j++) {
+                    TargetModuleID child = id.getChildTargetModuleID()[j];
+                    out.println(DeployUtils.reformat("  `-> "+child.getModuleID()+(child.getWebURL()
== null ? "" : " @ "+child.getWebURL()),4, 72));
+                }
+            }
         }
         if(po.getDeploymentStatus().isFailed()) {
             throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());

Modified: geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
(original)
+++ geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/cli/CommandStart.java
Sun Aug 28 07:05:10 2005
@@ -74,7 +74,14 @@
         TargetModuleID[] done = po.getResultTargetModuleIDs();
         for(int i = 0; i < done.length; i++) {
             TargetModuleID id = done[i];
-            out.println(DeployUtils.reformat(getAction()+" "+id.getModuleID()+(multiple ?
" on "+id.getTarget().getName() : ""),4, 72));
+            out.print(DeployUtils.reformat(getAction()+" "+id.getModuleID()+(multiple ? "
on "+id.getTarget().getName() : "")+(id.getWebURL() == null || !getAction().equals("Started")
? "" : " @ "+id.getWebURL()),4, 72));
+            if(id.getChildTargetModuleID() != null) {
+                for (int j = 0; j < id.getChildTargetModuleID().length; j++) {
+                    TargetModuleID child = id.getChildTargetModuleID()[j];
+                    out.print(DeployUtils.reformat("  `-> "+child.getModuleID()+(child.getWebURL()
== null || !getAction().equals("Started") ? "" : " @ "+child.getWebURL()),4, 72));
+                }
+            }
+            out.println();
         }
         if(po.getDeploymentStatus().isFailed()) {
             throw new DeploymentException("Operation failed: "+po.getDeploymentStatus().getMessage());

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
(original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
Sun Aug 28 07:05:10 2005
@@ -39,7 +39,7 @@
     }
 
     public ConfigurationModuleType getType() {
-        return ConfigurationModuleType.APP_CLIENT;
+        return ConfigurationModuleType.CAR;
     }
 
     public JarFile getEarFile() {

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
(original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
Sun Aug 28 07:05:10 2005
@@ -41,7 +41,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.WebModule;
+import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.jetty.interceptor.BeforeAfter;

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationModuleType.java
Sun Aug 28 07:05:10 2005
@@ -29,7 +29,7 @@
 
     public static final ConfigurationModuleType EJB = new ConfigurationModuleType("EJB",
1);
 
-    public static final ConfigurationModuleType CAR = new ConfigurationModuleType("CAR",
2);
+    public static final ConfigurationModuleType CAR = new ConfigurationModuleType("CAR",
2); // app client
 
     public static final ConfigurationModuleType RAR = new ConfigurationModuleType("RAR",
3);
 
@@ -37,11 +37,9 @@
 
     public static final ConfigurationModuleType SERVICE = new ConfigurationModuleType("SERVICE",
5);
 
-    public static final ConfigurationModuleType APP_CLIENT = new ConfigurationModuleType("APP_CLIENT",
6);
+    public static final ConfigurationModuleType SPR = new ConfigurationModuleType("SPR",
6);
 
-    public static final ConfigurationModuleType SPR = new ConfigurationModuleType("SPR",
7);
-
-    private static final ConfigurationModuleType[] fromInt = {EAR, EJB, CAR, RAR, WAR, SERVICE,
APP_CLIENT, SPR};
+    private static final ConfigurationModuleType[] fromInt = {EAR, EJB, CAR, RAR, WAR, SERVICE,
SPR};
 
     private final String name;
     

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java?rev=263877&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java
(added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java
Sun Aug 28 07:05:10 2005
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed 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.management.geronimo;
+
+/**
+ * Geronimo extension to the standard JSR-77 WebModule type.
+ *
+ * @version $Rev: 231345 $ $Date: 2005-08-10 18:40:39 -0400 (Wed, 10 Aug 2005) $
+ */
+public interface WebModule extends org.apache.geronimo.management.WebModule {
+    /**
+     * Gets the web context for this web app.
+     */
+    public String getContextPath();
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebModule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Sun Aug 28 07:05:10 2005
@@ -384,7 +384,7 @@
 
             URI baseUri = earContext.getTargetFile(URI.create(webModule.getTargetPath() +
"/")).toURI();
             webModuleData.setAttribute("webAppRoot", baseUri);
-            webModuleData.setAttribute("path", webModule.getContextRoot());
+            webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 
             webModuleData.setAttribute("componentContext", compContext);
             webModuleData.setAttribute("userTransaction", userTransaction);

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java
Sun Aug 28 07:05:10 2005
@@ -211,7 +211,7 @@
      * @see org.apache.catalina.Host
      */
     public void addContext(TomcatContext ctx) throws Exception{
-        Context anotherCtxObj = embedded.createContext(ctx.getPath(), ctx.getDocBase(), ctx.getWebClassLoader());
+        Context anotherCtxObj = embedded.createContext(ctx.getContextPath(), ctx.getDocBase(),
ctx.getWebClassLoader());
 
         // Set the context for the Tomcat implementation
         ctx.setContext(anotherCtxObj);

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContext.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContext.java Sun
Aug 28 07:05:10 2005
@@ -32,7 +32,7 @@
  */
 public interface TomcatContext {
 
-    public String getPath();
+    public String getContextPath();
 
     public void setContext(Context ctx);
 

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
(original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatWebAppContext.java
Sun Aug 28 07:05:10 2005
@@ -39,7 +39,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.WebModule;
+import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
@@ -273,11 +273,11 @@
         this.context = context;
     }
 
-    public String getPath() {
+    public String getContextPath() {
         return path;
     }
 
-    public void setPath(String path) {
+    public void setContextPath(String path) {
         this.path = path;
     }
 
@@ -403,7 +403,7 @@
         infoBuilder.addAttribute("contextPriorityClassLoader", boolean.class, true);
         infoBuilder.addAttribute("configurationBaseUrl", URL.class, true);
 
-        infoBuilder.addAttribute("path", String.class, true);
+        infoBuilder.addAttribute("contextPath", String.class, true);
 
         infoBuilder.addAttribute("securityHolder", SecurityHolder.class, true);
         infoBuilder.addAttribute("virtualServer", String.class, true);

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=263877&r1=263876&r2=263877&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Sun Aug 28 07:05:10 2005
@@ -115,7 +115,7 @@
         app.setAttribute("userTransaction", userTransaction);
         app.setReferencePattern("TransactionContextManager", tcmName);
         app.setReferencePattern("TrackedConnectionAssociator", ctcName);
-        app.setAttribute("path", "/test");
+        app.setAttribute("contextPath", "/test");
 
         start(app);
     }
@@ -154,7 +154,7 @@
         app.setAttribute("webClassPath", new URI[]{});
         app.setAttribute("securityHolder", securityHolder);
         app.setAttribute("configurationBaseUrl", new File("target/var/catalina/webapps/war3/WEB-INF/web.xml").toURL());
-        app.setAttribute("path", "/securetest");
+        app.setAttribute("contextPath", "/securetest");
         app.setReferencePattern("TomcatRealm",contextRealmName);
         app.setReferencePattern("RoleDesignateSource", jaccBeanName);
 
@@ -200,7 +200,7 @@
         app.setAttribute("contextPriorityClassLoader", Boolean.FALSE);
         app.setAttribute("securityHolder", securityHolder);
         app.setAttribute("configurationBaseUrl", new File("target/var/catalina/webapps/war3/WEB-INF/web.xml").toURL());
-        app.setAttribute("path", "/securetest");
+        app.setAttribute("contextPath", "/securetest");
         app.setReferencePattern("RoleDesignateSource", jaccBeanName);
 
         OnlineUserTransaction userTransaction = new OnlineUserTransaction();



Mime
View raw message