geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r234422 - in /geronimo/trunk: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-framework/src/webapp/WEB-INF/data/ applications/console-standard/src/java/org/apache/geronimo/console/ applications/cons...
Date Mon, 22 Aug 2005 03:26:55 GMT
Author: ammulder
Date: Sun Aug 21 20:26:39 2005
New Revision: 234422

URL: http://svn.apache.org/viewcvs?rev=234422&view=rev
Log:
Add JMS management interfaces
Update to latest ActiveMQ GBean syntax
Add ActiveMQ management interfaces to o/a/g/Server dependencies
Add JMS Server section to web console, with broker/connector management
  features
A few minor fixes to the web server management screens in the console

Added:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/
    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/webapp/WEB-INF/view/jmsmanager/server/
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/help.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/maximized.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/normal.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/help.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/maximized.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/normal.jsp
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSConnector.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.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-framework/src/webapp/WEB-INF/data/pageregistry.xml
    geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.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/BaseWebPortlet.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/applications/console-standard/src/webapp/WEB-INF/portlet.xml
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
    geronimo/trunk/modules/assembly/project.xml
    geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
    geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -28,6 +28,9 @@
 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.JMSManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
+import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.J2EEDomain;
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.AppClientModule;
@@ -316,6 +319,83 @@
             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 JMSManager getJMSManager(J2EEServer server) {
+        JMSManager result = null;
+        try {
+            String name = server.getJMSManager();
+            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
+            result = (JMSManager)temp;
+        } catch (Exception e) {
+            log.error("Unable to look up related GBean", e);
+        }
+        return result;
+    }
+
+    public JMSBroker[] getJMSBrokers(JMSManager manager) {
+        JMSBroker[] result = null;
+        try {
+            String[] names = manager.getBrokers();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSBroker[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 JMSConnector[] getJMSConnectors(JMSManager manager, String protocol) {
+        JMSConnector[] result = null;
+        try {
+            String[] names = manager.getConnectors(protocol);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSConnector[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 JMSConnector[] getJMSConnectors(JMSManager manager) {
+        JMSConnector[] result = null;
+        try {
+            String[] names = manager.getConnectors();
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSConnector[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 JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker, String protocol) {
+        JMSConnector[] result = null;
+        try {
+            String[] names = manager.getBrokerConnectors(pm.getProxyTarget(broker).getCanonicalName(), protocol);
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSConnector[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 JMSConnector[] getJMSConnectors(JMSManager manager, JMSBroker broker) {
+        JMSConnector[] result = null;
+        try {
+            String[] names = manager.getBrokerConnectors(pm.getProxyTarget(broker).getCanonicalName());
+            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
+            result = new JMSConnector[temp.length];
             System.arraycopy(temp, 0, result, 0, temp.length);
         } catch (Exception e) {
             log.error("Unable to look up related GBean", e);

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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -41,6 +41,9 @@
 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.JMSManager;
+import org.apache.geronimo.management.geronimo.JMSConnector;
+import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.pool.GeronimoExecutor;
 
@@ -76,6 +79,12 @@
     EJBContainer getEJBContainer(J2EEServer server);
     EJBConnector[] getEJBConnectors(EJBContainer container, String protocol);
     EJBConnector[] getEJBConnectors(EJBContainer container);
+    JMSManager getJMSManager(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);
     GeronimoExecutor[] getThreadPools(J2EEServer server);
     //todo: repository, embedded database
 

Modified: geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml (original)
+++ geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/pageregistry.xml Sun Aug 21 20:26:39 2005
@@ -143,6 +143,27 @@
             </fragment>
         </fragment>
 
+        <fragment name="jmsserver" type="page">
+            <navigation>
+                <title>JMS Server</title>
+                <description>Configure JMS Server</description>
+            </navigation>
+            <fragment name="row1" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p1" type="portlet">
+                        <property name="portlet" value="5.63"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+            <fragment name="row2" type="row">
+                <fragment name="col1" type="column">
+                    <fragment name="p2" type="portlet">
+                        <property name="portlet" value="5.64"/>
+                    </fragment>
+                </fragment>
+            </fragment>
+        </fragment>
+
         <fragment name="j2ca" type="page">
             <navigation>
                 <title>J2EE Connectors</title>

Modified: geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml (original)
+++ geronimo/trunk/applications/console-framework/src/webapp/WEB-INF/data/portletentityregistry.xml Sun Aug 21 20:26:39 2005
@@ -123,5 +123,12 @@
         <portlet id="62">
             <definition-id>console-standard.Keystore</definition-id>
         </portlet>
+
+        <portlet id="63">
+            <definition-id>console-standard.JMSServerManager</definition-id>
+        </portlet>
+        <portlet id="64">
+            <definition-id>console-standard.JMSConnectorManager</definition-id>
+        </portlet>
     </application>
 </portlet-entity-registry>

Added: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java (added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/BasePortlet.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,92 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console;
+
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import javax.portlet.GenericPortlet;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Superclass with some generic functionality for console portlets
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
+ */
+public class BasePortlet extends GenericPortlet {
+    private final static Log log = LogFactory.getLog(BasePortlet.class);
+
+    public final static void setProperty(Object target, String name, Object value) {
+        boolean found = false;
+        Class cls = target.getClass();
+        String setter = "set"+Character.toUpperCase(name.charAt(0))+name.substring(1);
+        Method[] list = cls.getMethods();
+        for (int i = 0; i < list.length; i++) {
+            Method method = list[i];
+            if(method.getName().equals(setter) && method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers()) &&
+                    !Modifier.isStatic(method.getModifiers())) {
+                found = true;
+                try {
+                    method.invoke(target, new Object[]{value});
+                } catch (Exception e) {
+                    log.error("Unable to set property "+name+" on "+target.getClass().getName());
+                }
+                break;
+            }
+        }
+        if(!found) {
+            throw new IllegalArgumentException("No such method found ("+setter+" on "+target.getClass().getName()+")");
+        }
+    }
+
+    public final static Object getProperty(Object target, String name) {
+        Class cls = target.getClass();
+        String getter = "get"+Character.toUpperCase(name.charAt(0))+name.substring(1);
+        Method[] list = cls.getMethods();
+        for (int i = 0; i < list.length; i++) {
+            Method method = list[i];
+            if(method.getName().equals(getter) && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers()) &&
+                    !Modifier.isStatic(method.getModifiers())) {
+                try {
+                    return method.invoke(target, new Object[0]);
+                } catch (Exception e) {
+                    log.error("Unable to get property "+name+" on "+target.getClass().getName());
+                }
+                break;
+            }
+        }
+        throw new IllegalArgumentException("No such method found ("+getter+" on "+target.getClass().getName()+")");
+    }
+
+    public final static Object callOperation(Object target, String operation, Object[] args) {
+        Class cls = target.getClass();
+        Method[] list = cls.getMethods();
+        for (int i = 0; i < list.length; i++) {
+            Method method = list[i];
+            if(method.getName().equals(operation) && ((args == null && method.getParameterTypes().length == 0) || (args != null && args.length == method.getParameterTypes().length))
+                    && Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers())) {
+                try {
+                    return method.invoke(target, args);
+                } catch (Exception e) {
+                    log.error("Unable to invoke "+operation+" on "+target.getClass().getName());
+                }
+                break;
+            }
+        }
+        throw new IllegalArgumentException("No such method found ("+operation+" on "+target.getClass().getName()+")");
+    }
+}

Added: 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=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java (added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,51 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.server;
+
+import java.util.Map;
+import java.util.LinkedHashMap;
+import javax.portlet.RenderRequest;
+import javax.portlet.PortletException;
+import javax.management.ObjectName;
+import org.apache.geronimo.console.BasePortlet;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
+import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
+
+/**
+ * Common methods for JMS portlets
+ *
+ * @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 {
+        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);
+            }
+        } catch (Exception e) {
+            throw new PortletException(e);
+        }
+        return map;
+    }
+}

Added: 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=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java (added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,121 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.server;
+
+import java.io.IOException;
+import java.util.Map;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.portlet.PortletConfig;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Basic list of JMS brokers
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
+ */
+public class JMSBrokerPortlet extends BaseJMSPortlet {
+    private final static Log log = LogFactory.getLog(JMSBrokerPortlet.class);
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    public void processAction(ActionRequest actionRequest,
+                              ActionResponse actionResponse) throws PortletException, IOException {
+        try {
+            String mode = actionRequest.getParameter("mode");
+            String name = actionRequest.getParameter("objectName");
+            if(mode.equals("start")) {
+                try {
+                    //todo: this only goes into the "starting" state, doesn't make it to "running" -- what's up with that?
+                    PortletManager.getManagedBean(actionRequest, name).startRecursive();
+                } catch (Exception e) {
+                    throw new PortletException(e);
+                }
+            } else if(mode.equals("stop")) {
+                try {
+                    PortletManager.getManagedBean(actionRequest, name).stop();
+                } catch (Exception e) {
+                    throw new PortletException(e);
+                }
+            } else if(mode.equals("edit")) {
+                //todo: is there anything to edit?
+            } else if(mode.equals("delete")) {
+                //todo: add a method to JMSManager to handle this
+            } else if(mode.equals("new")) {
+                //todo: add a method to JMSManager to handle this -- it needs to let you pick a configuration that has ActiveMQ on the path...
+            }
+            actionResponse.setRenderParameter("mode", "list");
+        } catch (Throwable e) {
+            log.error("Unable to process portlet action", e);
+            if(e instanceof PortletException) {
+                throw (PortletException)e;
+            }
+        }
+    }
+
+    protected void doView(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws IOException, PortletException {
+        try {
+            if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+                return;
+            }
+            Map map = getBrokerMap(renderRequest);
+            renderRequest.setAttribute("brokers", map.entrySet());
+            if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+                normalView.include(renderRequest, renderResponse);
+            } else {
+                maximizedView.include(renderRequest, renderResponse);
+            }
+        } catch (Throwable e) {
+            log.error("Unable to render portlet", e);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+
+        normalView = portletConfig.getPortletContext().getRequestDispatcher(
+                "/WEB-INF/view/jmsmanager/server/normal.jsp");
+        maximizedView = portletConfig.getPortletContext().getRequestDispatcher(
+                "/WEB-INF/view/jmsmanager/server/maximized.jsp");
+        helpView = portletConfig.getPortletContext().getRequestDispatcher(
+                "/WEB-INF/view/jmsmanager/server/help.jsp");
+    }
+
+    public void destroy() {
+        helpView = null;
+        normalView = null;
+        maximizedView = null;
+        super.destroy();
+    }
+
+}

Added: 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=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java (added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,252 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.jmsmanager.server;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.ArrayList;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.management.ObjectName;
+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;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * List, edit, add, remove JMS network connectors
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
+ */
+public class JMSConnectorPortlet extends BaseJMSPortlet {
+    private final static Log log = LogFactory.getLog(JMSConnectorPortlet.class);
+
+    private PortletRequestDispatcher normalView;
+
+    private PortletRequestDispatcher maximizedView;
+
+    private PortletRequestDispatcher helpView;
+
+    protected PortletRequestDispatcher editView;
+
+    public void processAction(ActionRequest actionRequest,
+                              ActionResponse actionResponse) throws PortletException, IOException {
+        try {
+            String mode = actionRequest.getParameter("mode");
+            String brokerName = actionRequest.getParameter("brokerName");
+            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);
+                actionResponse.setRenderParameter("brokerName", brokerName);
+            } 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"));
+                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);
+                // Start the connector
+                try {
+                    ((GeronimoManagedBean)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("save")) { // User just submitted the form to update a connector
+                // Get submitted values
+                //todo: lots of validation
+                String host = actionRequest.getParameter("host");
+                int port = Integer.parseInt(actionRequest.getParameter("port"));
+                String objectName = actionRequest.getParameter("objectName");
+                // Identify and update the connector
+                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(actionRequest, objectName);
+                if(connector != null) {
+                    connector.setHost(host);
+                    connector.setPort(port);
+                }
+                actionResponse.setRenderParameter("mode", "list");
+            } else if(mode.equals("start")) {
+                String objectName = actionRequest.getParameter("objectName");
+                try {
+                    PortletManager.getManagedBean(actionRequest, objectName).startRecursive();
+                } catch (Exception e) {
+                    throw new PortletException(e);
+                }
+                actionResponse.setRenderParameter("mode", "list");
+            } else if(mode.equals("stop")) {
+                String objectName = actionRequest.getParameter("objectName");
+                try {
+                    PortletManager.getManagedBean(actionRequest, objectName).stop();
+                } catch (Exception e) {
+                    throw new PortletException(e);
+                }
+                actionResponse.setRenderParameter("mode", "list");
+            } else if(mode.equals("edit")) {
+                String objectName = actionRequest.getParameter("objectName");
+                actionResponse.setRenderParameter("objectName", objectName);
+                actionResponse.setRenderParameter("mode", "edit");
+            } else if(mode.equals("delete")) {
+                String objectName = actionRequest.getParameter("objectName");
+                PortletManager.getCurrentJMSManager(actionRequest).removeConnector(objectName);
+                actionResponse.setRenderParameter("mode", "list");
+            }
+        } catch (Throwable e) {
+            log.error("Unable to process portlet action", e);
+            if(e instanceof PortletException) {
+                throw (PortletException)e;
+            }
+        }
+    }
+
+    protected void doView(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws IOException, PortletException {
+        if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
+            return;
+        }
+
+        try {
+            String mode = renderRequest.getParameter("mode");
+            if(mode == null || mode.equals("")) {
+                mode = "list";
+            }
+            JMSManager manager = PortletManager.getCurrentJMSManager(renderRequest);
+
+            if(mode.equals("new")) {
+                String brokerName = renderRequest.getParameter("brokerName");
+                String protocol = renderRequest.getParameter("protocol");
+                renderRequest.setAttribute("protocol", protocol);
+                renderRequest.setAttribute("brokerName", brokerName);
+                renderRequest.setAttribute("mode", "add");
+                editView.include(renderRequest, renderResponse);
+            } else if(mode.equals("edit")) {
+                String objectName = renderRequest.getParameter("objectName");
+                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(renderRequest, objectName);
+                if(connector == null) {
+                    doList(renderRequest, manager, renderResponse);
+                } else {
+                    renderRequest.setAttribute("objectName", objectName);
+                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
+                    renderRequest.setAttribute("host", connector.getHost());
+                    renderRequest.setAttribute("mode", "save");
+                    editView.include(renderRequest, renderResponse);
+                }
+            } else if(mode.equals("list")) {
+                doList(renderRequest, manager, renderResponse);
+            }
+        } catch (Throwable e) {
+            log.error("Unable to render portlet", e);
+        }
+    }
+
+    private void doList(RenderRequest renderRequest, JMSManager container, 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();
+            try {
+                ObjectName name = ObjectName.getInstance(objectName);
+                String brokerName = name.getKeyProperty("name");
+                JMSConnector[] connectors = PortletManager.getBrokerJMSConnectors(renderRequest, broker);
+                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);
+                    beans.add(info);
+                }
+            } catch (MalformedObjectNameException e) {
+                log.error("Unable to decode ObjectName", e);
+            }
+        }
+        renderRequest.setAttribute("brokers", getBrokerMap(renderRequest).entrySet());
+        renderRequest.setAttribute("connectors", beans);
+        renderRequest.setAttribute("protocols", container.getSupportedProtocols());
+
+        if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
+            normalView.include(renderRequest, renderResponse);
+        } else {
+            maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    protected void doHelp(RenderRequest renderRequest,
+                          RenderResponse renderResponse) throws PortletException, IOException {
+        helpView.include(renderRequest, renderResponse);
+    }
+
+    public void init(PortletConfig portletConfig) throws PortletException {
+        super.init(portletConfig);
+        PortletContext pc = portletConfig.getPortletContext();
+        normalView = pc.getRequestDispatcher("/WEB-INF/view/jmsmanager/server/connector/normal.jsp");
+        maximizedView = pc.getRequestDispatcher("/WEB-INF/view/jmsmanager/server/connector/maximized.jsp");
+        helpView = pc.getRequestDispatcher("/WEB-INF/view/jmsmanager/server/connector/help.jsp");
+        editView = pc.getRequestDispatcher("/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp");
+    }
+
+    public void destroy() {
+        helpView = null;
+        editView = null;
+        normalView = null;
+        maximizedView = null;
+        super.destroy();
+    }
+
+    public final static boolean isValid(String s) {
+        return s != null && !s.equals("");
+    }
+
+    public static class ConnectorWrapper {
+        private String broker;
+        private String displayName;
+        private JMSConnector connector;
+
+        public ConnectorWrapper(String broker, String displayName, JMSConnector connector) {
+            this.broker = broker;
+            this.displayName = displayName;
+            this.connector = connector;
+        }
+
+        public String getBrokerName() {
+            return broker;
+        }
+
+        public String getDisplayName() {
+            return displayName;
+        }
+
+        public JMSConnector getConnector() {
+            return connector;
+        }
+    }
+}

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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -22,6 +22,7 @@
 import javax.naming.NamingException;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.geronimo.management.J2EEDomain;
 import org.apache.geronimo.management.geronimo.JVM;
 import org.apache.geronimo.management.geronimo.J2EEServer;
@@ -29,6 +30,9 @@
 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.JMSManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
+import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.system.logging.SystemLog;
 import org.apache.geronimo.pool.GeronimoExecutor;
 import org.apache.commons.logging.Log;
@@ -45,6 +49,7 @@
     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
@@ -158,6 +163,48 @@
         return helper.getEJBConnectors(getCurrentEJBContainer(request), protocol);
     }
 
+    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 JMSBroker[] getJMSBrokers(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getJMSBrokers(getCurrentJMSManager(request));
+    }
+
+    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);
+        ManagementHelper helper = getManagementHelper(request);
+        return (JMSConnector)helper.getObject(objectName);
+    }
+
+    public static JMSConnector[] getJMSConnectors(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getJMSConnectors(getCurrentJMSManager(request));
+    }
+
+    public static JMSConnector[] getJMSConnectors(PortletRequest request, String protocol) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getJMSConnectors(getCurrentJMSManager(request), protocol);
+    }
+
+    public static JMSConnector[] getBrokerJMSConnectors(PortletRequest request, JMSBroker broker) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getJMSConnectors(getCurrentJMSManager(request), broker);
+    }
+
+    public static JMSConnector[] getBrokerJMSConnectors(PortletRequest request, JMSBroker broker, String protocol) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getJMSConnectors(getCurrentJMSManager(request), broker, protocol);
+    }
+
     public static GeronimoExecutor[] getThreadPools(PortletRequest request) {
         ManagementHelper helper = getManagementHelper(request);
         return helper.getThreadPools(getCurrentServer(request));
@@ -176,5 +223,10 @@
             request.getPortletSession().setAttribute(SYSTEM_LOG_KEY, log, PortletSession.APPLICATION_SCOPE);
         }
         return log;
+    }
+
+    public static GeronimoManagedBean getManagedBean(PortletRequest request, String name) {
+        ManagementHelper helper = getManagementHelper(request);
+        return (GeronimoManagedBean) helper.getObject(name);
     }
 }

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/BaseWebPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/BaseWebPortlet.java?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/BaseWebPortlet.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/BaseWebPortlet.java Sun Aug 21 20:26:39 2005
@@ -1,3 +1,19 @@
+/**
+ *
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
 package org.apache.geronimo.console.webmanager;
 
 import java.lang.reflect.Method;
@@ -5,11 +21,14 @@
 import javax.portlet.GenericPortlet;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.console.BasePortlet;
 
 /**
- * @version $Revision: 1.0$
+ * Superclass for web container related portlets
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
  */
-public class BaseWebPortlet extends GenericPortlet {
+public class BaseWebPortlet extends BasePortlet {
     private final static Log log = LogFactory.getLog(BaseWebPortlet.class);
     protected final static String SERVER_JETTY = "jetty";
     protected final static String SERVER_TOMCAT = "tomcat";
@@ -28,63 +47,4 @@
         return SERVER_GENERIC;
     }
 
-    public final static void setProperty(Object target, String name, Object value) {
-        boolean found = false;
-        Class cls = target.getClass();
-        String setter = "set"+Character.toUpperCase(name.charAt(0))+name.substring(1);
-        Method[] list = cls.getMethods();
-        for (int i = 0; i < list.length; i++) {
-            Method method = list[i];
-            if(method.getName().equals(setter) && method.getParameterTypes().length == 1 && Modifier.isPublic(method.getModifiers()) &&
-                    !Modifier.isStatic(method.getModifiers())) {
-                found = true;
-                try {
-                    method.invoke(target, new Object[]{value});
-                } catch (Exception e) {
-                    log.error("Unable to set property "+name+" on "+target.getClass().getName());
-                }
-                break;
-            }
-        }
-        if(!found) {
-            throw new IllegalArgumentException("No such method found ("+setter+" on "+target.getClass().getName()+")");
-        }
-    }
-
-    public final static Object getProperty(Object target, String name) {
-        Class cls = target.getClass();
-        String getter = "get"+Character.toUpperCase(name.charAt(0))+name.substring(1);
-        Method[] list = cls.getMethods();
-        for (int i = 0; i < list.length; i++) {
-            Method method = list[i];
-            if(method.getName().equals(getter) && method.getParameterTypes().length == 0 && Modifier.isPublic(method.getModifiers()) &&
-                    !Modifier.isStatic(method.getModifiers())) {
-                try {
-                    return method.invoke(target, new Object[0]);
-                } catch (Exception e) {
-                    log.error("Unable to get property "+name+" on "+target.getClass().getName());
-                }
-                break;
-            }
-        }
-        throw new IllegalArgumentException("No such method found ("+getter+" on "+target.getClass().getName()+")");
-    }
-
-    public final static Object callOperation(Object target, String operation, Object[] args) {
-        Class cls = target.getClass();
-        Method[] list = cls.getMethods();
-        for (int i = 0; i < list.length; i++) {
-            Method method = list[i];
-            if(method.getName().equals(operation) && ((args == null && method.getParameterTypes().length == 0) || (args != null && args.length == method.getParameterTypes().length))
-                    && Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers())) {
-                try {
-                    return method.invoke(target, args);
-                } catch (Exception e) {
-                    log.error("Unable to invoke "+operation+" on "+target.getClass().getName());
-                }
-                break;
-            }
-        }
-        throw new IllegalArgumentException("No such method found ("+operation+" on "+target.getClass().getName()+")");
-    }
 }

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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -353,6 +353,9 @@
     public void destroy() {
         normalView = null;
         maximizedView = null;
+        helpView = null;
+        editHttpsView = null;
+        editHttpView = null;
         super.destroy();
     }
 

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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -32,6 +32,11 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.management.geronimo.WebContainer;
 
