geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r344897 [1/2] - in /geronimo/trunk: applications/console-standard/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ applications/console-standard/src/webapp/WEB-INF/vie...
Date Wed, 16 Nov 2005 05:41:58 GMT
Author: ammulder
Date: Tue Nov 15 21:41:39 2005
New Revision: 344897

URL: http://svn.apache.org/viewcvs?rev=344897&view=rev
Log:
Fix adding and removing GBeans for a configuration
 - add new EditableConfigurationManager with key calls for this
 - update WebManagers to use it
 - GERONIMO-1070
Add explicits support for the AttributeStore to set the load flag
  for an individual GBean.
Show and edit connectors for all available containers
 - GERONIMO-1152

Added:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java   (with props)
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManagerImpl.java   (with props)
Modified:
    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/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/normal.jsp
    geronimo/trunk/modules/assembly/src/plan/system-plan.xml
    geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml
    geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
    geronimo/trunk/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java

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=344897&r1=344896&r2=344897&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 Tue Nov 15 21:41:39 2005
@@ -205,6 +205,11 @@
         return getCurrentServer(request).getWebManagers();
     }
 
+    public static WebManager[] getWebManagers(PortletRequest request) {
+        ManagementHelper helper = getManagementHelper(request);
+        return helper.getWebManagers(getCurrentServer(request));
+    }
+
     public static WebManager getWebManager(PortletRequest request, String managerObjectName) {
         ManagementHelper helper = getManagementHelper(request);
         return (WebManager) helper.getObject(managerObjectName);

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=344897&r1=344896&r2=344897&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 Tue Nov 15 21:41:39 2005
@@ -38,6 +38,7 @@
 import org.apache.geronimo.management.geronimo.SecureConnector;
 import org.apache.geronimo.management.geronimo.WebManager;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -62,37 +63,100 @@
     public void processAction(ActionRequest actionRequest,
             ActionResponse actionResponse) throws PortletException, IOException {
         String mode = actionRequest.getParameter("mode");
-        String[] names = PortletManager.getWebManagerNames(actionRequest);  //todo: handle multiple
-        if (names != null) {
-            String managerName = names[0];  //todo: handle multiple
-            String[] containers = PortletManager.getWebContainerNames(actionRequest, managerName);  //todo: handle multiple
-            if (containers != null) {
-                String containerName = containers[0];  //todo: handle multiple
-                WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
-                String server = getWebServerType(container.getClass());
-                actionResponse.setRenderParameter("server", server);
-                if(mode.equals("new")) {
-                    // User selected to add a new connector, need to show criteria portlet
-                    actionResponse.setRenderParameter("mode", "new");
-                    String protocol = actionRequest.getParameter("protocol");
-                    actionResponse.setRenderParameter("protocol", protocol);
-                } else if(mode.equals("add")) { // User just submitted the form to add a new connector
-                    // Get submitted values
-                    //todo: lots of validation
-                    String protocol = actionRequest.getParameter("protocol");
-                    String host = actionRequest.getParameter("host");
-                    int port = Integer.parseInt(actionRequest.getParameter("port"));
-                    int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
-                    Integer minThreads = getInteger(actionRequest, "minThreads");
-                    String name = actionRequest.getParameter("name");
-                    // Create and configure the connector
-                    WebConnector connector = PortletManager.createWebConnector(actionRequest, managerName, containerName, name, protocol, host, port);
-                    connector.setMaxThreads(maxThreads);
-                    // todo: more configurable HTTP/Jetty values
-                    if(server.equals(WEB_SERVER_JETTY)) {
-                        if(minThreads != null) {
-                            setProperty(connector, "minThreads", minThreads);
-                        }
+        String managerName = actionRequest.getParameter("managerObjectName");
+        String containerName = actionRequest.getParameter("containerObjectName");
+        actionResponse.setRenderParameter("managerObjectName", managerName);
+        actionResponse.setRenderParameter("containerObjectName", containerName);
+
+        WebContainer container = PortletManager.getWebContainer(actionRequest, containerName);
+        String server = getWebServerType(container.getClass());
+        actionResponse.setRenderParameter("server", server);
+        if(mode.equals("new")) {
+            // User selected to add a new connector, need to show criteria portlet
+            actionResponse.setRenderParameter("mode", "new");
+            String protocol = actionRequest.getParameter("protocol");
+            actionResponse.setRenderParameter("protocol", protocol);
+        } else if(mode.equals("add")) { // User just submitted the form to add a new connector
+            // Get submitted values
+            //todo: lots of validation
+            String protocol = actionRequest.getParameter("protocol");
+            String host = actionRequest.getParameter("host");
+            int port = Integer.parseInt(actionRequest.getParameter("port"));
+            int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
+            Integer minThreads = getInteger(actionRequest, "minThreads");
+            String name = actionRequest.getParameter("name");
+            // Create and configure the connector
+            WebConnector connector = PortletManager.createWebConnector(actionRequest, managerName, containerName, name, protocol, host, port);
+            connector.setMaxThreads(maxThreads);
+            // todo: more configurable HTTP/Jetty values
+            if(server.equals(WEB_SERVER_JETTY)) {
+                if(minThreads != null) {
+                    setProperty(connector, "minThreads", minThreads);
+                }
+            }
+            else if (server.equals(WEB_SERVER_TOMCAT)) {
+                //todo:   Any Tomcat specific processing?
+            }
+            else {
+                //todo:   Handle "should not occur" condition
+            }
+            if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
+                String keystoreType = actionRequest.getParameter("keystoreType");
+                String keystoreFile = actionRequest.getParameter("keystoreFile");
+                String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
+                String keystorePass = actionRequest.getParameter("keystorePassword");
+                String secureProtocol = actionRequest.getParameter("secureProtocol");
+                String algorithm = actionRequest.getParameter("algorithm");
+                boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
+                SecureConnector secure = (SecureConnector) connector;
+                if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
+                if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
+                if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
+                if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
+                if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
+                secure.setClientAuthRequired(clientAuth);
+                if(server.equals(WEB_SERVER_JETTY)) {
+                    if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
+                }
+                else if (server.equals(WEB_SERVER_TOMCAT)) {
+                    //todo:   Any Tomcat specific processing?
+                }
+                else {
+                    //todo:   Handle "should not occur" condition
+                }
+            }
+            // 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"));
+            int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
+            Integer minThreads = getInteger(actionRequest, "minThreads");
+            String objectName = actionRequest.getParameter("objectName");
+            // Identify and update the connector
+            WebConnector connector = null;
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+            for (int i = 0; i < all.length; i++) {
+                WebConnector conn = all[i];
+                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                    connector = conn;
+                    break;
+                }
+            }
+            if(connector != null) {
+                connector.setHost(host);
+                connector.setPort(port);
+                connector.setMaxThreads(maxThreads);
+                if(server.equals(WEB_SERVER_JETTY)) {
+                    if(minThreads != null) {
+                        setProperty(connector,"minThreads",minThreads);
                     }
                     else if (server.equals(WEB_SERVER_TOMCAT)) {
                         //todo:   Any Tomcat specific processing?
@@ -100,163 +164,91 @@
                     else {
                         //todo:   Handle "should not occur" condition
                     }
-                    if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
-                        String keystoreType = actionRequest.getParameter("keystoreType");
-                        String keystoreFile = actionRequest.getParameter("keystoreFile");
-                        String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
-                        String keystorePass = actionRequest.getParameter("keystorePassword");
-                        String secureProtocol = actionRequest.getParameter("secureProtocol");
-                        String algorithm = actionRequest.getParameter("algorithm");
-                        boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                        SecureConnector secure = (SecureConnector) connector;
-                        if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
-                        if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
-                        if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
-                        if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
-                        if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
-                        secure.setClientAuthRequired(clientAuth);
-                        if(server.equals(WEB_SERVER_JETTY)) {
-                            if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
-                        }
-                        else if (server.equals(WEB_SERVER_TOMCAT)) {
-                            //todo:   Any Tomcat specific processing?
-                        }
-                        else {
-                            //todo:   Handle "should not occur" condition
-                        }
-                    }
-                    // 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"));
-                    int maxThreads = Integer.parseInt(actionRequest.getParameter("maxThreads"));
-                    Integer minThreads = getInteger(actionRequest, "minThreads");
-                    String objectName = actionRequest.getParameter("objectName");
-                    // Identify and update the connector
-                    WebConnector connector = null;
-                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-                    for (int i = 0; i < all.length; i++) {
-                        WebConnector conn = all[i];
-                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                            connector = conn;
-                            break;
-                        }
-                    }
-                    if(connector != null) {
-                        connector.setHost(host);
-                        connector.setPort(port);
-                        connector.setMaxThreads(maxThreads);
-                        if(server.equals(WEB_SERVER_JETTY)) {
-                            if(minThreads != null) {
-                                setProperty(connector,"minThreads",minThreads);
-                            }
-                            else if (server.equals(WEB_SERVER_TOMCAT)) {
-                                //todo:   Any Tomcat specific processing?
-                            }
-                            else {
-                                //todo:   Handle "should not occur" condition
-                            }
-                        }
-                        if(connector instanceof SecureConnector) {
-                            String keystoreType = actionRequest.getParameter("keystoreType");
-                            String keystoreFile = actionRequest.getParameter("keystoreFile");
-                            String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
-                            String keystorePass = actionRequest.getParameter("keystorePassword");
-                            String secureProtocol = actionRequest.getParameter("secureProtocol");
-                            String algorithm = actionRequest.getParameter("algorithm");
-                            boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
-                            SecureConnector secure = (SecureConnector) connector;
-                            if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
-                            if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
-                            if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
-                            if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
-                            if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
-                            secure.setClientAuthRequired(clientAuth);
-                            if(server.equals(WEB_SERVER_JETTY)) {
-                                if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
-                            }
-                            else if (server.equals(WEB_SERVER_TOMCAT)) {
-                                //todo:   Any Tomcat specific processing?
-                            }
-                            else {
-                                //todo:   Handle "should not occur" condition
-                            }
-                        }
-                    }
-                    actionResponse.setRenderParameter("mode", "list");
-                } else if(mode.equals("start")) {
-                    String objectName = actionRequest.getParameter("name");
-                    // work with the current connector to start it.
-                    WebConnector connector = null;
-                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-                    for (int i = 0; i < all.length; i++) {
-                        WebConnector conn = all[i];
-                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                            connector = conn;
-                            break;
-                        }
-                    }
-                    if(connector != null) {
-                        try {
-                            ((GeronimoManagedBean)connector).startRecursive();
-                        } catch (Exception e) {
-                            log.error("Unable to start connector", e); //todo: get into rendered page somehow?
-                        }
-                    }
-                    else {
-                        log.error("Incorrect connector reference"); //Replace this with correct error processing
-                    }
-                    actionResponse.setRenderParameter("name", objectName);
-                    actionResponse.setRenderParameter("mode", "list");
-                } else if(mode.equals("stop")) {
-                    String objectName = actionRequest.getParameter("name");
-                    // work with the current connector to stop it.
-                    WebConnector connector = null;
-                    WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
-                    for (int i = 0; i < all.length; i++) {
-                        WebConnector conn = all[i];
-                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                            connector = conn;
-                            break;
-                        }
+                }
+                if(connector instanceof SecureConnector) {
+                    String keystoreType = actionRequest.getParameter("keystoreType");
+                    String keystoreFile = actionRequest.getParameter("keystoreFile");
+                    String privateKeyPass = actionRequest.getParameter("privateKeyPassword");
+                    String keystorePass = actionRequest.getParameter("keystorePassword");
+                    String secureProtocol = actionRequest.getParameter("secureProtocol");
+                    String algorithm = actionRequest.getParameter("algorithm");
+                    boolean clientAuth = isValid(actionRequest.getParameter("clientAuth"));
+                    SecureConnector secure = (SecureConnector) connector;
+                    if(isValid(keystoreType)) {secure.setKeystoreType(keystoreType);}
+                    if(isValid(keystoreFile)) {secure.setKeystoreFileName(keystoreFile);}
+                    if(isValid(keystorePass)) {secure.setKeystorePassword(keystorePass);}
+                    if(isValid(secureProtocol)) {secure.setSecureProtocol(secureProtocol);}
+                    if(isValid(algorithm)) {secure.setAlgorithm(algorithm);}
+                    secure.setClientAuthRequired(clientAuth);
+                    if(server.equals(WEB_SERVER_JETTY)) {
+                        if(isValid(privateKeyPass)) {setProperty(secure, "keyPassword", privateKeyPass);}
                     }
-                    if(connector != null) {
-                        try {
-                            ((GeronimoManagedBean)connector).stop();
-                        } catch (Exception e) {
-                            log.error("Unable to stop connector", e); //todo: get into rendered page somehow?
-                        }
+                    else if (server.equals(WEB_SERVER_TOMCAT)) {
+                        //todo:   Any Tomcat specific processing?
                     }
                     else {
-                        log.error("Incorrect connector reference"); //Replace this with correct error processing
+                        //todo:   Handle "should not occur" condition
                     }
-                    actionResponse.setRenderParameter("name", objectName);
-                    actionResponse.setRenderParameter("mode", "list");
-                } else if(mode.equals("edit")) {
-                    String objectName = actionRequest.getParameter("name");
-                    actionResponse.setRenderParameter("objectName", objectName);
-                    actionResponse.setRenderParameter("mode", "edit");
-
-                } else if(mode.equals("delete")) { // User chose to delete a connector
-                    String objectName = actionRequest.getParameter("name");
-                    PortletManager.getWebManager(actionRequest, managerName).removeConnector(objectName);
-                    actionResponse.setRenderParameter("mode", "list");
+                }
+            }
+            actionResponse.setRenderParameter("mode", "list");
+        } else if(mode.equals("start")) {
+            String objectName = actionRequest.getParameter("name");
+            // work with the current connector to start it.
+            WebConnector connector = null;
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+            for (int i = 0; i < all.length; i++) {
+                WebConnector conn = all[i];
+                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                    connector = conn;
+                    break;
+                }
+            }
+            if(connector != null) {
+                try {
+                    ((GeronimoManagedBean)connector).startRecursive();
+                } catch (Exception e) {
+                    log.error("Unable to start connector", e); //todo: get into rendered page somehow?
                 }
             }
             else {
-                // todo - Handle "should not occur" error (message?)
+                log.error("Incorrect connector reference"); //Replace this with correct error processing
+            }
+            actionResponse.setRenderParameter("name", objectName);
+            actionResponse.setRenderParameter("mode", "list");
+        } else if(mode.equals("stop")) {
+            String objectName = actionRequest.getParameter("name");
+            // work with the current connector to stop it.
+            WebConnector connector = null;
+            WebConnector all[] = PortletManager.getWebConnectors(actionRequest, managerName);
+            for (int i = 0; i < all.length; i++) {
+                WebConnector conn = all[i];
+                if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                    connector = conn;
+                    break;
+                }
             }
-        }                   
-        else {
-            // todo - Handle "should not occur" error (message?)
+            if(connector != null) {
+                try {
+                    ((GeronimoManagedBean)connector).stop();
+                } catch (Exception e) {
+                    log.error("Unable to stop connector", e); //todo: get into rendered page somehow?
+                }
+            }
+            else {
+                log.error("Incorrect connector reference"); //Replace this with correct error processing
+            }
+            actionResponse.setRenderParameter("name", objectName);
+            actionResponse.setRenderParameter("mode", "list");
+        } else if(mode.equals("edit")) {
+            String objectName = actionRequest.getParameter("name");
+            actionResponse.setRenderParameter("objectName", objectName);
+            actionResponse.setRenderParameter("mode", "edit");
+
+        } else if(mode.equals("delete")) { // User chose to delete a connector
+            String objectName = actionRequest.getParameter("name");
+            PortletManager.getWebManager(actionRequest, managerName).removeConnector(objectName);
+            actionResponse.setRenderParameter("mode", "list");
         }
     }
 
