geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r230604 - in /geronimo/trunk/applications: console-core/ console-core/src/java/org/apache/geronimo/console/util/ console-standard/ console-standard/src/java/org/apache/geronimo/console/util/ console-standard/src/java/org/apache/geronimo/con...
Date Sat, 06 Aug 2005 22:10:44 GMT
Author: ammulder
Date: Sat Aug  6 15:10:37 2005
New Revision: 230604

URL: http://svn.apache.org/viewcvs?rev=230604&view=rev
Log:
Update the web manager portal page to use the management API
Combine the connector management functionality into a single portlet
  (though it's currently living in the AJP portlet)

Added:
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/editHTTP.jsp
Modified:
    geronimo/trunk/applications/console-core/project.xml
    geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
    geronimo/trunk/applications/console-standard/project.xml
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/AJP13ConnectorPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/ajp13/normal.jsp

Modified: geronimo/trunk/applications/console-core/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-core/project.xml?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-core/project.xml (original)
+++ geronimo/trunk/applications/console-core/project.xml Sat Aug  6 15:10:37 2005
@@ -16,6 +16,11 @@
         </dependency>
         <dependency>
             <groupId>geronimo</groupId>
+            <artifactId>geronimo-core</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
             <artifactId>geronimo-deployment</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>

Modified: geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java Sat Aug  6 15:10:37 2005
@@ -23,8 +23,12 @@
 import javax.management.MalformedObjectNameException;
 import org.apache.geronimo.j2ee.management.geronimo.JVM;
 import org.apache.geronimo.j2ee.management.geronimo.J2EEApplication;
+import org.apache.geronimo.j2ee.management.geronimo.WebContainer;
+import org.apache.geronimo.j2ee.management.geronimo.J2EEServer;
+import org.apache.geronimo.j2ee.management.geronimo.WebConnector;
+import org.apache.geronimo.j2ee.management.geronimo.EJBContainer;
+import org.apache.geronimo.j2ee.management.geronimo.EJBConnector;
 import org.apache.geronimo.j2ee.management.J2EEDomain;
-import org.apache.geronimo.j2ee.management.J2EEServer;
 import org.apache.geronimo.j2ee.management.J2EEDeployedObject;
 import org.apache.geronimo.j2ee.management.AppClientModule;
 import org.apache.geronimo.j2ee.management.WebModule;
@@ -45,8 +49,10 @@
 import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.system.logging.SystemLog;
+import org.apache.geronimo.pool.GeronimoExecutor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -74,7 +80,7 @@
             try {
                 domains[i] = (J2EEDomain)kernel.getProxyManager().createProxy(ObjectName.getInstance(names[i]), J2EEDomain.class);
             } catch (MalformedObjectNameException e) {
-                log.error(e);
+                log.error("Unable to look up related GBean", e);
             }
         }
         return domains;
@@ -84,11 +90,11 @@
         J2EEServer[] servers = new J2EEServer[0];
         try {
             String[] names = domain.getServers();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             servers = new J2EEServer[temp.length];
             System.arraycopy(temp, 0, servers, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return servers;
     }
@@ -97,11 +103,11 @@
         J2EEDeployedObject[] result = new J2EEDeployedObject[0];
         try {
             String[] names = server.getDeployedObjects();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new J2EEDeployedObject[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -114,11 +120,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.J2EE_APPLICATION)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (J2EEApplication[]) list.toArray(new J2EEApplication[list.size()]);
     }
@@ -131,11 +137,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.APP_CLIENT_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (AppClientModule[]) list.toArray(new AppClientModule[list.size()]);
     }
@@ -148,11 +154,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.WEB_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (WebModule[]) list.toArray(new WebModule[list.size()]);
     }
@@ -165,11 +171,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.EJB_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (EJBModule[]) list.toArray(new EJBModule[list.size()]);
     }
@@ -182,11 +188,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
     }