+/**
+ * Basic portlet showing statistics for a web container
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
+ */
 public class WebManagerPortlet extends BaseWebPortlet {
     private PortletRequestDispatcher normalView;
 
@@ -105,6 +110,7 @@
     }
 
     public void destroy() {
+        helpView = null;
         normalView = null;
         maximizedView = 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=234422&r1=234421&r2=234422&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 Sun Aug 21 20:26:39 2005
@@ -215,7 +215,7 @@
             <keywords>Web Servers</keywords>
         </portlet-info>
     </portlet>
-
+<!--
     <portlet>
         <description>Portlet for managing HTTP connectors</description>
         <portlet-name>HTTPConnectorManager</portlet-name>
@@ -263,7 +263,7 @@
             <keywords>HTTPS Connectors</keywords>
         </portlet-info>
     </portlet>
-
+-->
     <portlet>
         <description>Portlet for managing Network Listeners</description>
         <portlet-name>ConnectorManager</portlet-name>
@@ -309,6 +309,54 @@
             <title>EJB Server</title>
             <short-title>EJB Server</short-title>
             <keywords>EJB Server</keywords>
+        </portlet-info>
+    </portlet>
+
+    <portlet>
+        <description>Portlet for managing the JMS server</description>
+        <portlet-name>JMSServerManager</portlet-name>
+        <display-name>JMS Server Mangement Portlet</display-name>
+
+        <portlet-class>org.apache.geronimo.console.jmsmanager.server.JMSBrokerPortlet</portlet-class>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>
+
+        <portlet-info>
+            <title>JMS Server Manager</title>
+            <short-title>JMS Servers</short-title>
+            <keywords>JMS Servers</keywords>
+        </portlet-info>
+    </portlet>
+
+    <portlet>
+        <description>Portlet for managing JMS network listeners</description>
+        <portlet-name>JMSConnectorManager</portlet-name>
+        <display-name>JMS Network Listener Portlet</display-name>
+
+        <portlet-class>org.apache.geronimo.console.jmsmanager.server.JMSConnectorPortlet</portlet-class>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>VIEW</portlet-mode>
+            <portlet-mode>HELP</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>
+
+        <portlet-info>
+            <title>JMS Network Listeners</title>
+            <short-title>JMS Listeners</short-title>
+            <keywords>JMS Network Listeners Connectors</keywords>
         </portlet-info>
     </portlet>
 

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/editGeneric.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1,60 @@
+<%@ 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}">
+<c:choose>
+<c:when test="${mode eq 'save'}">
+  <input type="hidden" name="objectName" value="${objectName}">
+</c:when>
+<c:otherwise>
+  <input type="hidden" name="brokerName" value="${brokerName}">
+</c:otherwise>
+</c:choose>
+<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 JMS 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>
+<!-- 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 JMS connectors</a>
\ No newline at end of file

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/help.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/help.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/help.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/help.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1,2 @@
+<p>Shows all the network connectors configured for the currently available JMS brokers.
+Lets you start, stop, add, remove, and edit JMS network connectors.</p>
\ No newline at end of file

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/maximized.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/maximized.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/maximized.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/maximized.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1 @@
+<%@ include file="normal.jsp" %>
\ No newline at end of file

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/normal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/normal.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/normal.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/connector/normal.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1,68 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+
+<p>Currently available JMS network connectors:</p>
+
+<!-- Show existing connectors -->
+<c:if test="${empty(connectors)}">There are no JMS network connectors defined</c:if>
+<c:if test="${!empty(connectors)}">
+<table width="100%">
+  <tr>
+    <td style="padding: 0 20px">
+          <tr>
+            <td class="DarkBackground">Name</td>
+            <td class="DarkBackground" align="center">Broker</td>
+            <td class="DarkBackground" align="center">Protocol</td>
+            <td class="DarkBackground" align="center">Port</td>
+            <td class="DarkBackground" align="center">State</td>
+            <td class="DarkBackground" align="center">Actions</td>
+          </tr>
+<c:forEach var="info" items="${connectors}">
+          <tr>
+            <td>${info.displayName}</td>
+            <td>${info.brokerName}</td>
+            <td>${info.connector.protocol}</td>
+            <td>${info.connector.port}</td>
+            <td>${info.connector.stateInstance}</td>
+            <td>
+             <c:choose>
+               <c:when test="${info.connector.stateInstance.name eq 'running'}">
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="stop" />
+                 <portlet:param name="objectName" value="${info.connector.objectName}" />
+               </portlet:actionURL>">stop</a>
+               </c:when>
+               <c:otherwise>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="start" />
+                 <portlet:param name="objectName" value="${info.connector.objectName}" />
+               </portlet:actionURL>">start</a>
+               </c:otherwise>
+             </c:choose>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="edit" />
+                 <portlet:param name="objectName" value="${info.connector.objectName}" />
+               </portlet:actionURL>">edit</a>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="delete" />
+                 <portlet:param name="objectName" value="${info.connector.objectName}" />
+               </portlet:actionURL>">delete</a>
+             </td>
+          </tr>
+</c:forEach>
+</table>
+</c:if>
+
+<!-- Links to add new connectors -->
+<c:forEach var="entry" items="${brokers}">
+<p>Add connector to ${entry.key}:</p>
+<ul>
+<c:forEach var="protocol" items="${protocols}">
+<li><a href="<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="new" />
+           <portlet:param name="brokerName" value="${entry.value.objectName}" />
+           <portlet:param name="protocol" value="${protocol}" />
+         </portlet:actionURL>">Add new <b>${protocol}</b> listener</a></li>
+</c:forEach>
+</c:forEach>
\ No newline at end of file

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/help.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/help.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/help.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/help.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1,2 @@
+<p>Shows the available JMS brokers</p>
+<p>&nbsp;</p>

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/maximized.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/maximized.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/maximized.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/maximized.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1 @@
+<%@ include file="normal.jsp" %>
\ No newline at end of file

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/normal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/normal.jsp?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/normal.jsp (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/jmsmanager/server/normal.jsp Sun Aug 21 20:26:39 2005
@@ -0,0 +1,53 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+
+<p>The JMS brokers available in the server are:</p>
+
+<!-- Show existing connectors -->
+<c:if test="${empty(brokers)}">There are no JMS brokers defined</c:if>
+<c:if test="${!empty(brokers)}">
+<table width="100%">
+  <tr><td style="padding: 0 20px"></td></tr>
+          <tr>
+            <td class="DarkBackground">Name</td>
+            <td class="DarkBackground" align="center">State</td>
+            <td class="DarkBackground" align="center">Actions</td>
+          </tr>
+<c:forEach var="entry" items="${brokers}">
+          <tr>
+            <td>${entry.key}</td>
+            <td>${entry.value.stateInstance}</td>
+            <td>
+             <c:choose>
+               <c:when test="${entry.value.stateInstance.name eq 'running'}">
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="stop" />
+                 <portlet:param name="objectName" value="${entry.value.objectName}" />
+               </portlet:actionURL>">stop</a>
+               </c:when>
+               <c:otherwise>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="start" />
+                 <portlet:param name="objectName" value="${entry.value.objectName}" />
+               </portlet:actionURL>">start</a>
+               </c:otherwise>
+             </c:choose>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="edit" />
+                 <portlet:param name="objectName" value="${entry.value.objectName}" />
+               </portlet:actionURL>">edit</a>
+               <a href="<portlet:actionURL portletMode="view">
+                 <portlet:param name="mode" value="delete" />
+                 <portlet:param name="objectName" value="${entry.value.objectName}" />
+               </portlet:actionURL>">delete</a>
+             </td>
+          </tr>
+</c:forEach>
+</table>
+</c:if>
+
+<br />
+<a href="<portlet:actionURL portletMode="view">
+           <portlet:param name="mode" value="new" />
+         </portlet:actionURL>">Add new JMS Broker</a>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp Sun Aug 21 20:26:39 2005
@@ -2,9 +2,6 @@
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
-<p>There are still updates necessary to this portlet --
-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)}">
@@ -12,13 +9,12 @@
   <tr>
     <td style="padding: 0 20px">
           <tr>
