geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r278800 [1/3] - in /geronimo/trunk: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ applications/console-standard/src/java/org/apache/geron...
Date Mon, 05 Sep 2005 17:11:14 GMT
Author: ammulder
Date: Mon Sep  5 10:10:49 2005
New Revision: 278800

URL: http://svn.apache.org/viewcvs?rev=278800&view=rev
Log:
Work on management API
 - make J2EEServer return arrays for all child managers, to support
   multiple active implementations
 - move web stuff to WebManager
 - remove static statistics from JVM in favor of StatisticsProvider
 - update console accordingly, though it still assumes there's only
   one active implementation (until the views are revised)
 - change containers to use GBeanData to identify their associated
   connectors, though this is by no means the last word on the
   subject

Added:
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/EJBManager.java
      - copied, changed from r267473, geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/EJBContainer.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java
      - copied, changed from r267473, geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkContainer.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java   (with props)
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java   (with props)
Removed:
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/EJBContainer.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkContainer.java
Modified:
    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/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
    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/ConnectorPortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/trunk/etc/project.properties
    geronimo/trunk/modules/assembly/src/plan/jetty-config.xml
    geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml
    geronimo/trunk/modules/assembly/src/plan/tomcat-config.xml
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
    geronimo/trunk/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyContainerImpl.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/AJP13Connector.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPConnector.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/connector/JettyConnector.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/WebContainer.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/ConnectorGBean.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/HttpsConnectorGBean.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatContainer.java

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=278800&r1=278799&r2=278800&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 Mon Sep  5 10:10:49 2005
@@ -26,11 +26,12 @@
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.WebConnector;
-import org.apache.geronimo.management.geronimo.EJBContainer;
+import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.EJBConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.management.geronimo.JMSConnector;
+import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.management.J2EEDomain;
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.AppClientModule;
@@ -250,22 +251,44 @@
         return result;
     }
 