@@ -195,11 +201,11 @@
         J2EEResource[] result = new J2EEResource[0];
         try {
             String[] names = server.getResources();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new J2EEResource[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -215,7 +221,7 @@
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
     }
@@ -232,11 +238,100 @@
         JVM[] result = new JVM[0];
         try {
             String[] names = server.getJavaVMs();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new JVM[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public WebContainer getWebContainer(J2EEServer server) {
+        WebContainer result = null;
+        try {
+            String name = server.getWebContainer();
+            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
+            result = (WebContainer)temp;
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public WebConnector[] getWebConnectors(WebContainer container, String protocol) {
+        WebConnector[] result = new WebConnector[0];
+        try {
+            String[] names = container.getConnectors(protocol);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new WebConnector[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public WebConnector[] getWebConnectors(WebContainer container) {
+        WebConnector[] result = new WebConnector[0];
+        try {
+            String[] names = container.getConnectors();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new WebConnector[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public EJBContainer getEJBContainer(J2EEServer server) {
+        EJBContainer result = null;
+        try {
+            String name = server.getEJBContainer();
+            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
+            result = (EJBContainer)temp;
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public EJBConnector[] getEJBConnectors(EJBContainer container, String protocol) {
+        EJBConnector[] result = new EJBConnector[0];
+        try {
+            String[] names = container.getConnectors(protocol);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new EJBConnector[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public EJBConnector[] getEJBConnectors(EJBContainer container) {
+        EJBConnector[] result = new EJBConnector[0];
+        try {
+            String[] names = container.getConnectors();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new EJBConnector[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public GeronimoExecutor[] getThreadPools(J2EEServer server) {
+        GeronimoExecutor[] result = new GeronimoExecutor[0];
+        try {
+            String[] names = server.getThreadPools();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new GeronimoExecutor[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -245,10 +340,10 @@
         SystemLog result = null;
         try {
             String name = jvm.getSystemLog();
-            Object temp = pm.createProxy(ObjectName.getInstance(name));
+            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
             result = (SystemLog)temp;
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -258,11 +353,11 @@
         J2EEModule[] result = new J2EEModule[0];
         try {
             String[] names = application.getModules();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new J2EEModule[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -275,11 +370,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.APP_CLIENT_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (AppClientModule[]) list.toArray(new AppClientModule[list.size()]);
     }
@@ -292,11 +387,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.WEB_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (WebModule[]) list.toArray(new WebModule[list.size()]);
     }
@@ -309,11 +404,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.EJB_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (EJBModule[]) list.toArray(new EJBModule[list.size()]);
     }
@@ -326,11 +421,11 @@
                 ObjectName name = ObjectName.getInstance(names[i]);
                 String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
                 if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    list.add(pm.createProxy(name));
+                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
     }
@@ -340,11 +435,11 @@
         J2EEResource[] result = new J2EEResource[0];
         try {
             String[] names = application.getResources();
-            Object[] temp = pm.createProxies(names);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new J2EEResource[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return result;
     }
@@ -360,7 +455,7 @@
                 }
             }
         } catch (Exception e) {
-            log.error(e);
+            log.error("Unable to look up related GBean", e);
         }
         return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
     }
@@ -406,6 +501,25 @@
 
     public JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory) {
         return null;  //todo
+    }
+
+    public Object getObject(String objectName) {
+        try {
+            return kernel.getProxyManager().createProxy(ObjectName.getInstance(objectName), KernelManagementHelper.class.getClassLoader());
+        } catch (MalformedObjectNameException e) {
+            log.error("Unable to look up related GBean", e);
+            return null;
+        }
+    }
+
+    public String getGBeanDescription(String objectName) {
+        try {
+            return kernel.getGBeanInfo(ObjectName.getInstance(objectName)).getName();
+        } catch (GBeanNotFoundException e) {
+            return null;
+        } catch (MalformedObjectNameException e) {
+            return "Invalid object name";
+        }
     }
 
     /**

Modified: geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java (original)
+++ geronimo/trunk/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java Sat Aug  6 15:10:37 2005
@@ -17,7 +17,6 @@
 package org.apache.geronimo.console.util;
 
 import org.apache.geronimo.j2ee.management.J2EEDomain;
-import org.apache.geronimo.j2ee.management.J2EEServer;
 import org.apache.geronimo.j2ee.management.J2EEDeployedObject;
 import org.apache.geronimo.j2ee.management.J2EEResource;
 import org.apache.geronimo.j2ee.management.AppClientModule;
@@ -37,7 +36,13 @@
 import org.apache.geronimo.j2ee.management.ResourceAdapter;
 import org.apache.geronimo.j2ee.management.geronimo.JVM;
 import org.apache.geronimo.j2ee.management.geronimo.J2EEApplication;
+import org.apache.geronimo.j2ee.management.geronimo.J2EEServer;
+import org.apache.geronimo.j2ee.management.geronimo.WebContainer;
+import org.apache.geronimo.j2ee.management.geronimo.WebConnector;
+import org.apache.geronimo.j2ee.management.geronimo.EJBConnector;
+import org.apache.geronimo.j2ee.management.geronimo.EJBContainer;
 import org.apache.geronimo.system.logging.SystemLog;
+import org.apache.geronimo.pool.GeronimoExecutor;
 
 /**
  * A helper interface to navigate between management objects.  This is not
@@ -65,6 +70,13 @@
     JDBCResource[] getJDBCResources(J2EEServer server);
     JMSResource[] getJMSResources(J2EEServer server);
     JVM[] getJavaVMs(J2EEServer server);
+    WebContainer getWebContainer(J2EEServer server);
+    WebConnector[] getWebConnectors(WebContainer container, String protocol);
+    WebConnector[] getWebConnectors(WebContainer container);
+    EJBContainer getEJBContainer(J2EEServer server);
+    EJBConnector[] getEJBConnectors(EJBContainer container, String protocol);
+    EJBConnector[] getEJBConnectors(EJBContainer container);
+    GeronimoExecutor[] getThreadPools(J2EEServer server);
     //todo: repository, embedded database
 
     // JVM properties
@@ -94,4 +106,8 @@
     JDBCDriver[] getDriver(JDBCDataSource dataSource);
     JCAConnectionFactory[] getConnectionFactories(JCAResource resource);
     JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory);
+
+    // Generic utility methods
+    Object getObject(String objectName);
+    String getGBeanDescription(String objectName);
 }

Modified: geronimo/trunk/applications/console-standard/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/project.xml?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/project.xml (original)
+++ geronimo/trunk/applications/console-standard/project.xml Sat Aug  6 15:10:37 2005
@@ -17,6 +17,11 @@
         </dependency>
         <dependency>
              <groupId>geronimo</groupId>
+             <artifactId>geronimo-core</artifactId>
+             <version>${pom.currentVersion}</version>
+         </dependency>
+        <dependency>
+             <groupId>geronimo</groupId>
              <artifactId>geronimo-connector</artifactId>
              <version>${pom.currentVersion}</version>
          </dependency>

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java Sat Aug  6 15:10:37 2005
@@ -23,9 +23,14 @@
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.j2ee.management.J2EEDomain;
-import org.apache.geronimo.j2ee.management.J2EEServer;
 import org.apache.geronimo.j2ee.management.geronimo.JVM;
+import org.apache.geronimo.j2ee.management.geronimo.J2EEServer;
+import org.apache.geronimo.j2ee.management.geronimo.WebContainer;
+import org.apache.geronimo.j2ee.management.geronimo.WebConnector;
+import org.apache.geronimo.j2ee.management.geronimo.EJBContainer;
+import org.apache.geronimo.j2ee.management.geronimo.EJBConnector;
 import org.apache.geronimo.system.logging.SystemLog;
+import org.apache.geronimo.pool.GeronimoExecutor;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -39,6 +44,8 @@
     private final static String DOMAIN_KEY = "org.apache.geronimo.console.J2EEDomain";
     private final static String SERVER_KEY = "org.apache.geronimo.console.J2EEServer";
     private final static String JVM_KEY = "org.apache.geronimo.console.JVM";
+    private final static String WEB_CONTAINER_KEY = "org.apache.geronimo.console.WebContainer";
+    private final static String EJB_CONTAINER_KEY = "org.apache.geronimo.console.EJBContainer";
     private final static String SYSTEM_LOG_KEY = "org.apache.geronimo.console.SystemLog";
     // The following may change based on the user's selections
         // nothing yet
@@ -95,6 +102,70 @@
             request.getPortletSession().setAttribute(JVM_KEY, jvm, PortletSession.APPLICATION_SCOPE);
         }
         return jvm;
+    }
+
+    public static WebContainer getCurrentWebContainer(PortletRequest request) {
+        WebContainer container = (WebContainer) request.getPortletSession(true).getAttribute(WEB_CONTAINER_KEY, PortletSession.APPLICATION_SCOPE);
+        if(container == null) {
+            ManagementHelper helper = getManagementHelper(request);
+            container = helper.getWebContainer(getCurrentServer(request));
+            request.getPortletSession().setAttribute(WEB_CONTAINER_KEY, container, PortletSession.APPLICATION_SCOPE);
+        }
+        return container;
+    }
+
+    public static WebConnector createWebConnector(PortletRequest request, String name, String protocol, String host, int port) {
+        WebContainer container = getCurrentWebContainer(request);
+        String objectName = container.addConnector(name, protocol, host, port);
+        ManagementHelper helper = getManagementHelper(request);
+        return (WebConnector)helper.getObject(objectName);
+    }
+
+    public static WebConnector[] getWebConnectors(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getWebConnectors(getCurrentWebContainer(request));
+    }
+
+    public static WebConnector[] getWebConnectors(PortletRequest request, String protocol) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getWebConnectors(getCurrentWebContainer(request),protocol);
+    }
+
+    public static EJBContainer getCurrentEJBContainer(PortletRequest request) {
+        EJBContainer container = (EJBContainer) request.getPortletSession(true).getAttribute(EJB_CONTAINER_KEY, PortletSession.APPLICATION_SCOPE);
+        if(container == null) {
+            ManagementHelper helper = getManagementHelper(request);
+            container = helper.getEJBContainer(getCurrentServer(request));
+            request.getPortletSession().setAttribute(EJB_CONTAINER_KEY, container, PortletSession.APPLICATION_SCOPE);
+        }
+        return container;
+    }
+
+    public static EJBConnector createEJBConnector(PortletRequest request, String name, String protocol, String threadPoolObjectName, String host, int port) {
+        EJBContainer container = getCurrentEJBContainer(request);
+        String objectName = container.addConnector(name, protocol, threadPoolObjectName, host, port);
+        ManagementHelper helper = getManagementHelper(request);
+        return (EJBConnector)helper.getObject(objectName);
+    }
+
+    public static EJBConnector[] getEJBConnectors(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getEJBConnectors(getCurrentEJBContainer(request));
+    }
+
+    public static EJBConnector[] getEJBConnectors(PortletRequest request, String protocol) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getEJBConnectors(getCurrentEJBContainer(request), protocol);
+    }
+
+    public static GeronimoExecutor[] getThreadPools(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getThreadPools(getCurrentServer(request));
+    }
+
+    public static String getGBeanDescription(PortletRequest request, String objectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getGBeanDescription(objectName);
     }
 
     public static SystemLog getCurrentSystemLog(PortletRequest request) {

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/AJP13ConnectorPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/AJP13ConnectorPortlet.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/AJP13ConnectorPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/AJP13ConnectorPortlet.java Sat Aug  6 15:10:37 2005
@@ -19,10 +19,8 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Set;
+import java.util.List;
 
-import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
@@ -32,17 +30,17 @@
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
-
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
+import javax.portlet.PortletContext;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.j2ee.management.geronimo.WebContainer;
+import org.apache.geronimo.j2ee.management.geronimo.WebConnector;
+import org.apache.geronimo.jetty.JettyContainer;
+import org.apache.geronimo.jetty.JettyWebConnector;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 public class AJP13ConnectorPortlet extends GenericPortlet {
-
-    private static final ObjectName QUERY = JMXUtil
-            .getObjectName("*:type=WebConnector,protocol=AJP13,*");
-
-    private Kernel kernel;
+    private final static Log log = LogFactory.getLog(AJP13ConnectorPortlet.class);
 
     private PortletRequestDispatcher normalView;
 
@@ -50,8 +48,69 @@
 
     private PortletRequestDispatcher helpView;
 
+    protected PortletRequestDispatcher editHttpView;
+    protected PortletRequestDispatcher editHttpsView;
+
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
+        String mode = actionRequest.getParameter("mode");
+        WebContainer container = PortletManager.getCurrentWebContainer(actionRequest);
+        String server = "generic";
+        if(container instanceof JettyContainer) {
+            server = "jetty";
+        }
+        actionResponse.setRenderParameter("server", server);
+        if(mode.equals("new")) {
+            // User selected to add a new connector, need to show criteria portlet
+            actionResponse.setRenderParameter("mode", "new");
+            String protocol = actionRequest.getParameter("protocol");
+            actionResponse.setRenderParameter("protocol", protocol);
+        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
+            // Get submitted values
+            //todo: lots of validation
+            String protocol = actionRequest.getParameter("protocol");
+            String host = actionRequest.getParameter("host");
+            int port = Integer.parseInt(actionRequest.getParameter("port"));
+            int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
+            Integer minThreads = getInteger(actionRequest, "minThreads");
+            String name = actionRequest.getParameter("name");
+            // Create and configure the connector
+            WebConnector connector = PortletManager.createWebConnector(actionRequest, name, protocol, host, port);
+            connector.setMaxThreads(maxThreads);
+            // todo: more configurable HTTP/Jetty values
+            if(connector instanceof JettyWebConnector) {
+                if(minThreads != null) {
+                    ((JettyWebConnector)connector).setMinThreads(minThreads.intValue());
+                }
+            }
+            if(protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+                //todo: HTTPS values
+            }
+
+            // Start the connector
+            try {
+                connector.startRecursive();
+            } catch (Exception e) {
+                log.error("Unable to start connector", e); //todo: get into rendered page somehow?
+            }
+            actionResponse.setRenderParameter("mode", "list");
+        } else if(mode.equals("edit")) {
+            String objectName = actionRequest.getParameter("name");
+            actionResponse.setRenderParameter("name", objectName);
+            actionResponse.setRenderParameter("mode", "edit");
+        } else if(mode.equals("delete")) { // User chose to delete a connector
+            String objectName = actionRequest.getParameter("name");
+            PortletManager.getCurrentWebContainer(actionRequest).removeConnector(objectName);
+            actionResponse.setRenderParameter("mode", "list");
+        }
+    }
+
+    private Integer getInteger(ActionRequest actionRequest, String key) {
+        String value = actionRequest.getParameter(key);
+        if(value == null || value.equals("")) {
+            return null;
+        }
+        return new Integer(value);
     }
 
     protected void doView(RenderRequest renderRequest,
@@ -59,24 +118,73 @@
         if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
             return;
         }
+        String mode = renderRequest.getParameter("mode");
+        if(mode == null || mode.equals("")) {
+            mode = "list";
+        }
+        renderRequest.setAttribute("server", renderRequest.getParameter("server"));
+        WebContainer container = PortletManager.getCurrentWebContainer(renderRequest);
+        if(mode.equals("new")) {
+            String protocol = renderRequest.getParameter("protocol");
+            renderRequest.setAttribute("maxThreads", "50");
+            if(container instanceof JettyWebConnector) {
+                renderRequest.setAttribute("minThreads", "10");
+            }
+            renderRequest.setAttribute("protocol", protocol);
+            renderRequest.setAttribute("mode", "add");
+            if(protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+                editHttpsView.include(renderRequest, renderResponse);
+            } else {
+                editHttpView.include(renderRequest, renderResponse);
+            }
+        } else if(mode.equals("edit")) {
+            String objectName = renderRequest.getParameter("name");
+            WebConnector connector = null;
+            WebConnector all[] = PortletManager.getWebConnectors(renderRequest);
+            for (int i = 0; i < all.length; i++) {
+                WebConnector conn = all[i];
+                if(conn.getObjectName().equals(objectName)) {
+                    connector = conn;
+                    break;
+                }
+            }
+            if(connector == null) {
+                doList(renderRequest, container, renderResponse);
+            } else {
+                renderRequest.setAttribute("protocol", connector.getProtocol());
+                renderRequest.setAttribute("port", new Integer(connector.getPort()));
+                renderRequest.setAttribute("host", connector.getHost());
+                renderRequest.setAttribute("maxThreads", "50");
+                if(container instanceof JettyWebConnector) {
+                    renderRequest.setAttribute("minThreads", "10");
+                }
+                renderRequest.setAttribute("mode", "edit");
+                if(connector.getProtocol().equals(WebContainer.PROTOCOL_HTTPS)) {
+                    editHttpsView.include(renderRequest, renderResponse);
+                } else {
+                    editHttpView.include(renderRequest, renderResponse);
+                }
+            }
+        } else if(mode.equals("list")) {
+            doList(renderRequest, container, renderResponse);
+        }
+    }
 
-        Set connectors = kernel.listGBeans(QUERY);
-        ArrayList beans = new ArrayList(connectors.size());
-        for (Iterator i = connectors.iterator(); i.hasNext();) {
-            ObjectName name = (ObjectName) i.next();
+    private void doList(RenderRequest renderRequest, WebContainer container, RenderResponse renderResponse) throws PortletException, IOException {
+        List beans = new ArrayList();
+        WebConnector[] connectors = PortletManager.getWebConnectors(renderRequest);
+        for (int i = 0; i < connectors.length; i++) {
+            WebConnector connector = connectors[i];
             ConnectorInfo info = new ConnectorInfo();
-            info.setObjectName(name);
-            try {
-                info.setState(((Integer) kernel.getAttribute(name, "state"))
-                        .intValue());
-                info.setPort(((Integer) kernel.getAttribute(name, "port"))
-                        .intValue());
-            } catch (Exception e) {
-                throw new PortletException(e);
-            }
+            info.setObjectName(connector.getObjectName());
+            info.setState(connector.getState());
+            info.setPort(connector.getPort());
+            info.setProtocol(connector.getProtocol());
+            info.setDescription(PortletManager.getGBeanDescription(renderRequest, connector.getObjectName()));
             beans.add(info);
         }
         renderRequest.setAttribute("connectors", beans);
+        renderRequest.setAttribute("protocols", container.getSupportedProtocols());
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
@@ -92,20 +200,17 @@
 
     public void init(PortletConfig portletConfig) throws PortletException {
         super.init(portletConfig);
-        kernel = KernelRegistry.getSingleKernel();
-        normalView = portletConfig.getPortletContext().getRequestDispatcher(
-                "/WEB-INF/view/webmanager/ajp13/normal.jsp");
-        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
-                "/WEB-INF/view/webmanager/ajp13/maximized.jsp");
-        helpView = portletConfig.getPortletContext().getRequestDispatcher(
-                "/WEB-INF/view/webmanager/ajp13/help.jsp");
+        PortletContext pc = portletConfig.getPortletContext();
+        normalView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/ajp13/normal.jsp");
+        maximizedView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/ajp13/maximized.jsp");
+        helpView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/ajp13/help.jsp");
+        editHttpView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/editHTTP.jsp");
+        editHttpsView = pc.getRequestDispatcher("/WEB-INF/view/webmanager/editHTTP.jsp"); //todo: HTTPS args
     }
 
     public void destroy() {
         normalView = null;
         maximizedView = null;
-        kernel = null;
         super.destroy();
     }
-
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java Sat Aug  6 15:10:37 2005
@@ -24,18 +24,33 @@
 import org.apache.geronimo.kernel.management.State;
 
 public class ConnectorInfo implements Serializable {
+    private String description;
+    private String objectName;
+    private String protocol;
+    private int port;
+    private int state;
 
-    private ObjectName objectName;
+    public String getDescription() {
+        return description;
+    }
 
-    private int port;
+    public void setDescription(String description) {
+        this.description = description;
+    }
 
-    private int state;
+    public String getProtocol() {
+        return protocol;
+    }
+
+    public void setProtocol(String protocol) {
+        this.protocol = protocol;
+    }
 
-    public ObjectName getObjectName() {
+    public String getObjectName() {
         return objectName;
     }
 
-    public void setObjectName(ObjectName objectName) {
+    public void setObjectName(String objectName) {
         this.objectName = objectName;
     }
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java Sat Aug  6 15:10:37 2005
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 
-import javax.management.ObjectName;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
 import javax.portlet.GenericPortlet;
@@ -30,34 +29,32 @@
 import javax.portlet.RenderResponse;
 import javax.portlet.WindowState;
 
-import org.apache.geronimo.console.util.ObjectNameConstants;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelRegistry;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.j2ee.management.geronimo.WebContainer;
+import org.apache.geronimo.jetty.JettyContainer;
 
 public class WebManagerPortlet extends GenericPortlet {
-
-    private Kernel kernel;
-
     private PortletRequestDispatcher normalView;
 
     private PortletRequestDispatcher maximizedView;
 
     private PortletRequestDispatcher helpView;
 
-    private ObjectName jettyObjectName;
-
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         try {
+            WebContainer container = PortletManager.getCurrentWebContainer(actionRequest);
             String action = actionRequest.getParameter("stats");
             if (action != null) {
-                Boolean stats = Boolean.valueOf(action);
-                kernel
-                        .setAttribute(jettyObjectName, "collectStatistics",
-                                stats);
+                boolean stats = action.equals("true");
+                if(container instanceof JettyContainer) {
+                    ((JettyContainer)container).setCollectStatistics(stats);
+                }
             }
             if (actionRequest.getParameter("resetStats") != null) {
-                kernel.invoke(jettyObjectName, "resetStatistics");
+                if(container instanceof JettyContainer) {
+                    ((JettyContainer)container).resetStatistics();
+                }
             }
         } catch (Exception e) {
             throw new PortletException(e);
@@ -70,42 +67,26 @@
             return;
         }
         try {
-            Boolean statsOn = (Boolean) kernel.getAttribute(jettyObjectName,
-                    "collectStatistics");
-            renderRequest.setAttribute("statsOn", statsOn);
-            if (statsOn.booleanValue()) {
-                renderRequest.setAttribute("connections", (Integer) kernel
-                        .getAttribute(jettyObjectName, "connections"));
-                renderRequest.setAttribute("connectionsOpen", (Integer) kernel
-                        .getAttribute(jettyObjectName, "connectionsOpen"));
-                renderRequest.setAttribute("connectionsOpenMax",
-                        (Integer) kernel.getAttribute(jettyObjectName,
-                                "connectionsOpenMax"));
-                renderRequest.setAttribute("connectionsDurationAve",
-                        (Long) kernel.getAttribute(jettyObjectName,
-                                "connectionsDurationAve"));
-                renderRequest.setAttribute("connectionsDurationMax",
-                        (Long) kernel.getAttribute(jettyObjectName,
-                                "connectionsDurationMax"));
-                renderRequest.setAttribute("connectionsRequestsAve",
-                        (Integer) kernel.getAttribute(jettyObjectName,
-                                "connectionsRequestsAve"));
-                renderRequest.setAttribute("connectionsRequestsMax",
-                        (Integer) kernel.getAttribute(jettyObjectName,
-                                "connectionsRequestsMax"));
-                renderRequest.setAttribute("errors", (Integer) kernel
-                        .getAttribute(jettyObjectName, "errors"));
-                renderRequest.setAttribute("requests", (Integer) kernel
-                        .getAttribute(jettyObjectName, "requests"));
-                renderRequest.setAttribute("requestsActive", (Integer) kernel
-                        .getAttribute(jettyObjectName, "requestsActive"));
-                renderRequest.setAttribute("requestsActiveMax",
-                        (Integer) kernel.getAttribute(jettyObjectName,
-                                "requestsActiveMax"));
-                renderRequest.setAttribute("requestsDurationAve", (Long) kernel
-                        .getAttribute(jettyObjectName, "requestsDurationAve"));
-                renderRequest.setAttribute("requestsDurationMax", (Long) kernel
-                        .getAttribute(jettyObjectName, "requestsDurationMax"));
+            WebContainer container = PortletManager.getCurrentWebContainer(renderRequest);
+            if(container instanceof JettyContainer) {
+                JettyContainer jetty = ((JettyContainer)container);
+                boolean statsOn = jetty.getCollectStatistics();
+                renderRequest.setAttribute("statsOn", statsOn ? Boolean.TRUE : Boolean.FALSE);
+                if (statsOn) {
+                    renderRequest.setAttribute("connections", new Integer(jetty.getConnections()));
+                    renderRequest.setAttribute("connectionsOpen", new Integer(jetty.getConnectionsOpen()));
+                    renderRequest.setAttribute("connectionsOpenMax", new Integer(jetty.getConnectionsOpenMax()));
+                    renderRequest.setAttribute("connectionsDurationAve", new Long(jetty.getConnectionsDurationAve()));
+                    renderRequest.setAttribute("connectionsDurationMax", new Long(jetty.getConnectionsDurationMax()));
+                    renderRequest.setAttribute("connectionsRequestsAve", new Integer(jetty.getConnectionsRequestsAve()));
+                    renderRequest.setAttribute("connectionsRequestsMax", new Integer(jetty.getConnectionsRequestsMax()));
+                    renderRequest.setAttribute("errors", new Integer(jetty.getErrors()));
+                    renderRequest.setAttribute("requests", new Integer(jetty.getRequests()));
+                    renderRequest.setAttribute("requestsActive", new Integer(jetty.getRequestsActive()));
+                    renderRequest.setAttribute("requestsActiveMax", new Integer(jetty.getRequestsActiveMax()));
+                    renderRequest.setAttribute("requestsDurationAve", new Long(jetty.getRequestsDurationAve()));
+                    renderRequest.setAttribute("requestsDurationMax", new Long(jetty.getRequestsDurationMax()));
+                }
             }
         } catch (Exception e) {
             throw new PortletException(e);
@@ -124,13 +105,6 @@
 
     public void init(PortletConfig portletConfig) throws PortletException {
         super.init(portletConfig);
-        kernel = KernelRegistry.getSingleKernel();
-        try {
-            jettyObjectName = new ObjectName(
-                    ObjectNameConstants.WEBCONTAINER_OBJECT_NAME);
-        } catch (Exception e) {
-            throw new AssertionError();
-        }
 
         normalView = portletConfig.getPortletContext().getRequestDispatcher(
                 "/WEB-INF/view/webmanager/normal.jsp");
@@ -143,7 +117,6 @@
     public void destroy() {
         normalView = null;
         maximizedView = null;
-        kernel = null;
         super.destroy();
     }
 

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/portlet.xml Sat Aug  6 15:10:37 2005
@@ -265,9 +265,9 @@
     </portlet>
 
     <portlet>
-        <description>Portlet for managing AJP13 connectors</description>
+        <description>Portlet for managing Network Listeners</description>
         <portlet-name>AJP13ConnectorManager</portlet-name>
-        <display-name>AJP13 Connector Mangement Portlet</display-name>
+        <display-name>Network Listener Portlet</display-name>
 
         <portlet-class>org.apache.geronimo.console.webmanager.AJP13ManagerPortlet</portlet-class>
 
@@ -282,9 +282,9 @@
         <supported-locale>en</supported-locale>
 
         <portlet-info>
-            <title>AJP13 Connectors</title>
-            <short-title>AJP13 Connectors</short-title>
-            <keywords>AJP13 Connectors</keywords>
+            <title>Network Listeners</title>
+            <short-title>Listeners</short-title>
+            <keywords>HTTP HTTPS AJP Network Listeners Connectors</keywords>
         </portlet-info>
     </portlet>
 

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/ajp13/normal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/ajp13/normal.jsp?rev=230604&r1=230603&r2=230604&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/ajp13/normal.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/ajp13/normal.jsp Sat Aug  6 15:10:37 2005
@@ -1,11 +1,50 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
-<c:if test="${empty(connectors)}">There are no AJP13 Connectors defined</c:if>
+
+<p>This portlet shows all available network listeners.  It obsoletes the separate HTTP, HTTPS, and AJP portlets.
+The two portlets above should be removed, though the HTTP portlet currently has a nicer appearance that should
+be migrated first.  Also the start/stop actions below need to be implemented.  Finally, the add/edit screen
+should have more fields as they become supported by the Jetty interface, and there should be a separate add/edit
+JSP with additional logic for HTTPS connectors.</p>
+<!-- Show existing connectors -->
+<c:if test="${empty(connectors)}">There are no Connectors defined</c:if>
 <c:if test="${!empty(connectors)}"><table>
-    <tr><th>Connector</th><th>State</th><th>Port</th></tr>
+    <tr><th>Protocol</th><th>Port</th><th>State</th><th>Actions</th><th>Type</th></tr>
 <c:forEach var="info" items="${connectors}">
-    <tr><td>${info.objectName}</td><td>${info.stateName}</td><td>${info.port}</td></tr>
+    <tr>
+      <td>${info.protocol}</td>
+      <td>${info.port}</td>
+      <td>${info.stateName}</td>
+      <td>
+       <c:choose>
+         <c:when test="${info.stateName eq 'running'}">
+           [stop]
+         </c:when>
+         <c:otherwise>
+           [start]
+         </c:otherwise>
+       </c:choose>
+         <a href="<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="edit" />
+           <portlet:param name="name" value="${info.objectName}" />
+         </portlet:actionURL>">edit</a>
+         <a href="<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="delete" />
+           <portlet:param name="name" value="${info.objectName}" />
+         </portlet:actionURL>">delete</a>
+       </td>
+      <td>${info.description}</td>
+    </tr>
 </c:forEach>
 </table>
 </c:if>
+
+<!-- Links to add new connectors -->
+<c:forEach var="protocol" items="${protocols}">
+<br />
+<a href="<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="new" />
+           <portlet:param name="protocol" value="${protocol}" />
+         </portlet:actionURL>">Add new ${protocol} listener</a>
+</c:forEach>

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/editHTTP.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/editHTTP.jsp?rev=230604&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/editHTTP.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/editHTTP.jsp Sat Aug  6 15:10:37 2005
@@ -0,0 +1,76 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>
+<portlet:defineObjects/>
+
+<form name="<portlet:namespace/>" action="<portlet:actionURL/>">
+<input type="hidden" name="mode" value="${mode}">
+<input type="hidden" name="protocol" value="${protocol}">
+<table width="100%%"  border="0">
+
+<!-- Name Field -->
+<c:if test="${mode eq 'add'}">
+  <tr>
+    <td><div align="right">Unique Name: </div></td>
+    <td><input name="name" type="text" size="30"></td>
+  </tr>
+  <tr>
+    <td><div align="right"></div></td>
+    <td>A name that is different than the name for any other web connectors in the server</td>
+  </tr>
+</c:if>
+<!-- Host Field -->
+  <tr>
+    <td><div align="right">Host: </div></td>
+    <td>
+      <input name="host" type="text" size="30" value="${host}">
+    </td>
+  </tr>
+  <tr>
+    <td><div align="right"></div></td>
+    <td>The host name or IP to bind to.  The normal values are <tt>0.0.0.0</tt> (all interfaces) or <tt>localhost</tt> (local connections only)</td>
+  </tr>
+<!-- Port Field -->
+  <tr>
+    <td><div align="right">Port: </div></td>
+    <td>
+      <input name="port" type="text" size="5" value="${port}">
+	</td>
+  </tr>
+  <tr>
+    <td><div align="right"></div></td>
+    <td>The network port to bind to.</td>
+  </tr>
+<!-- Min Threads Field (Jetty only) -->
+<c:if test="${server eq 'jetty'}">
+  <tr>
+    <td><div align="right">Min Threads: </div></td>
+    <td>
+      <input name="minThreads" type="text" size="3" value="${minThreads}">
+	</td>
+  </tr>
+  <tr>
+    <td><div align="right"></div></td>
+    <td>The minimum number of threads this connector should use to handle incoming requests</td>
+  </tr>
+</c:if>
+<!-- Max Threads Field -->
+  <tr>
+    <td><div align="right">Max Threads: </div></td>
+    <td>
+      <input name="maxThreads" type="text" size="3" value="${maxThreads}">
+	</td>
+  </tr>
+  <tr>
+    <td><div align="right"></div></td>
+    <td>The maximum number of threads this connector should use to handle incoming requests</td>
+  </tr>
+<!-- Submit Button -->
+  <tr>
+    <td><div align="right"></div></td>
+    <td><input name="submit" type="submit" value="Save"></td>
+  </tr>
+</table>
+</form>
+<a href='<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="list" />
+         </portlet:actionURL>'>List connectors</a>
\ No newline at end of file



Mime
View raw message