-            <td class="DarkBackground">Name
-            <td class="DarkBackground" align="center">Protocol
-            <td class="DarkBackground" align="center">Port
-            <td class="DarkBackground" align="center">State
-            <td class="DarkBackground" align="center">Actions
-            <td class="DarkBackground" align="center">Type
-            </td>
+            <td class="DarkBackground">Name</td>
+            <td class="DarkBackground" align="center">Protocol</td>
+            <td class="DarkBackground" align="center">Port</td>
+            <td class="DarkBackground" align="center">State</td>
+            <td class="DarkBackground" align="center">Actions</td>
+            <td class="DarkBackground" align="center">Type</td>
           </tr>
 <c:forEach var="info" items="${connectors}">
           <tr>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml Sun Aug 21 20:26:39 2005
@@ -485,6 +485,7 @@
             <param-value>console-standard.WebServerManager</param-value>
         </init-param>
     </servlet>
+    <!--
     <servlet>
         <description>Automated generated Portlet Wrapper</description>
         <display-name>Pluto Wrapper for HTTP Connector Management Portlet</display-name>
@@ -513,6 +514,7 @@
             <param-value>console-standard.HTTPSConnectorManager</param-value>
         </init-param>
     </servlet>
+-->
     <servlet>
         <description>Automated generated Portlet Wrapper</description>
         <display-name>Pluto Wrapper for Connector Management Portlet</display-name>