@@ -278,21 +270,61 @@
             mode = "list";
         }
 
-        String[] names = PortletManager.getWebManagerNames(renderRequest);  //todo: handle multiple
-        if (names != null) {
-            String managerName = names[0];  //todo: handle multiple
-            String[] containers = PortletManager.getWebContainerNames(renderRequest, managerName);  //todo: handle multiple
-            if (containers != null) {
-                String containerName = containers[0];  //todo: handle multiple
-                WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
-                String server = getWebServerType(container.getClass());
-                renderRequest.setAttribute("server", server);
-
-                if(mode.equals("new")) {
-                    String protocol = renderRequest.getParameter("protocol");
-                    renderRequest.setAttribute("maxThreads", "50");
+
+        if(mode.equals("list")) {
+            doList(renderRequest, renderResponse);
+        } else {
+            String managerName = renderRequest.getParameter("managerObjectName");
+            String containerName = renderRequest.getParameter("containerObjectName");
+            renderRequest.setAttribute("managerObjectName", managerName);
+            renderRequest.setAttribute("containerObjectName", containerName);
+
+            WebContainer container = PortletManager.getWebContainer(renderRequest, containerName);
+            String server = getWebServerType(container.getClass());
+            renderRequest.setAttribute("server", server);
+
+            if(mode.equals("new")) {
+                String protocol = renderRequest.getParameter("protocol");
+                renderRequest.setAttribute("maxThreads", "50");
+                if(server.equals(WEB_SERVER_JETTY)) {
+                    renderRequest.setAttribute("minThreads", "10");
+                }
+                else if (server.equals(WEB_SERVER_TOMCAT)) {
+                    //todo:   Any Tomcat specific processing?
+                }
+                else {
+                    //todo:   Handle "should not occur" condition
+                }
+                renderRequest.setAttribute("protocol", protocol);
+                renderRequest.setAttribute("mode", "add");
+                if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
+                    editHttpsView.include(renderRequest, renderResponse);
+                } else {
+                    editHttpView.include(renderRequest, renderResponse);
+                }
+
+            } else if(mode.equals("edit")) {
+                String objectName = renderRequest.getParameter("objectName");
+                WebConnector connector = null;
+                WebConnector all[] = PortletManager.getWebConnectors(renderRequest, managerName);
+                for (int i = 0; i < all.length; i++) {
+                    WebConnector conn = all[i];
+                    if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
+                        connector = conn;
+                        break;
+                    }
+                }
+                if(connector == null) {
+                    doList(renderRequest, renderResponse);
+                } else {
+                    renderRequest.setAttribute("objectName", objectName);
+                    renderRequest.setAttribute("port", new Integer(connector.getPort()));
+                    renderRequest.setAttribute("host", connector.getHost());
+                    int maxThreads = connector.getMaxThreads();
+                    renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
                     if(server.equals(WEB_SERVER_JETTY)) {
-                        renderRequest.setAttribute("minThreads", "10");
+                        int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
+                        renderRequest.setAttribute("minThreads", String.valueOf(minThreads));
                     }
                     else if (server.equals(WEB_SERVER_TOMCAT)) {
                         //todo:   Any Tomcat specific processing?
@@ -300,108 +332,130 @@
                     else {
                         //todo:   Handle "should not occur" condition
                     }
-                    renderRequest.setAttribute("protocol", protocol);
-                    renderRequest.setAttribute("mode", "add");
-                    if(protocol.equals(WebManager.PROTOCOL_HTTPS)) {
-                        editHttpsView.include(renderRequest, renderResponse);
-                    } else {
-                        editHttpView.include(renderRequest, renderResponse);
-                    }
+                    renderRequest.setAttribute("mode", "save");
 
-                } else if(mode.equals("edit")) {
-                    String objectName = renderRequest.getParameter("objectName");
-                    WebConnector connector = null;
-                    WebConnector all[] = PortletManager.getWebConnectors(renderRequest, managerName);
-                    for (int i = 0; i < all.length; i++) {
-                        WebConnector conn = all[i];
-                        if(((GeronimoManagedBean)conn).getObjectName().equals(objectName)) {
-                            connector = conn;
-                            break;
+                    if(connector instanceof SecureConnector) {
+                        SecureConnector secure = (SecureConnector) connector;
+                        renderRequest.setAttribute("keystoreFile",secure.getKeystoreFileName());
+                        renderRequest.setAttribute("keystoreType",secure.getKeystoreType());
+                        renderRequest.setAttribute("algorithm",secure.getAlgorithm());
+                        renderRequest.setAttribute("secureProtocol",secure.getSecureProtocol());
+                        if(secure.isClientAuthRequired()) {
+                            renderRequest.setAttribute("clientAuth", Boolean.TRUE);
                         }
                     }
-                    if(connector == null) {
-                        doList(renderRequest, managerName, renderResponse);
-                    } else {
-                        renderRequest.setAttribute("objectName", objectName);
-                        renderRequest.setAttribute("port", new Integer(connector.getPort()));
-                        renderRequest.setAttribute("host", connector.getHost());
-                        int maxThreads = connector.getMaxThreads();
-                        renderRequest.setAttribute("maxThreads", Integer.toString(maxThreads));
-                        if(server.equals(WEB_SERVER_JETTY)) {
-                            int minThreads = ((Number)getProperty(connector, "minThreads")).intValue();
-                            renderRequest.setAttribute("minThreads", String.valueOf(minThreads));
-                        }
-                        else if (server.equals(WEB_SERVER_TOMCAT)) {
-                            //todo:   Any Tomcat specific processing?
-                        }
-                        else {
-                            //todo:   Handle "should not occur" condition
-                        }
-                        renderRequest.setAttribute("mode", "save");
 
-                        if(connector instanceof SecureConnector) {
-                            SecureConnector secure = (SecureConnector) connector;
-                            renderRequest.setAttribute("keystoreFile",secure.getKeystoreFileName());
-                            renderRequest.setAttribute("keystoreType",secure.getKeystoreType());
-                            renderRequest.setAttribute("algorithm",secure.getAlgorithm());
-                            renderRequest.setAttribute("secureProtocol",secure.getSecureProtocol());
-                            if(secure.isClientAuthRequired()) {
-                                renderRequest.setAttribute("clientAuth", Boolean.TRUE);
-                            }
-                        }
-
-                        if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
-                            editHttpsView.include(renderRequest, renderResponse);
-                        } else {
-                            editHttpView.include(renderRequest, renderResponse);
-                        }
+                    if(connector.getProtocol().equals(WebManager.PROTOCOL_HTTPS)) {
+                        editHttpsView.include(renderRequest, renderResponse);
+                    } else {
+                        editHttpView.include(renderRequest, renderResponse);
                     }
-                } else if(mode.equals("list")) {
-                    doList(renderRequest, managerName, renderResponse);
                 }
             }
-            else {
-                // todo  - Handle "should not occur" error  - message?
-            }
-        }                   
-        else {
-            // todo - Handle "should not occur" error (message?)
         }
 
     }
 
-    private void doList(RenderRequest renderRequest, String managerName, RenderResponse renderResponse) throws PortletException, IOException {
-        List beans = new ArrayList();
-        WebConnector[] connectors = PortletManager.getWebConnectors(renderRequest, managerName);
-        for (int i = 0; i < connectors.length; i++) {
-            WebConnector connector = connectors[i];
-            ConnectorInfo info = new ConnectorInfo();
-                String objectName = ((GeronimoManagedBean)connector).getObjectName();
-                info.setObjectName(objectName);
-                info.setDescription(PortletManager.getGBeanDescription(renderRequest, objectName));
+    private void doList(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException {
+        WebManager[] managers = PortletManager.getWebManagers(renderRequest);
+        List all = new ArrayList();
+        for (int i = 0; i < managers.length; i++) {
+            WebManager manager = managers[i];
+            String webManagerName = ((GeronimoManagedBean)manager).getObjectName();
+
+            String[] containers = PortletManager.getWebContainerNames(renderRequest, webManagerName);
+            for (int j = 0; j < containers.length; j++) {
                 try {
-                    ObjectName realName = ObjectName.getInstance(objectName);
-                    info.setDisplayName(realName.getKeyProperty("name"));
+                    List beans = new ArrayList();
+                    String containerName = containers[j];
+                    String id;
+                    if(containers.length == 1) {
+                        id = manager.getProductName();
+                    } else {
+                        ObjectName containerON = ObjectName.getInstance(containerName);
+                        id = manager.getProductName() + " (" + containerON.getKeyProperty(NameFactory.J2EE_NAME) + ")";
+                    }
+                    ContainerStatus result = new ContainerStatus(id, webManagerName, containerName);
+
+                    WebConnector[] connectors = PortletManager.getWebConnectorsForContainer(renderRequest, webManagerName, containerName);
+                    for (int k = 0; k < connectors.length; k++) {
+                        WebConnector connector = connectors[k];
+                        ConnectorInfo info = new ConnectorInfo();
+                            String objectName = ((GeronimoManagedBean)connector).getObjectName();
+                            info.setObjectName(objectName);
+                            info.setDescription(PortletManager.getGBeanDescription(renderRequest, objectName));
+                            try {
+                                ObjectName realName = ObjectName.getInstance(objectName);
+                                info.setDisplayName(realName.getKeyProperty("name"));
+                            } catch (MalformedObjectNameException e) {
+                                log.error("Bad object name for web connector", e);
+                                info.setDisplayName(info.getDescription());
+                            }
+                            info.setState(((GeronimoManagedBean)connector).getState());
+                            info.setPort(connector.getPort());
+                        try {
+                            info.setProtocol(connector.getProtocol());
+                        } catch (IllegalStateException e) {
+                            info.setProtocol("unknown");
+                        }
+                        beans.add(info);
+                    }
+                    result.setConnectors(beans);
+                    result.setProtocols(manager.getSupportedProtocols());
+                    all.add(result);
                 } catch (MalformedObjectNameException e) {
-                    log.error("Bad object name for web connector", e);
-                    info.setDisplayName(info.getDescription());
+                    log.error("Unable to parse ObjectName", e);
                 }
-                info.setState(((GeronimoManagedBean)connector).getState());
-                info.setPort(connector.getPort());
-            try {
-                info.setProtocol(connector.getProtocol());
-            } catch (java.lang.IllegalStateException e) {
-                info.setProtocol("unknown");
             }
-            beans.add(info);
         }
-        renderRequest.setAttribute("connectors", beans);
-        renderRequest.setAttribute("protocols", PortletManager.getWebManager(renderRequest, managerName).getSupportedProtocols());
+        renderRequest.setAttribute("containers", all);
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
         } else {
             maximizedView.include(renderRequest, renderResponse);
+        }
+    }
+
+    public final static class ContainerStatus {
+        private String name;
+        private String managerObjectName;
+        private String containerObjectName;
+        private String[] protocols;
+        private List connectors;
+
+        public ContainerStatus(String name, String managerObjectName, String containerObjectName) {
+            this.name = name;
+            this.managerObjectName = managerObjectName;
+            this.containerObjectName = containerObjectName;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public String[] getProtocols() {
+            return protocols;
+        }
+
+        public void setProtocols(String[] protocols) {
+            this.protocols = protocols;
+        }
+
+        public List getConnectors() {
+            return connectors;
+        }
+
+        public void setConnectors(List connectors) {
+            this.connectors = connectors;
+        }
+
+        public String getManagerObjectName() {
+            return managerObjectName;
+        }
+
+        public String getContainerObjectName() {
+            return containerObjectName;
         }
     }
 

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTP.jsp Tue Nov 15 21:41:39 2005
@@ -5,6 +5,8 @@
 <form name="<portlet:namespace/>" action="<portlet:actionURL/>">
 <input type="hidden" name="mode" value="${mode}">
 <input type="hidden" name="protocol" value="${protocol}">
+<input type="hidden" name="containerObjectName" value="${containerObjectName}">
+<input type="hidden" name="managerObjectName" value="${managerObjectName}">
 <c:if test="${mode eq 'save'}">
   <input type="hidden" name="objectName" value="${objectName}">
 </c:if>

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/webmanager/connector/editHTTPS.jsp Tue Nov 15 21:41:39 2005
@@ -5,6 +5,8 @@
 <form name="<portlet:namespace/>" action="<portlet:actionURL/>">
 <input type="hidden" name="mode" value="${mode}">
 <input type="hidden" name="protocol" value="${protocol}">
+<input type="hidden" name="containerObjectName" value="${containerObjectName}">
+<input type="hidden" name="managerObjectName" value="${managerObjectName}">
 <c:if test="${mode eq 'save'}">
   <input type="hidden" name="objectName" value="${objectName}">
 </c:if>

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=344897&r1=344896&r2=344897&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 Tue Nov 15 21:41:39 2005
@@ -1,10 +1,17 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
 <portlet:defineObjects/>
 
 <!-- Show existing connectors -->
-<c:if test="${empty(connectors)}">There are no Connectors defined</c:if>
-<c:if test="${!empty(connectors)}">
+<c:choose>
+  <c:when test="${empty(containers)}">There are no Web Containers defined</c:when>
+  <c:otherwise>
+    <c:forEach var="container" items="${containers}">
+      <c:if test="${fn:length(containers) > 1}"><p><b>Connectors for ${container.name}:</b></p></c:if>
+        <c:choose>
+          <c:when test="${empty(container.connectors)}"><p>There are no connectors defined for ${container.name}</p></c:when>
+          <c:otherwise>
 <table width="100%">
   <tr>
     <td style="padding: 0 20px">
@@ -16,7 +23,7 @@
             <td class="DarkBackground" align="center">Actions</td>
             <td class="DarkBackground" align="center">Type</td>
           </tr>
-<c:forEach var="info" items="${connectors}">
+<c:forEach var="info" items="${container.connectors}">
           <tr>
             <td>${info.displayName}</td>
             <td>${info.protocol}</td>
@@ -28,35 +35,51 @@
                <a href="<portlet:actionURL portletMode="view">
                  <portlet:param name="mode" value="stop" />
                  <portlet:param name="name" value="${info.objectName}" />
+                 <portlet:param name="managerObjectName" value="${container.managerObjectName}" />
+                 <portlet:param name="containerObjectName" value="${container.containerObjectName}" />
                </portlet:actionURL>">stop</a>
                </c:when>
                <c:otherwise>
                <a href="<portlet:actionURL portletMode="view">
                  <portlet:param name="mode" value="start" />
                  <portlet:param name="name" value="${info.objectName}" />
+                 <portlet:param name="managerObjectName" value="${container.managerObjectName}" />
+                 <portlet:param name="containerObjectName" value="${container.containerObjectName}" />
                </portlet:actionURL>">start</a>
                </c:otherwise>
              </c:choose>
                <a href="<portlet:actionURL portletMode="view">
                  <portlet:param name="mode" value="edit" />
                  <portlet:param name="name" value="${info.objectName}" />
+                 <portlet:param name="managerObjectName" value="${container.managerObjectName}" />
+                 <portlet:param name="containerObjectName" value="${container.containerObjectName}" />
                </portlet:actionURL>">edit</a>
                <a href="<portlet:actionURL portletMode="view">
                  <portlet:param name="mode" value="delete" />
                  <portlet:param name="name" value="${info.objectName}" />
+                 <portlet:param name="managerObjectName" value="${container.managerObjectName}" />
+                 <portlet:param name="containerObjectName" value="${container.containerObjectName}" />
                </portlet:actionURL>">delete</a>
              </td>
             <td>${info.description}</td>
           </tr>
 </c:forEach>
 </table>
-</c:if>
+          </c:otherwise>
+        </c:choose>
+
 
 <!-- Links to add new connectors -->
-<c:forEach var="protocol" items="${protocols}">
+<c:forEach var="protocol" items="${container.protocols}">
 <br />
 <a href="<portlet:actionURL portletMode="view">
            <portlet:param name="mode" value="new" />
            <portlet:param name="protocol" value="${protocol}" />
-         </portlet:actionURL>">Add new ${protocol} listener</a>
+           <portlet:param name="managerObjectName" value="${container.managerObjectName}" />
+           <portlet:param name="containerObjectName" value="${container.containerObjectName}" />
+         </portlet:actionURL>">Add new ${protocol} listener for ${container.name}</a>
 </c:forEach>
+
+    </c:forEach>
+  </c:otherwise>
+</c:choose>

Modified: geronimo/trunk/modules/assembly/src/plan/system-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/system-plan.xml?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/system-plan.xml Tue Nov 15 21:41:39 2005
@@ -37,7 +37,7 @@
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
 
     <!-- Configuration Manager service -->
-    <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.ConfigurationManagerImpl">
+    <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableConfigurationManagerImpl">
         <reference name="Stores">
             <gbean-name>*:j2eeType=ConfigurationStore,*</gbean-name>
         </reference>

Modified: geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/webconsole-jetty-plan.xml Tue Nov 15 21:41:39 2005
@@ -1,124 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<application
-    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
-    configId="org/apache/geronimo/Console/Jetty"
-    parentId="org/apache/geronimo/Server">
-
-    <!-- these dependencies must be kept here so that their classes are loaded in the "EARs" classloader. -->
-    <dependency>
-        <groupId>portlet-api</groupId>
-        <artifactId>portlet-api</artifactId>
-        <version>${portlet_api_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.pluto</groupId>
-        <artifactId>pluto</artifactId>
-        <version>${pluto_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-console-core</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <!-- The following are for configuration and deployment via JSR-88 -->
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-test-ddbean</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-deploy-jsr88</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-deploy-config</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-service-builder</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-connector-builder</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-j2ee-schema</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>xmlbeans</groupId>
-        <artifactId>xbean</artifactId>
-        <version>${xmlbeans_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>stax</groupId>
-        <artifactId>stax-api</artifactId>
-        <version>${stax_api_version}</version>
-    </dependency>
-
-    <!-- Keystore dependency -->
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-util</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <module>
-        <web>geronimo-console-framework-${pom.currentVersion}.war</web>
-        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="console">
-            <context-root>/console</context-root>
-            <context-priority-classloader>false</context-priority-classloader>
-            <security-realm-name>geronimo-properties-realm</security-realm-name>
-            <security>
-                <default-principal>
-                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
-                </default-principal>
-                <role-mappings>
-                    <role role-name="admin">
-                        <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin" designated-run-as="true"/>
-                    </role>
-                </role-mappings>
-            </security>
-        </web-app>
-    </module>
-
-    <module>
-        <web>geronimo-console-standard-${pom.currentVersion}.war</web>
-        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="console-standard">
-            <context-root>/console-standard</context-root>
-            <context-priority-classloader>false</context-priority-classloader>
-        </web-app>
-    </module>
-
-    <!-- Console specific server info -->
-    <gbean name="PropertiesLoginManager" class="org.apache.geronimo.console.core.security.PropertiesLoginModuleManager">
-        <reference name="ServerInfo">
-            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
-        </reference>
-        <reference name="LoginModule">
-            <!--            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>-->
-            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>
-        </reference>
-    </gbean>
-
-    <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
-        <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
-        <attribute name="keyStoreType">jks</attribute>
-        <attribute name="keyStoreProvider">SUN</attribute>
-        <attribute name="keyStorePassword">password</attribute>
-        <reference name="serverInfo">
-            <application>null</application>
-            <moduleType>J2EEModule</moduleType>
-            <module>org/apache/geronimo/System</module>
-            <type>GBean</type>
-            <name>ServerInfo</name>
-        </reference>
-    </gbean>
-
-</application>
+<?xml version="1.0" encoding="UTF-8"?>
<application
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
    configId="org/apache/geronimo/Console/Jetty"
    parentId="org/apache/geronimo/Server">
    
    <import>
      <uri>org/apache/geronimo/Jetty</uri>
    </import>

    <!-- these dependencies must be kept here so that their classes are loaded in the "EARs" classloader. -->
    <dependency>
        <groupId>portlet-api</groupId>
        <artifactId>portlet-api</artifactId>
        <version>${portlet_api_version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pluto</groupId>
        <artifactId>pluto</artifactId>
        <version>${pluto_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-console-core</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <!-- The following are for configuration and deployment via JSR-88 -->
    <dependen
 cy>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-test-ddbean</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-deploy-jsr88</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-deploy-config</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-service-builder</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-connector-builder</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-j2ee-schema</artifactId>
        <version>${ger
 onimo_version}</version>
    </dependency>
    <dependency>
        <groupId>xmlbeans</groupId>
        <artifactId>xbean</artifactId>
        <version>${xmlbeans_version}</version>
    </dependency>
    <dependency>
        <groupId>stax</groupId>
        <artifactId>stax-api</artifactId>
        <version>${stax_api_version}</version>
    </dependency>

    <!-- Keystore dependency -->
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-util</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <module>
        <web>geronimo-console-framework-${pom.currentVersion}.war</web>
        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="console">
            <context-root>/console</context-root>
            <context-priority-classloader>false</context-priority-classloader>
            <security-realm-name>geronimo-properties-realm</security-realm-name>
            <security>
                <d
 efault-principal>
                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
                </default-principal>
                <role-mappings>
                    <role role-name="admin">
                        <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin" designated-run-as="true"/>
                    </role>
                </role-mappings>
            </security>
        </web-app>
    </module>

    <module>
        <web>geronimo-console-standard-${pom.currentVersion}.war</web>
        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.0" configId="console-standard">
            <context-root>/console-standard</context-root>
            <context-priority-classloader>false</context-priority-classloader>
        </web-app>
    </module>

    <!-- Console specific server info -->
    <gbean name="PropertiesLoginManager" class="org.apache.g
 eronimo.console.core.security.PropertiesLoginModuleManager">
        <reference name="ServerInfo">
            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
        </reference>
        <reference name="LoginModule">
            <!--            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>-->
            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>
        </reference>
    </gbean>

    <!-- Keystore configuration -->
    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
        <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
        <attribute nam
 e="keyStoreType">jks</attribute>
        <attribute name="keyStoreProvider">SUN</attribute>
        <attribute name="keyStorePassword">password</attribute>
        <reference name="serverInfo">
            <application>null</application>
            <moduleType>J2EEModule</moduleType>
            <module>org/apache/geronimo/System</module>
            <type>GBean</type>
            <name>ServerInfo</name>
        </reference>
    </gbean>

</application>
\ No newline at end of file

Modified: geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/webconsole-tomcat-plan.xml Tue Nov 15 21:41:39 2005
@@ -1,126 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<application
-    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
-    configId="org/apache/geronimo/Console/Tomcat"
-    parentId="org/apache/geronimo/Server">
-
-    <!-- these dependencies must be kept here so that their classes are loaded in the "EARs" classloader. -->
-    <dependency>
-        <groupId>portlet-api</groupId>
-        <artifactId>portlet-api</artifactId>
-        <version>${portlet_api_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.pluto</groupId>
-        <artifactId>pluto</artifactId>
-        <version>${pluto_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-console-core</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <!-- The following are for configuration and deployment via JSR-88 -->
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-test-ddbean</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-deploy-jsr88</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-deploy-config</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-service-builder</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-connector-builder</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-j2ee-schema</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>xmlbeans</groupId>
-        <artifactId>xbean</artifactId>
-        <version>${xmlbeans_version}</version>
-    </dependency>
-    <dependency>
-        <groupId>stax</groupId>
-        <artifactId>stax-api</artifactId>
-        <version>${stax_api_version}</version>
-    </dependency>
-
-    <!-- Keystore dependency -->
-    <dependency>
-        <groupId>geronimo</groupId>
-        <artifactId>geronimo-util</artifactId>
-        <version>${geronimo_version}</version>
-    </dependency>
-    <module>
-        <web>geronimo-console-framework-${pom.currentVersion}.war</web>
-        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0" configId="console">
-            <context-root>/console</context-root>
-            <context-priority-classloader>false</context-priority-classloader>
-            <cross-context/>
-            <security-realm-name>geronimo-properties-realm</security-realm-name>
-            <security>
-                <default-principal>
-                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
-                </default-principal>
-                <role-mappings>
-                    <role role-name="admin">
-                        <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin" designated-run-as="true"/>
-                    </role>
-                </role-mappings>
-            </security>
-        </web-app>
-    </module>
-
-    <module>
-        <web>geronimo-console-standard-${pom.currentVersion}.war</web>
-        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0" configId="console-standard">
-            <context-root>/console-standard</context-root>
-            <context-priority-classloader>false</context-priority-classloader>
-            <cross-context/>
-        </web-app>
-    </module>
-
-    <!-- Console specific server info -->
-    <gbean name="PropertiesLoginManager" class="org.apache.geronimo.console.core.security.PropertiesLoginModuleManager">
-        <reference name="ServerInfo">
-            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
-        </reference>
-        <reference name="LoginModule">
-            <!--            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>-->
-            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>
-        </reference>
-    </gbean>
-
-    <!-- Keystore configuration -->
-    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
-        <attribute name="keyStoreLocation">var/security/ssl-keystore-1</attribute>
-        <attribute name="keyStoreType">jks</attribute>
-        <attribute name="keyStoreProvider">SUN</attribute>
-        <attribute name="keyStorePassword">password</attribute>
-        <reference name="serverInfo">
-            <application>null</application>
-            <moduleType>J2EEModule</moduleType>
-            <module>org/apache/geronimo/System</module>
-            <type>GBean</type>
-            <name>ServerInfo</name>
-        </reference>
-    </gbean>
-
-</application>
+<?xml version="1.0" encoding="UTF-8"?>
<application
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.0"
    configId="org/apache/geronimo/Console/Tomcat"
    parentId="org/apache/geronimo/Server">

    <import>
      <uri>org/apache/geronimo/Tomcat</uri>
    </import>

    <!-- these dependencies must be kept here so that their classes are loaded in the "EARs" classloader. -->
    <dependency>
        <groupId>portlet-api</groupId>
        <artifactId>portlet-api</artifactId>
        <version>${portlet_api_version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.pluto</groupId>
        <artifactId>pluto</artifactId>
        <version>${pluto_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-console-core</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <!-- The following are for configuration and deployment via JSR-88 -->
    <dependency
 >
        <groupId>geronimo</groupId>
        <artifactId>geronimo-test-ddbean</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-deploy-jsr88</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-deploy-config</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-service-builder</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-connector-builder</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-j2ee-schema</artifactId>
        <version>${geron
 imo_version}</version>
    </dependency>
    <dependency>
        <groupId>xmlbeans</groupId>
        <artifactId>xbean</artifactId>
        <version>${xmlbeans_version}</version>
    </dependency>
    <dependency>
        <groupId>stax</groupId>
        <artifactId>stax-api</artifactId>
        <version>${stax_api_version}</version>
    </dependency>

    <!-- Keystore dependency -->
    <dependency>
        <groupId>geronimo</groupId>
        <artifactId>geronimo-util</artifactId>
        <version>${geronimo_version}</version>
    </dependency>
    <module>
        <web>geronimo-console-framework-${pom.currentVersion}.war</web>
        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0" configId="console">
            <context-root>/console</context-root>
            <context-priority-classloader>false</context-priority-classloader>
            <cross-context/>
            <security-realm-name>geronimo-properties-realm</security-realm-name>
            <
 security>
                <default-principal>
                    <principal class="org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal" name="system"/>
                </default-principal>
                <role-mappings>
                    <role role-name="admin">
                        <principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="admin" designated-run-as="true"/>
                    </role>
                </role-mappings>
            </security>
        </web-app>
    </module>

    <module>
        <web>geronimo-console-standard-${pom.currentVersion}.war</web>
        <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.0" configId="console-standard">
            <context-root>/console-standard</context-root>
            <context-priority-classloader>false</context-priority-classloader>
            <cross-context/>
        </web-app>
    </module>

    <!-- Console specific server info -->
  
   <gbean name="PropertiesLoginManager" class="org.apache.geronimo.console.core.security.PropertiesLoginModuleManager">
        <reference name="ServerInfo">
            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/System,J2EEServer=geronimo,j2eeType=GBean,name=ServerInfo</gbean-name>
        </reference>
        <reference name="LoginModule">
            <!--            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Server,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>-->
            <gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/Security,J2EEServer=geronimo,j2eeType=LoginModule,name=properties-login</gbean-name>
        </reference>
    </gbean>

    <!-- Keystore configuration -->
    <gbean gbeanName="geronimo.security:type=KeyStore" class="org.apache.geronimo.console.core.keystore.KeyStoreGBean">
        <attribute name="keyStoreLocation">var/
 security/ssl-keystore-1</attribute>
        <attribute name="keyStoreType">jks</attribute>
        <attribute name="keyStoreProvider">SUN</attribute>
        <attribute name="keyStorePassword">password</attribute>
        <reference name="serverInfo">
            <application>null</application>
            <moduleType>J2EEModule</moduleType>
            <module>org/apache/geronimo/System</module>
            <type>GBean</type>
            <name>ServerInfo</name>
        </reference>
    </gbean>

</application>
\ No newline at end of file

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java Tue Nov 15 21:41:39 2005
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Hashtable;
+import java.net.URISyntaxException;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
 import org.apache.geronimo.management.geronimo.WebManager;
@@ -30,6 +31,10 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.EditableConfigurationManager;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
 import org.apache.geronimo.jetty.connector.HTTPSConnector;
 import org.apache.geronimo.jetty.connector.AJP13Connector;
@@ -91,14 +96,25 @@
         connector.setAttribute("minThreads", new Integer(10));
         connector.setAttribute("maxThreads", new Integer(50));
         connector.setReferencePattern(JettyConnector.CONNECTOR_CONTAINER_REFERENCE, container);
-        ObjectName config = Util.getConfiguration(kernel, container);
-        try {
-            kernel.invoke(config, "addGBean", new Object[]{connector, Boolean.FALSE}, new String[]{GBeanData.class.getName(), boolean.class.getName()});
-        } catch (Exception e) {
-            log.error("Unable to add GBean ", e);
+        EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
+        if(mgr != null) {
+            try {
+                ObjectName config = Util.getConfiguration(kernel, container);
+                mgr.addGBeanToConfiguration(Configuration.getConfigurationID(config), connector, false);
+                return name.getCanonicalName();
+            } catch (InvalidConfigException e) {
+                log.error("Unable to add GBean", e);
+                return null;
+            } catch (URISyntaxException e) {
+                log.error("Should never happen", e);
+                return null;
+            } finally {
+                ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
+            }
+        } else {
+            log.warn("The ConfigurationManager in the kernel does not allow editing");
             return null;
         }
-        return name.getCanonicalName();
     }
 
     /**
@@ -150,7 +166,20 @@
                 throw new GBeanNotFoundException(name);
             }
             ObjectName config = Util.getConfiguration(kernel, name);
-            kernel.invoke(config, "removeGBean", new Object[]{name}, new String[]{ObjectName.class.getName()});
+            EditableConfigurationManager mgr = ConfigurationUtil.getEditableConfigurationManager(kernel);
+            if(mgr != null) {
+                try {
+                    mgr.removeGBeanFromConfiguration(Configuration.getConfigurationID(config), name);
+                } catch (InvalidConfigException e) {
+                    log.error("Unable to add GBean", e);
+                } catch (URISyntaxException e) {
+                    log.error("Should never happen", e);
+                } finally {
+                    ConfigurationUtil.releaseConfigurationManager(kernel, mgr);
+                }
+            } else {
+                log.warn("The ConfigurationManager in the kernel does not allow editing");
+            }
         } catch (GBeanNotFoundException e) {
             log.warn("No such GBean '" + objectName + "'"); //todo: what if we want to remove a failed GBean?
         } catch (Exception e) {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java Tue Nov 15 21:41:39 2005
@@ -513,6 +513,10 @@
         return nonOverridableClasses;
     }
 
+    public synchronized boolean containsGBean(ObjectName gbean) {
+        return objectNames.contains(gbean);
+    }
+
     public synchronized void addGBean(GBeanData beanData, boolean start) throws InvalidConfigException, GBeanAlreadyExistsException {
         ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
         try {
@@ -528,7 +532,11 @@
         } finally {
             Thread.currentThread().setContextClassLoader(oldCl);
         }
-        storeCurrentGBeans();
+        try {
+            saveState(); //todo: once the attribute store can save new GBean data, won't need to update the config store any more
+        } catch (Exception e) {
+            log.error("Unable to save new GBean", e);
+        }
     }
 
     public synchronized void removeGBean(ObjectName name) throws GBeanNotFoundException {
@@ -680,6 +688,7 @@
 
         infoFactory.addOperation("addGBean", new Class[]{GBeanData.class, boolean.class});
         infoFactory.addOperation("removeGBean", new Class[]{ObjectName.class});
+        infoFactory.addOperation("containsGBean", new Class[]{ObjectName.class});
         infoFactory.addOperation("saveState");
         infoFactory.addOperation("loadGBeans", new Class[]{ManageableAttributeStore.class});
         infoFactory.addOperation("startRecursiveGBeans");

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java Tue Nov 15 21:41:39 2005
@@ -23,7 +23,7 @@
 import javax.management.ObjectName;
 
 /**
- *
+ * Encapsulates logic for dealing with configurations.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java Tue Nov 15 21:41:39 2005
@@ -36,19 +36,24 @@
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.InternalKernelException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 
 /**
+ * The standard non-editable ConfigurationManager implementation.  That is,
+ * you can save a lost configurations and stuff, but not change the set of
+ * GBeans included in a configuration.
+ *
+ * @see EditableConfigurationManager
+ *
  * @version $Rev$ $Date$
  */
 public class ConfigurationManagerImpl implements ConfigurationManager, GBeanLifecycle {
     private static final Log log = LogFactory.getLog(ConfigurationManagerImpl.class);
-    private final Kernel kernel;
+    protected final Kernel kernel;
     private final Collection stores;
-    private final ManageableAttributeStore attributeStore;
-    private final PersistentConfigurationList configurationList;
+    protected final ManageableAttributeStore attributeStore;
+    protected final PersistentConfigurationList configurationList;
     private final ShutdownHook shutdownHook;
     private static final ObjectName CONFIGURATION_NAME_QUERY;
 

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=344897&r1=344896&r2=344897&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Tue Nov 15 21:41:39 2005
@@ -24,18 +24,24 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.gbean.GBeanQuery;
 
 /**
  * @version $Rev$ $Date$
  */
 public final class ConfigurationUtil {
-    private static final ObjectName CONFIGURATION_MANAGER_QUERY = JMXUtil.getObjectName("*:j2eeType=ConfigurationManager,*");
-
     private ConfigurationUtil() {
     }
 
+    /**
+     * Gets a reference or proxy to the ConfigurationManager running in the specified kernel.
+     *
+     * @return The ConfigurationManager
+     *
+     * @throws IllegalStateException Occurs if a ConfigurationManager cannot be identified
+     */
     public static ConfigurationManager getConfigurationManager(Kernel kernel) {
-        Set names = kernel.listGBeans(CONFIGURATION_MANAGER_QUERY);
+        Set names = kernel.listGBeans(new GBeanQuery(null, ConfigurationManager.class.getName()));
         for (Iterator iterator = names.iterator(); iterator.hasNext();) {
             ObjectName objectName = (ObjectName) iterator.next();
             try {
@@ -48,13 +54,43 @@
             }
         }
         if (names.isEmpty()) {
-            throw new IllegalStateException("Configuration mananger could not be found in kernel: " + CONFIGURATION_MANAGER_QUERY);
+            throw new IllegalStateException("Configuration mananger could not be found in kernel");
         }
         if (names.size() > 1) {
-            throw new IllegalStateException("More then one configuration mananger was found in kernel: " + CONFIGURATION_MANAGER_QUERY);
+            throw new IllegalStateException("More than one configuration mananger was found in kernel");
         }
         ObjectName configurationManagerName = (ObjectName) names.iterator().next();
         return (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
+    }
+
+    /**
+     * Gets a reference or proxy to an EditableConfigurationManager running in the specified kernel, if there is one.
+     *
+     * @return The EdtiableConfigurationManager, or none if there is not one available.
+     *
+     * @throws IllegalStateException Occurs if there are multiple EditableConfigurationManagers in the kernel.
+     */
+    public static EditableConfigurationManager getEditableConfigurationManager(Kernel kernel) {
+        Set names = kernel.listGBeans(new GBeanQuery(null, EditableConfigurationManager.class.getName()));
+        for (Iterator iterator = names.iterator(); iterator.hasNext();) {
+            ObjectName objectName = (ObjectName) iterator.next();
+            try {
+                if (kernel.getGBeanState(objectName) != State.RUNNING_INDEX) {
+                    iterator.remove();
+                }
+            } catch (GBeanNotFoundException e) {
+                // bean died
+                iterator.remove();
+            }
+        }
+        if (names.isEmpty()) {
+            return null; // may be one, just not editable
+        }
+        if (names.size() > 1) {
+            throw new IllegalStateException("More than one configuration mananger was found in kernel");
+        }
+        ObjectName configurationManagerName = (ObjectName) names.iterator().next();
+        return (EditableConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, EditableConfigurationManager.class);
     }
 
     public static void releaseConfigurationManager(Kernel kernel, ConfigurationManager configurationManager) {

Added: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java?rev=344897&view=auto
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java (added)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java Tue Nov 15 21:41:39 2005
@@ -0,0 +1,47 @@
+/**
+ *
+ * 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.kernel.config;
+
+import java.net.URI;
+import javax.management.ObjectName;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+
+/**
+ * A specialized ConfigurationManager that can change the set of GBeans
+ * included in the configuration at runtime.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public interface EditableConfigurationManager extends ConfigurationManager {
+    /**
+     * Adds a new GBean to an existing Configuration.
+     * @param configID  The configuration to add the GBean to.
+     * @param gbean     The data representing the GBean to add.
+     * @param start     If true, the GBean should be started as part of this call.
+     */
+    void addGBeanToConfiguration(URI configID, GBeanData gbean, boolean start) throws InvalidConfigException;
+
+    /**
+     * Removes a GBean from a configuration.  Note: this may simply mark it to
+     * not be loaded in the future, as opposed to actually removing it from
+     * the data in the config store.
+     * @param configID  The configuration to remove the GBean from.
+     * @param gbean     The ObjectName of the GBean to remove.
+     */
+    void removeGBeanFromConfiguration(URI configID, ObjectName gbean) throws InvalidConfigException, GBeanNotFoundException;
+}

Propchange: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message