-    public WebContainer getWebContainer(J2EEServer server) {
-        WebContainer result = null;
+    public WebManager[] getWebManagers(J2EEServer server) {
+        WebManager[] result = new WebManager[0];
         try {
-            String name = server.getWebContainer();
-            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-            result = (WebContainer)temp;
+            String[] names = server.getWebManagers();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new WebManager[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, String protocol) {
+    public WebContainer[] getWebContainers(WebManager manager) {
+        WebContainer[] result = new WebContainer[0];
+        try {
+            String[] names = manager.getContainers();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new WebContainer[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[] getWebConnectorsForContainer(WebManager manager, WebContainer container, String protocol) {
+        return getWebConnectorsForContainer(manager, kernel.getObjectNameFor(container).getCanonicalName(), protocol);
+    }
+
+    public WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container) {
+        return getWebConnectorsForContainer(manager, kernel.getObjectNameFor(container).getCanonicalName());
+    }
+
+    public WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName, String protocol) {
         WebConnector[] result = new WebConnector[0];
         try {
-            String[] names = container.getConnectors(protocol);
+            String[] names = manager.getConnectorsForContainer(containerObjectName, protocol);
             Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new WebConnector[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
@@ -275,10 +298,10 @@
         return result;
     }
 
-    public WebConnector[] getWebConnectors(WebContainer container) {
+    public WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName) {
         WebConnector[] result = new WebConnector[0];
         try {
-            String[] names = container.getConnectors();
+            String[] names = manager.getConnectorsForContainer(containerObjectName);
             Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new WebConnector[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
@@ -288,19 +311,46 @@
         return result;
     }
 
-    public EJBContainer getEJBContainer(J2EEServer server) {
-        EJBContainer result = null;
+    public WebConnector[] getWebConnectors(WebManager manager, String protocol) {
+        WebConnector[] result = new WebConnector[0];
         try {
-            String name = server.getEJBContainer();
-            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-            result = (EJBContainer)temp;
+            String[] names = manager.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 EJBConnector[] getEJBConnectors(EJBContainer container, String protocol) {
+    public WebConnector[] getWebConnectors(WebManager manager) {
+        WebConnector[] result = new WebConnector[0];
+        try {
+            String[] names = manager.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 EJBManager[] getEJBManagers(J2EEServer server) {
+        EJBManager[] result = null;
+        try {
+            String names[] = server.getEJBManagers();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new EJBManager[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(EJBManager container, String protocol) {
         EJBConnector[] result = new EJBConnector[0];
         try {
             String[] names = container.getConnectors(protocol);
@@ -313,7 +363,7 @@
         return result;
     }
 
-    public EJBConnector[] getEJBConnectors(EJBContainer container) {
+    public EJBConnector[] getEJBConnectors(EJBManager container) {
         EJBConnector[] result = new EJBConnector[0];
         try {
             String[] names = container.getConnectors();
@@ -326,12 +376,13 @@
         return result;
     }
 
-    public JMSManager getJMSManager(J2EEServer server) {
-        JMSManager result = null;
+    public JMSManager[] getJMSManagers(J2EEServer server) {
+        JMSManager[] result = null;
         try {
-            String name = server.getJMSManager();
-            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-            result = (JMSManager)temp;
+            String[] names = server.getJMSManagers();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSManager[temp.length];
+            System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
             log.error("Unable to look up related GBean", e);
         }
@@ -341,7 +392,7 @@
     public JMSBroker[] getJMSBrokers(JMSManager manager) {
         JMSBroker[] result = null;
         try {
-            String[] names = manager.getBrokers();
+            String[] names = manager.getContainers();
             Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new JMSBroker[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
@@ -377,10 +428,18 @@
         return result;
     }
 
-    public JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker, String protocol) {
+    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker, String protocol) {
+        return getJMSConnectorsForContainer(manager, kernel.getObjectNameFor(broker).getCanonicalName(), protocol);
+    }
+
+    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker) {
+        return getJMSConnectorsForContainer(manager, kernel.getObjectNameFor(broker).getCanonicalName());
+    }
+
+    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName, String protocol) {
         JMSConnector[] result = null;
         try {
-            String[] names = manager.getBrokerConnectors(pm.getProxyTarget(broker).getCanonicalName(), protocol);
+            String[] names = manager.getConnectorsForContainer(brokerObjectName, protocol);
             Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new JMSConnector[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
@@ -390,10 +449,10 @@
         return result;
     }
 
-    public JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker) {
+    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName) {
         JMSConnector[] result = null;
         try {
-            String[] names = manager.getBrokerConnectors(pm.getProxyTarget(broker).getCanonicalName());
+            String[] names = manager.getConnectorsForContainer(brokerObjectName);
             Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
             result = new JMSConnector[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);

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=278800&r1=278799&r2=278800&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 Mon Sep  5 10:10:49 2005
@@ -40,10 +40,11 @@
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebConnector;
 import org.apache.geronimo.management.geronimo.EJBConnector;
-import org.apache.geronimo.management.geronimo.EJBContainer;
+import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSBroker;
+import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.pool.GeronimoExecutor;
 
@@ -73,18 +74,28 @@
     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);
-    JMSManager getJMSManager(J2EEServer server);
+    WebManager[] getWebManagers(J2EEServer server);
+    WebContainer[] getWebContainers(WebManager manager);
+    WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container, String protocol);
+    WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container);
+    WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName, String protocol);
+    WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName);
+    WebConnector[] getWebConnectors(WebManager manager, String protocol);
+    WebConnector[] getWebConnectors(WebManager manager);
+    EJBManager[] getEJBManagers(J2EEServer server);
+//todo    EJBContainer[] getEJBContainers(EJBManager manager);
+//todo    EJBConnector[] getEJBConnectors(EJBManager manager, EJBContainer container, String protocol);
+//todo    EJBConnector[] getEJBConnectors(EJBManager manager, EJBContainer container);
+    EJBConnector[] getEJBConnectors(EJBManager container, String protocol);
+    EJBConnector[] getEJBConnectors(EJBManager container);
+    JMSManager[] getJMSManagers(J2EEServer server);
     JMSBroker[] getJMSBrokers(JMSManager manager);
     JMSConnector[] getJMSConnectors(JMSManager manager, String protocol);
     JMSConnector[] getJMSConnectors(JMSManager manager);
-    JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker, String protocol);
-    JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker);
+    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker, String protocol);
+    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker);
+    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName, String protocol);
+    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName);
     GeronimoExecutor[] getThreadPools(J2EEServer server);
     //todo: repository, embedded database
 

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/infomanager/ServerInfoPortlet.java Mon Sep  5 10:10:49 2005
@@ -70,19 +70,12 @@
         JVM jvm = PortletManager.getCurrentJVM(renderRequest);
 
         Date bootDate = jvm.getKernelBootTime();
-        long bootTime = bootDate.getTime() / 1000;
-        long currentTime = System.currentTimeMillis() / 1000;
-        long elapsedTime = currentTime - bootTime;
         svrProps.put("Kernel Boot Time", bootDate);
-        svrProps.put("Kernel Up Time", calcElapsedTime(elapsedTime));
         renderRequest.setAttribute("svrProps", svrProps);
 
         jvmProps.put("Java Version", jvm.getJavaVersion());
         jvmProps.put("Java Vendor", jvm.getJavaVendor());
         jvmProps.put("Node", jvm.getNode());
-        jvmProps.put("Max Memory", calcMemory(jvm.getMaxMemory()));
-        jvmProps.put("Total Memory", calcMemory(jvm.getTotalMemory()));
-        jvmProps.put("Free Memory", calcMemory(jvm.getFreeMemory()));
         jvmProps.put("Available Processors", new Integer(jvm.getAvailableProcessors()));
         renderRequest.setAttribute("jvmProps", jvmProps);
 
@@ -114,39 +107,4 @@
         helpView = null;
         super.destroy();
     }
-
-    private static String calcElapsedTime(long timeInSeconds) {
-        long days, hrs, mins, secs;
-        days = timeInSeconds / 86400;
-        timeInSeconds = timeInSeconds - (days * 86400);
-        hrs = timeInSeconds / 3600;
-        timeInSeconds = timeInSeconds - (hrs * 3600);
-        mins = timeInSeconds / 60;
-        timeInSeconds = timeInSeconds - (mins * 60);
-        secs = timeInSeconds;
-
-        StringBuffer sb = new StringBuffer();
-        sb.append(days);
-        sb.append(" day(s) ");
-        sb.append(hrs);
-        sb.append(" hour(s) ");
-        sb.append(mins);
-        sb.append(" minute(s) ");
-        sb.append(secs);
-        sb.append(" second(s)");
-
-        return sb.toString();
-    }
-
-    private static String calcMemory(long mem) {
-        long mb, kb;
-        mb = mem / 1048576;
-        // If less than 10MB return as KB
-        if (mb < 10) {
-            kb = mem / 1024;
-            return kb + "KB";
-        }
-        return mb + "MB";
-    }
-
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java Mon Sep  5 10:10:49 2005
@@ -32,16 +32,18 @@
  * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
  */
 public class BaseJMSPortlet extends BasePortlet {
-    protected static Map getBrokerMap(RenderRequest renderRequest) throws PortletException {
+    protected static Map getBrokerMap(RenderRequest renderRequest, String managerObjectName) throws PortletException {
         JMSBroker[] brokers;
         Map map = new LinkedHashMap();
         try {
-            brokers = PortletManager.getJMSBrokers(renderRequest);
-            for (int i = 0; i < brokers.length; i++) {
-                JMSBroker broker = brokers[i];
-                String string = ((GeronimoManagedBean)broker).getObjectName();
-                ObjectName name = ObjectName.getInstance(string);
-                map.put(name.getKeyProperty("name"), broker);
+            String[] names = PortletManager.getJMSBrokerNames(renderRequest, managerObjectName);
+            brokers = new JMSBroker[names.length];
+            for (int i = 0; i < names.length; i++) {
+                String name = names[i];
+                JMSBroker broker = PortletManager.getJMSBroker(renderRequest, name);
+                brokers[i] = broker;
+                ObjectName objectName = ObjectName.getInstance(name);
+                map.put(objectName.getKeyProperty("name"), broker);
             }
         } catch (Exception e) {
             throw new PortletException(e);

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java Mon Sep  5 10:10:49 2005
@@ -83,7 +83,8 @@
             if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
                 return;
             }
-            Map map = getBrokerMap(renderRequest);
+            String managerName = PortletManager.getJMSManagerNames(renderRequest)[0];  //todo: handle multiple
+            Map map = getBrokerMap(renderRequest, managerName);
             renderRequest.setAttribute("brokers", map.entrySet());
             if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
                 normalView.include(renderRequest, renderResponse);

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java Mon Sep  5 10:10:49 2005
@@ -32,7 +32,6 @@
 import javax.management.MalformedObjectNameException;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
-import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.commons.logging.Log;
@@ -58,6 +57,7 @@
                               ActionResponse actionResponse) throws PortletException, IOException {
         try {
             String mode = actionRequest.getParameter("mode");
+            String managerName = PortletManager.getJMSManagerNames(actionRequest)[0];  //todo: handle multiple
             String brokerName = actionRequest.getParameter("brokerName");
             if(mode.equals("new")) {
                 // User selected to add a new connector, need to show criteria portlet
@@ -73,8 +73,7 @@
                 int port = Integer.parseInt(actionRequest.getParameter("port"));
                 String name = actionRequest.getParameter("name");
                 // Create and configure the connector
-                JMSBroker broker = (JMSBroker)PortletManager.getManagedBean(actionRequest, brokerName);
-                JMSConnector connector = PortletManager.createJMSConnector(actionRequest, broker, name, protocol, host, port);
+                JMSConnector connector = PortletManager.createJMSConnector(actionRequest, managerName, brokerName, name, protocol, host, port);
                 // Start the connector
                 try {
                     ((GeronimoManagedBean)connector).startRecursive();
@@ -117,7 +116,7 @@
                 actionResponse.setRenderParameter("mode", "edit");
             } else if(mode.equals("delete")) {
                 String objectName = actionRequest.getParameter("objectName");
-                PortletManager.getCurrentJMSManager(actionRequest).removeConnector(objectName);
+                PortletManager.getJMSManager(actionRequest, managerName).removeConnector(objectName);
                 actionResponse.setRenderParameter("mode", "list");
             }
         } catch (Throwable e) {
@@ -139,7 +138,7 @@
             if(mode == null || mode.equals("")) {
                 mode = "list";
             }
-            JMSManager manager = PortletManager.getCurrentJMSManager(renderRequest);
+            String managerName = PortletManager.getJMSManagerNames(renderRequest)[0];  //todo: handle multiple
 
             if(mode.equals("new")) {
                 String brokerName = renderRequest.getParameter("brokerName");
@@ -152,7 +151,7 @@
                 String objectName = renderRequest.getParameter("objectName");
                 JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(renderRequest, objectName);
                 if(connector == null) {
-                    doList(renderRequest, manager, renderResponse);
+                    doList(renderRequest, managerName, renderResponse);
                 } else {
                     renderRequest.setAttribute("objectName", objectName);
                     renderRequest.setAttribute("port", new Integer(connector.getPort()));
@@ -161,37 +160,37 @@
                     editView.include(renderRequest, renderResponse);
                 }
             } else if(mode.equals("list")) {
-                doList(renderRequest, manager, renderResponse);
+                doList(renderRequest, managerName, renderResponse);
             }
         } catch (Throwable e) {
             log.error("Unable to render portlet", e);
         }
     }
 
-    private void doList(RenderRequest renderRequest, JMSManager container, RenderResponse renderResponse) throws PortletException, IOException {
+    private void doList(RenderRequest renderRequest, String managerName, RenderResponse renderResponse) throws PortletException, IOException {
         List beans = new ArrayList();
-        JMSBroker[] brokers = PortletManager.getJMSBrokers(renderRequest);
-        for (int i = 0; i < brokers.length; i++) {
-            JMSBroker broker = brokers[i];
-            String objectName = ((GeronimoManagedBean)broker).getObjectName();
+        String[] brokerNames = PortletManager.getJMSBrokerNames(renderRequest, managerName);
+        for (int i = 0; i < brokerNames.length; i++) {
+            String brokerName = brokerNames[i];
             try {
-                ObjectName name = ObjectName.getInstance(objectName);
-                String brokerName = name.getKeyProperty("name");
-                JMSConnector[] connectors = PortletManager.getBrokerJMSConnectors(renderRequest, broker);
+                ObjectName bon = ObjectName.getInstance(brokerName);
+                JMSConnector[] connectors = PortletManager.getJMSConnectorsForContainer(renderRequest, managerName, brokerName);
                 for (int j = 0; j < connectors.length; j++) {
                     JMSConnector connector = connectors[j];
                     ObjectName conName = ObjectName.getInstance(((GeronimoManagedBean)connector).getObjectName());
                     String connectorName = conName.getKeyProperty("name");
-                    ConnectorWrapper info = new ConnectorWrapper(brokerName, connectorName, connector);
+                    ConnectorWrapper info = new ConnectorWrapper(bon.getKeyProperty("name"), bon.getCanonicalName(),
+                                                                 connectorName, connector);
                     beans.add(info);
                 }
             } catch (MalformedObjectNameException e) {
                 log.error("Unable to decode ObjectName", e);
             }
         }
-        renderRequest.setAttribute("brokers", getBrokerMap(renderRequest).entrySet());
+        renderRequest.setAttribute("brokers", getBrokerMap(renderRequest, managerName).entrySet());
         renderRequest.setAttribute("connectors", beans);
-        renderRequest.setAttribute("protocols", container.getSupportedProtocols());
+        JMSManager mgr = PortletManager.getJMSManager(renderRequest, managerName);
+        renderRequest.setAttribute("protocols", mgr.getSupportedProtocols());
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
@@ -227,18 +226,20 @@
     }
 
     public static class ConnectorWrapper {
-        private String broker;
+        private String brokerName;
+        private String brokerObjectName;
         private String displayName;
         private JMSConnector connector;
 
-        public ConnectorWrapper(String broker, String displayName, JMSConnector connector) {
-            this.broker = broker;
+        public ConnectorWrapper(String brokerName, String brokerObjectName, String displayName, JMSConnector connector) {
+            this.brokerName = brokerName;
             this.displayName = displayName;
             this.connector = connector;
+            this.brokerObjectName = brokerObjectName;
         }
 
         public String getBrokerName() {
-            return broker;
+            return brokerName;
         }
 
         public String getDisplayName() {
@@ -247,6 +248,10 @@
 
         public JMSConnector getConnector() {
             return connector;
+        }
+
+        public String getBrokerObjectName() {
+            return brokerObjectName;
         }
     }
 }

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=278800&r1=278799&r2=278800&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 Mon Sep  5 10:10:49 2005
@@ -29,11 +29,11 @@
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebConnector;
-import org.apache.geronimo.management.geronimo.EJBContainer;
-import org.apache.geronimo.management.geronimo.EJBConnector;
+import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.JMSManager;
-import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.management.geronimo.JMSConnector;
+import org.apache.geronimo.management.geronimo.WebManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.pool.GeronimoExecutor;
 import org.apache.commons.logging.Log;
@@ -49,9 +49,6 @@
     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 JMS_MANAGER_KEY = "org.apache.geronimo.console.JMSManager";
-    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
@@ -119,100 +116,116 @@
         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 String[] getWebManagerNames(PortletRequest request) {
+        return getCurrentServer(request).getWebManagers();
+    }
+
+    public static WebManager getWebManager(PortletRequest request, String managerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        return (WebManager) helper.getObject(managerObjectName);
+    }
+
+    public static String[] getWebContainerNames(PortletRequest request, String managerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        return manager.getContainers();
+    }
+
+    public static WebContainer getWebContainer(PortletRequest request, String containerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        return (WebContainer) helper.getObject(containerObjectName);
     }
 
-    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);
+    public static WebConnector createWebConnector(PortletRequest request, String managerObjectName, String containerObjectName, String name, String protocol, String host, int port) {
         ManagementHelper helper = getManagementHelper(request);
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        String objectName = manager.addConnector(containerObjectName, name, protocol, host, port);
         return (WebConnector)helper.getObject(objectName);
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request) {
+    public static WebConnector[] getWebConnectors(PortletRequest request, String managerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getWebConnectors(getCurrentWebContainer(request));
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        return helper.getWebConnectors(manager);
     }
 
-    public static WebConnector[] getWebConnectors(PortletRequest request, String protocol) {
+    public static WebConnector[] getWebConnectors(PortletRequest request, String managerObjectName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getWebConnectors(getCurrentWebContainer(request),protocol);
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        return helper.getWebConnectors(manager, 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 WebConnector[] getWebConnectorsForContainer(PortletRequest request, String managerObjectName, String containerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        return helper.getWebConnectorsForContainer(manager, containerObjectName);
     }
 
-    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);
+    public static WebConnector[] getWebConnectorsForContainer(PortletRequest request, String managerObjectName, String containerObjectName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
-        return (EJBConnector)helper.getObject(objectName);
+        WebManager manager = (WebManager) helper.getObject(managerObjectName);
+        return helper.getWebConnectorsForContainer(manager, containerObjectName, protocol);
     }
 
-    public static EJBConnector[] getEJBConnectors(PortletRequest request) {
+    public static EJBManager[] getEJBManagers(PortletRequest request) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getEJBConnectors(getCurrentEJBContainer(request));
+        return helper.getEJBManagers(getCurrentServer(request));
     }
 
-    public static EJBConnector[] getEJBConnectors(PortletRequest request, String protocol) {
+    public static EJBManager getEJBManager(PortletRequest request, String managerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getEJBConnectors(getCurrentEJBContainer(request), protocol);
+        return (EJBManager) helper.getObject(managerObjectName);
     }
 
-    public static JMSManager getCurrentJMSManager(PortletRequest request) {
-        JMSManager manager = (JMSManager) request.getPortletSession(true).getAttribute(JMS_MANAGER_KEY, PortletSession.APPLICATION_SCOPE);
-        if(manager == null) {
-            ManagementHelper helper = getManagementHelper(request);
-            manager = helper.getJMSManager(getCurrentServer(request));
-            request.getPortletSession().setAttribute(JMS_MANAGER_KEY, manager, PortletSession.APPLICATION_SCOPE);
-        }
-        return manager;
+    public static String[] getJMSManagerNames(PortletRequest request) {
+        return getCurrentServer(request).getJMSManagers();
+    }
+
+    public static JMSManager getJMSManager(PortletRequest request, String managerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        return (JMSManager) helper.getObject(managerObjectName);
+    }
+
+    public static String[] getJMSBrokerNames(PortletRequest request, String managerObjectName) {
+        ManagementHelper helper = getManagementHelper(request);
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        return manager.getContainers();
     }
 
-    public static JMSBroker[] getJMSBrokers(PortletRequest request) {
+    public static JMSBroker getJMSBroker(PortletRequest request, String brokerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getJMSBrokers(getCurrentJMSManager(request));
+        return (JMSBroker) helper.getObject(brokerObjectName);
     }
 
-    public static JMSConnector createJMSConnector(PortletRequest request, JMSBroker broker, String name, String protocol, String host, int port) {
-        JMSManager manager = getCurrentJMSManager(request);
-        String objectName = manager.addConnector(((GeronimoManagedBean)broker).getObjectName(), name, protocol, host, port);
+    public static JMSConnector createJMSConnector(PortletRequest request, String managerObjectName, String containerObjectName, String name, String protocol, String host, int port) {
         ManagementHelper helper = getManagementHelper(request);
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        String objectName = manager.addConnector(containerObjectName, name, protocol, host, port);
         return (JMSConnector)helper.getObject(objectName);
     }
 
-    public static JMSConnector[] getJMSConnectors(PortletRequest request) {
+    public static JMSConnector[] getJMSConnectors(PortletRequest request, String managerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getJMSConnectors(getCurrentJMSManager(request));
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        return helper.getJMSConnectors(manager);
     }
 
-    public static JMSConnector[] getJMSConnectors(PortletRequest request, String protocol) {
+    public static JMSConnector[] getJMSConnectors(PortletRequest request, String managerObjectName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getJMSConnectors(getCurrentJMSManager(request), protocol);
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        return helper.getJMSConnectors(manager, protocol);
     }
 
-    public static JMSConnector[] getBrokerJMSConnectors(PortletRequest request, JMSBroker broker) {
+    public static JMSConnector[] getJMSConnectorsForContainer(PortletRequest request, String managerObjectName, String brokerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getJMSConnectors(getCurrentJMSManager(request), broker);
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        return helper.getJMSConnectorsForContainer(manager, brokerObjectName);
     }
 
-    public static JMSConnector[] getBrokerJMSConnectors(PortletRequest request, JMSBroker broker, String protocol) {
+    public static JMSConnector[] getJMSConnectorsForContainer(PortletRequest request, String managerObjectName, String brokerObjectName, String protocol) {
         ManagementHelper helper = getManagementHelper(request);
-        return helper.getJMSConnectors(getCurrentJMSManager(request), broker, protocol);
+        JMSManager manager = (JMSManager) helper.getObject(managerObjectName);
+        return helper.getJMSConnectorsForContainer(manager, brokerObjectName, protocol);
     }
 
     public static GeronimoExecutor[] getThreadPools(PortletRequest request) {

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java Mon Sep  5 10:10:49 2005
@@ -20,12 +20,8 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -39,10 +35,17 @@
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebConnector;
 import org.apache.geronimo.management.geronimo.SecureConnector;
+import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+/**
+ * A portlet that lets you list, add, remove, start, stop, and edit web
+ * connectors (currently, either Tomcat or Jetty).
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
 public class ConnectorPortlet extends BaseWebPortlet {
     private final static Log log = LogFactory.getLog(ConnectorPortlet.class);
 
@@ -58,7 +61,9 @@
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         String mode = actionRequest.getParameter("mode");
-        WebContainer container = PortletManager.getCurrentWebContainer(actionRequest);
+        String managerName = PortletManager.getWebManagerNames(actionRequest)[0];  //todo: handle multiple
+        String containerName = PortletManager.getWebContainerNames(actionRequest, managerName)[0];  //todo: handle multiple
+        WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
         String server = getServerType(container.getClass());
         actionResponse.setRenderParameter("server", server);
         if(mode.equals("new")) {
@@ -76,7 +81,7 @@
             Integer minThreads = getInteger(actionRequest, "minThreads");
             String name = actionRequest.getParameter("name");
             // Create and configure the connector
-            WebConnector connector = PortletManager.createWebConnector(actionRequest, name, protocol, host, port);
+            WebConnector connector = PortletManager.createWebConnector(actionRequest, managerName, containerName, name, protocol, host, port);
             connector.setMaxThreads(maxThreads);
             // todo: more configurable HTTP/Jetty values
             if(server.equals(SERVER_JETTY)) {
@@ -84,7 +89,7 @@
                     setProperty(connector, "minThreads", minThreads);
                 }
             }
-            if(protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+            if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                 String keystoreType = actionRequest.getParameter("keystoreType");
                 String keystoreFile = actionRequest.getParameter("keystoreFile");
                 String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
@@ -120,7 +125,7 @@
             String objectName = actionRequest.getParameter("objectName");
             // Identify and update the connector
             WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest);
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
             for (int i = 0; i < all.length; i++) {
                 WebConnector conn = all[i];
                 if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
@@ -162,7 +167,7 @@
             String objectName = actionRequest.getParameter("name");
             // work with the current connector to start it.
             WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest);
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
             for (int i = 0; i < all.length; i++) {
                 WebConnector conn = all[i];
                 if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
@@ -186,7 +191,7 @@
             String objectName = actionRequest.getParameter("name");
             // work with the current connector to stop it.
             WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(actionRequest);
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
             for (int i = 0; i < all.length; i++) {
                 WebConnector conn = all[i];
                 if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
@@ -213,7 +218,7 @@
 
         } else if(mode.equals("delete")) { // User chose to delete a connector
             String objectName = actionRequest.getParameter("name");
-            PortletManager.getCurrentWebContainer(actionRequest).removeConnector(objectName);
+            PortletManager.getWebManager(actionRequest, managerName).removeConnector(objectName);
             actionResponse.setRenderParameter("mode", "list");
         }
     }
@@ -235,7 +240,9 @@
         if(mode == null || mode.equals("")) {
             mode = "list";
         }
-        WebContainer container = PortletManager.getCurrentWebContainer(renderRequest);
+        String managerName = PortletManager.getWebManagerNames(renderRequest)[0];  //todo: handle multiple
+        String containerName = PortletManager.getWebContainerNames(renderRequest, managerName)[0];  //todo: handle multiple
+        WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
         String server = getServerType(container.getClass());
         renderRequest.setAttribute("server", server);
 
@@ -247,7 +254,7 @@
             }
             renderRequest.setAttribute("protocol", protocol);
             renderRequest.setAttribute("mode", "add");
-            if(protocol.equals(WebContainer.PROTOCOL_HTTPS)) {
+            if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
                 editHttpsView.include(renderRequest, renderResponse);
             } else {
                 editHttpView.include(renderRequest, renderResponse);
@@ -256,7 +263,7 @@
         } else if(mode.equals("edit")) {
             String objectName = renderRequest.getParameter("objectName");
             WebConnector connector = null;
-            WebConnector all[] = PortletManager.getWebConnectors(renderRequest);
+            WebConnector all[] = PortletManager.getWebConnectors(renderRequest, managerName);
             for (int i = 0; i < all.length; i++) {
                 WebConnector conn = all[i];
                 if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
@@ -265,7 +272,7 @@
                 }
             }
             if(connector == null) {
-                doList(renderRequest, container, renderResponse);
+                doList(renderRequest, managerName, renderResponse);
             } else {
                 renderRequest.setAttribute("objectName", objectName);
                 renderRequest.setAttribute("port", new Integer(connector.getPort()));
@@ -289,20 +296,20 @@
                     }
                 }
 
-                if(connector.getProtocol().equals(WebContainer.PROTOCOL_HTTPS)) {
+                if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
                     editHttpsView.include(renderRequest, renderResponse);
                 } else {
                     editHttpView.include(renderRequest, renderResponse);
                 }
             }
         } else if(mode.equals("list")) {
-            doList(renderRequest, container, renderResponse);
+            doList(renderRequest, managerName, renderResponse);
         }
     }
 
-    private void doList(RenderRequest renderRequest, WebContainer container, RenderResponse renderResponse) throws PortletException, IOException {
+    private void doList(RenderRequest renderRequest, String managerName, RenderResponse renderResponse) throws PortletException, IOException {
         List beans = new ArrayList();
-        WebConnector[] connectors = PortletManager.getWebConnectors(renderRequest);
+        WebConnector[] connectors = PortletManager.getWebConnectors(renderRequest, managerName);
         for (int i = 0; i < connectors.length; i++) {
             WebConnector connector = connectors[i];
             ConnectorInfo info = new ConnectorInfo();
@@ -326,7 +333,7 @@
             beans.add(info);
         }
         renderRequest.setAttribute("connectors", beans);
-        renderRequest.setAttribute("protocols", container.getSupportedProtocols());
+        renderRequest.setAttribute("protocols", PortletManager.getWebManager(renderRequest, managerName).getSupportedProtocols());
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);

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=278800&r1=278799&r2=278800&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 Mon Sep  5 10:10:49 2005
@@ -21,7 +21,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.GenericPortlet;
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.PortletRequestDispatcher;
@@ -47,7 +46,9 @@
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         try {
-            WebContainer container = PortletManager.getCurrentWebContainer(actionRequest);
+            String managerName = PortletManager.getWebManagerNames(actionRequest)[0];  //todo: handle multiple
+            String containerName = PortletManager.getWebContainerNames(actionRequest, managerName)[0];  //todo: handle multiple
+            WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
             String server = getServerType(container.getClass());
             String action = actionRequest.getParameter("stats");
             if (action != null) {
@@ -72,7 +73,9 @@
             return;
         }
         try {
-            WebContainer container = PortletManager.getCurrentWebContainer(renderRequest);
+            String managerName = PortletManager.getWebManagerNames(renderRequest)[0];  //todo: handle multiple
+            String containerName = PortletManager.getWebContainerNames(renderRequest, managerName)[0];  //todo: handle multiple
+            WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
             String server = getServerType(container.getClass());
             StatisticsHelper helper = null;
             if(server.equals(SERVER_JETTY)) {

Modified: geronimo/trunk/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/etc/project.properties (original)
+++ geronimo/trunk/etc/project.properties Mon Sep  5 10:10:49 2005
@@ -79,7 +79,7 @@
 # Dependency Versions
 #####################################################
 activeio_version=1.1
-activemq_version=3.1-SNAPSHOT
+activemq_version=3.2-SNAPSHOT
 geronimo_version=1.0-SNAPSHOT
 openejb_version=2.0-SNAPSHOT
 tranql_version=1.1-SNAPSHOT

Modified: geronimo/trunk/modules/assembly/src/plan/jetty-config.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/jetty-config.xml?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/jetty-config.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/jetty-config.xml Mon Sep  5 10:10:49 2005
@@ -1,69 +1 @@
-<!--
-
-    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.
--->
-
-<!-- $Rev: 201775 $ $Date: 2005-06-25 11:59:41 -0600 (Sat, 25 Jun 2005) $ -->
-
-<!--
-Configuration for the main ring of a Geronimo server.
-
-This configuration should contain those services normally provided
-by the server.
--->
-
-<!-- JETTY CONFIGURATION STARTS HERE -->
-
-    <dependency>
-        <uri>geronimo/jars/geronimo-jetty-${geronimo_version}.jar</uri>
-    </dependency>
-
-    <!-- default WAR container using Jetty -->
-    <gbean name="WebContainer" class="org.apache.geronimo.jetty.JettyContainerImpl">
-    </gbean>
-
-    <gbean name="JettyRequestLog" class="org.apache.geronimo.jetty.requestlog.NCSARequestLog">
-        <reference name="JettyContainer"><name>WebContainer</name></reference>
-        <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
-        <attribute name="filename">var/log/jetty_yyyy_mm_dd.log</attribute>
-        <attribute name="logDateFormat">dd/MMM/yyyy:HH:mm:ss ZZZ</attribute>
-        <attribute name="logTimeZone">GMT</attribute>
-    </gbean>
-
-    <gbean name="JettyWebConnector" class="org.apache.geronimo.jetty.connector.HTTPConnector">
-        <attribute name="host">${PlanServerHostname}"</attribute>
-        <attribute name="port">${PlanHTTPPort}</attribute>
-        <reference name="JettyContainer"><name>WebContainer</name></reference>
-        <attribute name="maxThreads">50</attribute>
-        <attribute name="minThreads">10</attribute>
-    </gbean>
-
-    <gbean name="JettySSLConnector" class="org.apache.geronimo.jetty.connector.HTTPSConnector">
-        <attribute name="host">${PlanServerHostname}"</attribute>
-        <attribute name="port">${PlanHTTPSPort}</attribute>
-        <attribute name="keystoreFileName">var/security/keystore</attribute>
-        <attribute name="keystoreType">JKS</attribute>
-        <attribute name="keystorePassword">secret</attribute>
-        <attribute name="keyPassword">secret</attribute>
-        <attribute name="clientAuthRequired">false</attribute>
-        <attribute name="secureProtocol">TLS</attribute>
-        <attribute name="maxThreads">50</attribute>
-        <attribute name="minThreads">10</attribute>
-        <reference name="JettyContainer"><name>WebContainer</name></reference>
-        <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
-    </gbean>
-
-<!-- JETTY CONFIGURATION ENDS HERE -->
-
+<!--

    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.
-->

<!-- $Rev: 201775 $ $Date: 2005-06-25 11:59:41 -0600 (Sat, 25 Jun 2005) $ -->

<!--
Configuration for the main ring of a Geronimo server.

This configuration should contain those services normally provided
by the server.
-->

<!-- JETTY CONFIGURATION STARTS HERE -->

    <dependency>
        <uri>geronimo/jars/geronimo-jetty-${geronimo_version}.jar</uri>
    </depen
 dency>

    <!-- default WAR container using Jetty -->
    <gbean name="JettyWebManager" class="org.apache.geronimo.jetty.JettyManagerImpl">
    </gbean>

    <!-- default WAR container using Jetty -->
    <gbean name="WebContainer" class="org.apache.geronimo.jetty.JettyContainerImpl">
    </gbean>

    <gbean name="JettyRequestLog" class="org.apache.geronimo.jetty.requestlog.NCSARequestLog">
        <reference name="JettyContainer"><name>WebContainer</name></reference>
        <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
        <attribute name="filename">var/log/jetty_yyyy_mm_dd.log</attribute>
        <attribute name="logDateFormat">dd/MMM/yyyy:HH:mm:ss ZZZ</attribute>
        <attribute name="logTimeZone">GMT</attribute>
    </gbean>

    <gbean name="JettyWebConnector" class="org.apache.geronimo.jetty.connector.HTTPConnector">
        <attribute name="host">${PlanServerHostname}"</attribute>
        <attribu
 te name="port">${PlanHTTPPort}</attribute>
        <reference name="JettyContainer"><name>WebContainer</name></reference>
        <attribute name="maxThreads">50</attribute>
        <attribute name="minThreads">10</attribute>
    </gbean>

    <gbean name="JettySSLConnector" class="org.apache.geronimo.jetty.connector.HTTPSConnector">
        <attribute name="host">${PlanServerHostname}"</attribute>
        <attribute name="port">${PlanHTTPSPort}</attribute>
        <attribute name="keystoreFileName">var/security/keystore</attribute>
        <attribute name="keystoreType">JKS</attribute>
        <attribute name="keystorePassword">secret</attribute>
        <attribute name="keyPassword">secret</attribute>
        <attribute name="clientAuthRequired">false</attribute>
        <attribute name="secureProtocol">TLS</attribute>
        <attribute name="maxThreads">50</attribute>
        <attribute name="minThreads">10</attribute>
        <reference name="JettyContainer"><name>WebCo
 ntainer</name></reference>
        <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
    </gbean>

<!-- JETTY CONFIGURATION ENDS HERE -->
\ No newline at end of file

Modified: geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml?rev=278800&r1=278799&r2=278800&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml Mon Sep  5 10:10:49 2005
@@ -1,77 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
--->
-
-<!-- $Rev: 47568 $ $Date: 2004-09-30 01:21:54 -0700 (Thu, 30 Sep 2004) $ -->
-
-<configuration
-    xmlns="http://geronimo.apache.org/xml/ns/deployment"
-    configId="org/apache/geronimo/ActiveMQServer"
-    parentId="org/apache/geronimo/SystemDatabase">    
-
-    <dependency>
-        <uri>activemq/jars/activemq-core-${activemq_version}.jar</uri>
-    </dependency>
-    <dependency>
-        <uri>activemq/jars/activemq-gbean-${activemq_version}.jar</uri>
-    </dependency>
-    <dependency>
-        <uri>activeio/jars/activeio-${activeio_version}.jar</uri>
-    </dependency>
-
-    <!-- management -->
-    <gbean name="ActiveMQ" class="org.activemq.gbean.management.ActiveMQManagerGBean" />
-
-    <!-- message broker -->
-    <gbean name="ActiveMQ" class="org.activemq.gbean.ActiveMQContainerGBean">
-        <attribute name="brokerName">possibly-unique-broker</attribute>
-        <reference name="persistenceAdapter"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.cache,*</gbean-name></reference>
-        <reference name="ConnectorCollection"><gbean-name>geronimo.server:j2eeType=JMSConnector,broker=ActiveMQ,*</gbean-name></reference>
-    </gbean>
-
-    <gbean name="ActiveMQ.cache" class="org.activemq.store.cache.SimpleCachePersistenceAdapterGBean">
-        <attribute name="cacheSize">10000</attribute>
-        <reference name="longTermPersistence"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.journal,*</gbean-name></reference>
-    </gbean>
-
-    <gbean name="ActiveMQ.journal" class="org.activemq.store.journal.JournalPersistenceAdapterGBean">
-        <!--TODO change to ServerInfo -->
-        <reference name="serverInfo"><module>org/apache/geronimo/System</module><type>GBean</type><name>ServerInfo</name></reference>
-        <attribute name="directory">var/activemq/journal</attribute>
-        <attribute name="journalType">default</attribute>
-        <reference name="longTermPersistence"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.jdbc,*</gbean-name></reference>
-    </gbean>
-
-    <gbean name="ActiveMQ.jdbc" class="org.activemq.store.jdbc.JDBCPersistenceAdapterGBean">
-        <reference name="dataSource"><gbean-name>geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=org/apache/geronimo/SystemDatabase,j2eeType=JCAManagedConnectionFactory,name=SystemDatasource</gbean-name></reference>
-    </gbean>
-
-    <gbean gbeanName="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/ActiveMQServer,J2EEServer=geronimo,j2eeType=JMSConnector,broker=ActiveMQ,name=ActiveMQ.tcp.default" class="org.activemq.gbean.ActiveMQConnectorGBean">
-        <attribute name="protocol">tcp</attribute>
-        <attribute name="host">${PlanServerHostname}</attribute>
-        <attribute name="port">${PlanActiveMQPort}</attribute>
-        <reference name="activeMQContainer"><gbean-name>geronimo.server:j2eeType=JMSServer,name=ActiveMQ,*</gbean-name></reference>
-    </gbean>
-
-    <gbean gbeanName="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/ActiveMQServer,J2EEServer=geronimo,j2eeType=JMSConnector,broker=ActiveMQ,name=ActiveMQ.vm.localhost" class="org.activemq.gbean.ActiveMQConnectorGBean">
-        <attribute name="protocol">vm</attribute>
-        <attribute name="host">localhost</attribute>
-        <attribute name="port">-1</attribute>
-        <reference name="activeMQContainer"><gbean-name>geronimo.server:j2eeType=JMSServer,name=ActiveMQ,*</gbean-name></reference>
-    </gbean>    
-
-</configuration>
+<?xml version="1.0" encoding="UTF-8"?>
<!--

    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.
-->

<!-- $Rev: 47568 $ $Date: 2004-09-30 01:21:54 -0700 (Thu, 30 Sep 2004) $ -->

<configuration
    xmlns="http://geronimo.apache.org/xml/ns/deployment"
    configId="org/apache/geronimo/ActiveMQServer"
    parentId="org/apache/geronimo/SystemDatabase">    

    <dependency>
        <uri>activemq/jars/activemq-core-${activemq_vers
 ion}.jar</uri>
    </dependency>
    <dependency>
        <uri>activemq/jars/activemq-gbean-${activemq_version}.jar</uri>
    </dependency>
    <dependency>
        <uri>activeio/jars/activeio-${activeio_version}.jar</uri>
    </dependency>

    <!-- management -->
    <gbean name="ActiveMQ" class="org.activemq.gbean.management.ActiveMQManagerGBean" />

    <!-- message broker -->
    <gbean name="ActiveMQ" class="org.activemq.gbean.ActiveMQContainerGBean">
        <attribute name="brokerName">possibly-unique-broker</attribute>
        <reference name="persistenceAdapter"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.cache,*</gbean-name></reference>
    </gbean>

    <gbean name="ActiveMQ.cache" class="org.activemq.store.cache.SimpleCachePersistenceAdapterGBean">
        <attribute name="cacheSize">10000</attribute>
        <reference name="longTermPersistence"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.journal,*</gbean-name></refer
 ence>
    </gbean>

    <gbean name="ActiveMQ.journal" class="org.activemq.store.journal.JournalPersistenceAdapterGBean">
        <!--TODO change to ServerInfo -->
        <reference name="serverInfo"><module>org/apache/geronimo/System</module><type>GBean</type><name>ServerInfo</name></reference>
        <attribute name="directory">var/activemq/journal</attribute>
        <attribute name="journalType">default</attribute>
        <reference name="longTermPersistence"><gbean-name>geronimo.server:j2eeType=JMSPersistence,name=ActiveMQ.jdbc,*</gbean-name></reference>
    </gbean>

    <gbean name="ActiveMQ.jdbc" class="org.activemq.store.jdbc.JDBCPersistenceAdapterGBean">
        <reference name="dataSource"><gbean-name>geronimo.server:J2EEApplication=null,J2EEServer=geronimo,JCAResource=org/apache/geronimo/SystemDatabase,j2eeType=JCAManagedConnectionFactory,name=SystemDatasource</gbean-name></reference>
    </gbean>

    <gbean gbeanName="geronimo.server:J2EEApplication=null,J2E
 EModule=org/apache/geronimo/ActiveMQServer,J2EEServer=geronimo,j2eeType=JMSConnector,broker=ActiveMQ,name=ActiveMQ.tcp.default" class="org.activemq.gbean.ActiveMQConnectorGBean">
        <attribute name="protocol">tcp</attribute>
        <attribute name="host">${PlanServerHostname}</attribute>
        <attribute name="port">${PlanActiveMQPort}</attribute>
        <reference name="activeMQContainer"><gbean-name>geronimo.server:j2eeType=JMSServer,name=ActiveMQ,*</gbean-name></reference>
    </gbean>

    <gbean gbeanName="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/ActiveMQServer,J2EEServer=geronimo,j2eeType=JMSConnector,broker=ActiveMQ,name=ActiveMQ.vm.localhost" class="org.activemq.gbean.ActiveMQConnectorGBean">
        <attribute name="protocol">vm</attribute>
        <attribute name="host">localhost</attribute>
        <attribute name="port">-1</attribute>
        <reference name="activeMQContainer"><gbean-name>geronimo.server:j2eeType=JMSServer,nam
 e=ActiveMQ,*</gbean-name></reference>
    </gbean>    

</configuration>
\ No newline at end of file



Mime
View raw message