@@ -527,6 +529,37 @@
             <param-value>console-standard.ConnectorManager</param-value>
         </init-param>
     </servlet>
+    <!-- JMS Server Manager Portlet -->
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for JMS Server Management Portlet</display-name>
+        <servlet-name>JMSServerManager</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.jmsmanager.server.JMSBrokerPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.JMSServerManager</param-value>
+        </init-param>
+    </servlet>
+    <servlet>
+        <description>Automated generated Portlet Wrapper</description>
+        <display-name>Pluto Wrapper for JMS Connector Management Portlet</display-name>
+        <servlet-name>JMSConnectorManager</servlet-name>
+        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
+        <init-param>
+            <param-name>portlet-class</param-name>
+            <param-value>org.apache.geronimo.console.jmsmanager.server.JMSConnectorPortlet</param-value>
+        </init-param>
+        <init-param>
+            <param-name>portlet-guid</param-name>
+            <param-value>console-standard.JMSConnectorManager</param-value>
+        </init-param>
+    </servlet>
+
+
     <servlet>
         <description>Automated generated Portlet Wrapper</description>
         <display-name>Pluto Wrapper for JNDI Portlet</display-name>
@@ -569,7 +602,7 @@
             <param-value>console-standard.ServerManager</param-value>
         </init-param>
     </servlet>
- 
+
     <!-- DB manager servlets -->
     <servlet>
         <description>Automated generated Portlet Wrapper</description>
@@ -759,6 +792,7 @@
         <servlet-name>WebServerManager</servlet-name>
         <url-pattern>/WebServerManager/*</url-pattern>
     </servlet-mapping>
+<!--
     <servlet-mapping>
         <servlet-name>HTTPConnectorManager</servlet-name>
         <url-pattern>/HTTPConnectorManager/*</url-pattern>
@@ -767,9 +801,18 @@
         <servlet-name>HTTPSConnectorManager</servlet-name>
         <url-pattern>/HTTPSConnectorManager/*</url-pattern>
     </servlet-mapping>
+-->
     <servlet-mapping>
         <servlet-name>ConnectorManager</servlet-name>
         <url-pattern>/ConnectorManager/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>JMSServerManager</servlet-name>
+        <url-pattern>/JMSServerManager/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>JMSConnectorManager</servlet-name>
+        <url-pattern>/JMSConnectorManager/*</url-pattern>
     </servlet-mapping>
     <servlet-mapping>
         <servlet-name>JNDI</servlet-name>

Modified: geronimo/trunk/modules/assembly/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/project.xml?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/project.xml (original)
+++ geronimo/trunk/modules/assembly/project.xml Sun Aug 21 20:26:39 2005
@@ -569,6 +569,14 @@
         </dependency>
         <dependency>
             <groupId>activemq</groupId>
+            <artifactId>activemq-gbean-management</artifactId>
+            <version>${activemq_version}</version>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>activemq</groupId>
             <artifactId>activemq-ra</artifactId>
             <version>${activemq_version}</version>
             <type>rar</type>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml Sun Aug 21 20:26:39 2005
@@ -124,6 +124,9 @@
         <uri>geronimo/jars/geronimo-servicemix-${geronimo_version}.jar</uri>
     </dependency>
 
+    <dependency>
+        <uri>activemq/jars/activemq-gbean-management-${activemq_version}.jar</uri>
+    </dependency>
 
     ${webcontainer}
 

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=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/system-activemq-plan.xml Sun Aug 21 20:26:39 2005
@@ -33,10 +33,14 @@
         <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">
@@ -56,13 +60,17 @@
         <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 name="ActiveMQ.tcp.${PlanServerHostname}.${PlanActiveMQPort}" class="org.activemq.gbean.ActiveMQConnectorGBean">
-        <attribute name="url">tcp://${PlanServerHostname}:${PlanActiveMQPort}</attribute>
+    <gbean gbeanName="geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/ActiveMQServer,J2EEServer=geronimo,j2eeType=JMSConnector,broker=ActiveMQ,name=ActiveMQ.tcp.${PlanServerHostname}.${PlanActiveMQPort}" 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 name="ActiveMQ.vm.localhost" class="org.activemq.gbean.ActiveMQConnectorGBean">
-        <attribute name="url">vm://localhost</attribute>
+    <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>    
 

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java Sun Aug 21 20:26:39 2005
@@ -32,6 +32,7 @@
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.EJBContainer;
+import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.pool.GeronimoExecutor;
 
 /**
@@ -124,6 +125,16 @@
 
     public String getEJBContainer() {
         GBeanQuery query = new GBeanQuery(null, EJBContainer.class.getName());
+        Set set = kernel.listGBeans(query);
+        if(set.size() == 0) {
+            return null;
+        } else { // ignore possibility of multiple results
+            return ((ObjectName)set.iterator().next()).getCanonicalName();
+        }
+    }
+
+    public String getJMSManager() {
+        GBeanQuery query = new GBeanQuery(null, JMSManager.class.getName());
         Set set = kernel.listGBeans(query);
         if(set.size() == 0) {
             return null;

Modified: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java?rev=234422&r1=234421&r2=234422&view=diff
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java (original)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java Sun Aug 21 20:26:39 2005
@@ -42,6 +42,15 @@
     public String getEJBContainer();
 
     /**
+     * Gets the ObjectName of the JMS Manager associated with this
+     * J2EEServer, or null if there is none in the current server
+     * configuration.
+     *
+     * @return The ObjectName of the JMS Manager, in String form.
+     */
+    public String getJMSManager();
+
+    /**
      * Gets the ObjectNames of the thread pools associated with this
      * J2EEServer.
      *

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,33 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.management.geronimo;
+
+/**
+ * Represents a JMS broker
+ *
+ * @version $Rev: 233346 $ $Date: 2005-08-18 14:08:26 -0400 (Thu, 18 Aug 2005) $
+ */
+public interface JMSBroker {
+    /**
+     * Gets the ObjectNames of the network connectors associated with this
+     * JMS broker.
+     *
+     * @return The ObjectNames of the thread pools, in String form.
+     */
+    public String[] getConnectors();
+
+}

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSConnector.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSConnector.java?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSConnector.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSConnector.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,25 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.management.geronimo;
+
+/**
+ * Represents a JMS connector
+ *
+ * @version $Rev: 233346 $ $Date: 2005-08-18 14:08:26 -0400 (Thu, 18 Aug 2005) $
+ */
+public interface JMSConnector extends NetworkConnector {
+}

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java?rev=234422&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java Sun Aug 21 20:26:39 2005
@@ -0,0 +1,51 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.management.geronimo;
+
+/**
+ * Main entry point for managing a certain JMS server implementation
+ *
+ * @version $Rev: 46228 $ $Date: 2004-09-16 21:21:04 -0400 (Thu, 16 Sep 2004) $
+ */
+public interface JMSManager extends NetworkContainer {
+    /**
+     * Gets the ObjectNames of any JMS servers/brokers running in the current
+     * Geronimo instance.
+     */
+    public String[] getBrokers();
+
+    /**
+     * Gets the ObjectNames of any existing connectors for the specified
+     * protocol associated with the specified broker.
+     *
+     * @param protocol A protocol as returned by getSupportedProtocols
+     */
+    public String[] getBrokerConnectors(String brokerObjectName, String protocol);
+
+    /**
+     * Gets the ObjectNames of any existing connectors associated with the
+     * specified broker.
+     */
+    public String[] getBrokerConnectors(String brokerObjectName);
+
+    /**
+     * Creates a new connector, and returns the ObjectName for it.  Note that
+     * the connector may well require further customization before being fully
+     * functional (e.g. SSL settings for a secure connector).
+     */
+    public String addConnector(String broker, String uniqueName, String protocol, String host, int port);
+}



Mime
View raw message