geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r391894 [1/3] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/ applications/console-standard/src/jav...
Date Thu, 06 Apr 2006 04:00:37 GMT
Author: ammulder
Date: Wed Apr  5 21:00:33 2006
New Revision: 391894

URL: http://svn.apache.org/viewcvs?rev=391894&view=rev
Log:
Initial update to management API and console (still plenty to go)

Added:
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEDomain.java   (with props)
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/LoginService.java   (with props)
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/SecurityRealm.java   (with props)
Modified:
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorInfo.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/ConnectorPortlet.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/webmanager/WebManagerPortlet.java
    geronimo/branches/1.1/modules/connector-builder/project.xml
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/branches/1.1/modules/deploy-jsr88/project.xml
    geronimo/branches/1.1/modules/deploy-jsr88/src/java/org/apache/geronimo/deployment/plugin/local/CommandSupport.java
    geronimo/branches/1.1/modules/j2ee/project.xml
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java
    geronimo/branches/1.1/modules/jetty-builder/project.xml
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/branches/1.1/modules/management/project.xml
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSBroker.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JMSManager.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/NetworkManager.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/WebManager.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleChain.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/JaasLoginModuleUse.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/server/JaasLoginService.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/jaas/server/JaasLoginServiceMBean.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/realm/SecurityRealm.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/WebAppUtil.java
    geronimo/branches/1.1/modules/tomcat-builder/project.xml
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java Wed Apr  5 21:00:33 2006
@@ -16,28 +16,6 @@
  */
 package org.apache.geronimo.console.util;
 
-import java.io.IOException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.security.auth.Subject;
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.LoginException;
-import javax.security.auth.spi.LoginModule;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
@@ -47,12 +25,10 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJB;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEDeployedObject;
-import org.apache.geronimo.management.J2EEDomain;
 import org.apache.geronimo.management.J2EEModule;
 import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.JCAConnectionFactory;
@@ -63,28 +39,35 @@
 import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.Servlet;
 import org.apache.geronimo.management.WebModule;
-import org.apache.geronimo.management.geronimo.EJBConnector;
-import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.J2EEApplication;
+import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAResource;
-import org.apache.geronimo.management.geronimo.JMSBroker;
-import org.apache.geronimo.management.geronimo.JMSConnector;
-import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JVM;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
-import org.apache.geronimo.management.geronimo.WebAccessLog;
-import org.apache.geronimo.management.geronimo.WebConnector;
-import org.apache.geronimo.management.geronimo.WebContainer;
-import org.apache.geronimo.management.geronimo.WebManager;
-import org.apache.geronimo.pool.GeronimoExecutor;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
-import org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean;
-import org.apache.geronimo.security.realm.SecurityRealm;
 import org.apache.geronimo.system.logging.SystemLog;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.security.auth.Subject;
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.NameCallback;
+import javax.security.auth.callback.PasswordCallback;
+import javax.security.auth.callback.UnsupportedCallbackException;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.spi.LoginModule;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 
 /**
  * An implementation of the ManagementHelper interface that uses a Geronimo
@@ -489,296 +472,6 @@
         return result;
     }
 
-    public Repository[] getRepositories(J2EEServer server) {
-        Repository[] result = new Repository[0];
-        try {
-            String[] names = server.getRepositories();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new Repository[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up repositories for J2EEServer", e);
-        }
-        return result;
-    }
-
-    public SecurityRealm[] getSecurityRealms(J2EEServer server) {
-        SecurityRealm[] result = new SecurityRealm[0];
-        try {
-            String[] names = server.getSecurityRealms();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new SecurityRealm[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up security realms for J2EEServer", e);
-        }
-        return result;
-    }
-
-    public ServerInfo getServerInfo(J2EEServer server) {
-        try {
-            String name = server.getServerInfo();
-            return (ServerInfo) pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-        } catch (Exception e) {
-            log.error("Unable to look up ServerInfo for J2EEServer", e);
-            return null;
-        }
-    }
-
-    public JaasLoginServiceMBean getLoginService(J2EEServer server) {
-        try {
-            String name = server.getServerInfo();
-            return (JaasLoginServiceMBean) pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-        } catch (Exception e) {
-            log.error("Unable to look up LoginService for J2EEServer", e);
-            return null;
-        }
-    }
-
-    public WebManager[] getWebManagers(J2EEServer server) {
-        WebManager[] result = new WebManager[0];
-        try {
-            String[] names = server.getWebManagers();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebManager[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up WebManagers for J2EEServer", e);
-        }
-        return result;
-    }
-
-    public WebAccessLog getWebAccessLog(WebManager manager, WebContainer container) {
-        return getWebAccessLog(manager, kernel.getAbstractNameFor(container).getObjectName().getCanonicalName());
-    }
-
-    public WebAccessLog getWebAccessLog(WebManager manager, String container) {
-        WebAccessLog result = null;
-        try {
-            AbstractName name = manager.getAccessLog(container);
-            Object temp = pm.createProxy(name, KernelManagementHelper.class.getClassLoader());
-            result = (WebAccessLog) temp;
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public WebContainer[] getWebContainers(WebManager manager) {
-        WebContainer[] result = new WebContainer[0];
-        try {
-            AbstractName[] names = manager.getContainers();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebContainer[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container, String protocol) {
-        return getWebConnectorsForContainer(manager, kernel.getAbstractNameFor(container).getObjectName().getCanonicalName(), protocol);
-    }
-
-    public WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container) {
-        return getWebConnectorsForContainer(manager, kernel.getAbstractNameFor(container).getObjectName().getCanonicalName());
-    }
-
-    public WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName, String protocol) {
-        WebConnector[] result = new WebConnector[0];
-        try {
-            AbstractName name = new AbstractName(URI.create(containerObjectName));
-            AbstractName[] names = manager.getConnectorsForContainer(name, protocol);
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebConnector[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName) {
-        WebConnector[] result = new WebConnector[0];
-        try {
-            AbstractName name = new AbstractName(URI.create(containerObjectName));
-            AbstractName[] names = manager.getConnectorsForContainer(name);
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebConnector[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public WebConnector[] getWebConnectors(WebManager manager, String protocol) {
-        WebConnector[] result = new WebConnector[0];
-        try {
-            AbstractName[] names = manager.getConnectors(protocol);
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebConnector[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public WebConnector[] getWebConnectors(WebManager manager) {
-        WebConnector[] result = new WebConnector[0];
-        try {
-            AbstractName[] names = manager.getConnectors();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new WebConnector[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public EJBManager[] getEJBManagers(J2EEServer server) {
-        EJBManager[] result = null;
-        try {
-            String names[] = server.getEJBManagers();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new EJBManager[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public EJBConnector[] getEJBConnectors(EJBManager container, String protocol) {
-        EJBConnector[] result = new EJBConnector[0];
-        try {
-            AbstractName[] names = container.getConnectors(protocol);
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new EJBConnector[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public EJBConnector[] getEJBConnectors(EJBManager container) {
-        EJBConnector[] result = new EJBConnector[0];
-        try {
-            AbstractName[] 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[] getJMSManagers(J2EEServer server) {
-        JMSManager[] result = null;
-        try {
-            String[] names = server.getJMSManagers();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new JMSManager[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
-    public JMSBroker[] getJMSBrokers(JMSManager manager) {
-        JMSBroker[] result = null;
-        try {
-            AbstractName[] names = manager.getContainers();
-            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 {
-            AbstractName[] 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 {
-            AbstractName[] 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[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker, String protocol) {
-        return getJMSConnectorsForContainer(manager, kernel.getAbstractNameFor(broker).getObjectName().getCanonicalName(), protocol);
-    }
-
-    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker) {
-        return getJMSConnectorsForContainer(manager, kernel.getAbstractNameFor(broker).getObjectName().getCanonicalName());
-    }
-
-    public JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName, String protocol) {
-        JMSConnector[] result = null;
-        try {
-            AbstractName name = new AbstractName(URI.create(brokerObjectName));
-            AbstractName[] names = manager.getConnectorsForContainer(name, 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[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName) {
-        JMSConnector[] result = null;
-        try {
-            AbstractName name = new AbstractName(URI.create(brokerObjectName));
-            AbstractName[] names = manager.getConnectorsForContainer(name);
-            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 GeronimoExecutor[] getThreadPools(J2EEServer server) {
-        GeronimoExecutor[] result = new GeronimoExecutor[0];
-        try {
-            String[] names = server.getThreadPools();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new GeronimoExecutor[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
-    }
-
     public SystemLog getSystemLog(JVM jvm) {
         SystemLog result = null;
         try {
@@ -1001,19 +694,12 @@
         }
     }
 
-    public Object getObject(String objectName) {
-        try {
-            return kernel.getProxyManager().createProxy(ObjectName.getInstance(objectName), KernelManagementHelper.class.getClassLoader());
-        } catch (MalformedObjectNameException e) {
-            log.error("Unable to look up related GBean", e);
-            return null;
-        }
+    public Object getObject(AbstractName objectName) {
+        return kernel.getProxyManager().createProxy(objectName, KernelManagementHelper.class.getClassLoader());
     }
 
-    public Artifact getConfigurationNameFor(String objectName) {
+    public Artifact getConfigurationNameFor(AbstractName abstractName) {
         try {
-            //TODO the code that calls this does not supply an abstract name
-            AbstractName abstractName = new AbstractName(URI.create(objectName));
             return abstractName.getArtifact();
 //            Set parents = kernel.getDependencyManager().getParents(ObjectName.getInstance(objectName));
 //            if(parents.size() == 0) {
@@ -1031,35 +717,25 @@
         return null;
     }
 
-    public String getGBeanDescription(String objectName) {
+    public String getGBeanDescription(AbstractName abstractName) {
         try {
-            return kernel.getGBeanInfo(ObjectName.getInstance(objectName)).getName();
+            return kernel.getGBeanInfo(abstractName).getName();
         } catch (GBeanNotFoundException e) {
             return null;
-        } catch (MalformedObjectNameException e) {
-            return "Invalid object name";
         }
     }
 
     public void testLoginModule(J2EEServer server, LoginModule module, Map options) {
         options.put(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION, kernel.getKernelName());
         options.put(JaasLoginModuleUse.CLASSLOADER_LM_OPTION, module.getClass().getClassLoader());
-        try {
-            options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, pm.createProxy(ObjectName.getInstance(server.getServerInfo()),module.getClass().getClassLoader()));
-        } catch (MalformedObjectNameException e) {
-            throw new IllegalStateException("Unable to look up server info: "+e.getMessage());
-        }
+        options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
         module.initialize(null, null, new HashMap(), options);
     }
 
     public Subject testLoginModule(final J2EEServer server, final LoginModule module, final Map options, final String username, final String password) throws LoginException {
         options.put(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION, kernel.getKernelName());
         options.put(JaasLoginModuleUse.CLASSLOADER_LM_OPTION, module.getClass().getClassLoader());
-        try {
-            options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, pm.createProxy(ObjectName.getInstance(server.getServerInfo()),module.getClass().getClassLoader()));
-        } catch (MalformedObjectNameException e) {
-            throw new IllegalStateException("Unable to look up server info: "+e.getMessage());
-        }
+        options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
         Subject sub = new Subject();
         CallbackHandler handler = new CallbackHandler() {
             public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
@@ -1095,6 +771,10 @@
         return result;
     }
 
+    public AbstractName getNameFor(Object component) {
+        return kernel.getAbstractNameFor(component);
+    }
+
     /**
      * Helper method to connect to a remote kernel.
      */
@@ -1108,42 +788,5 @@
         javax.management.MBeanServerConnection mbServerConnection = jmxConnector.getMBeanServerConnection();
         Kernel kernel = new org.apache.geronimo.kernel.jmx.KernelDelegate(mbServerConnection);
         return new KernelManagementHelper(kernel);
-    }
-
-    /**
-     * For test purposes; start the server, deploy an app or two, and run this.
-     * Should be changed to a JUnit test with the Maven plugin to start and
-     * stop the server.
-     */
-    public static void main(String[] args) {
-        try {
-            ManagementHelper mgr = getRemoteKernelManager("localhost", "system", "manager");
-            J2EEDomain domain = mgr.getDomains()[0];
-            System.out.println("Found domain "+domain.getObjectName()+" with "+domain.getServers().length+" servers");
-            J2EEServer server = mgr.getServers(domain)[0];
-            System.out.println("Found server "+server.getObjectName()+" with "+server.getDeployedObjects().length+" deployments");
-            System.out.println("  "+mgr.getApplications(server).length+" applications");
-            System.out.println("  "+mgr.getAppClients(server).length+" app clients");
-            System.out.println("  "+mgr.getEJBModules(server).length+" EJB JARs");
-            System.out.println("  "+mgr.getWebModules(server).length+" web apps");
-            System.out.println("  "+mgr.getRAModules(server).length+" RA modules");
-            J2EEDeployedObject[] deployments = mgr.getDeployedObjects(server);
-            for (int i = 0; i < deployments.length; i++) {
-                J2EEDeployedObject deployment = deployments[i];
-                System.out.println("Deployment "+i+": "+deployment.getObjectName());
-            }
-            J2EEApplication[] applications = mgr.getApplications(server);
-            for (int i = 0; i < applications.length; i++) {
-                J2EEApplication app = applications[i];
-                System.out.println("Application "+i+": "+app.getObjectName());
-                J2EEModule[] modules = mgr.getModules(app);
-                for (int j = 0; j < modules.length; j++) {
-                    J2EEModule deployment = modules[j];
-                    System.out.println("  Module "+j+": "+deployment.getObjectName());
-                }
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
     }
 }

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java (original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/ManagementHelper.java Wed Apr  5 21:00:33 2006
@@ -16,13 +16,11 @@
  */
 package org.apache.geronimo.console.util;
 
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJB;
 import org.apache.geronimo.management.EJBModule;
-import org.apache.geronimo.management.J2EEDeployedObject;
-import org.apache.geronimo.management.J2EEDomain;
 import org.apache.geronimo.management.J2EEModule;
 import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.JCAConnectionFactory;
@@ -33,27 +31,15 @@
 import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.Servlet;
 import org.apache.geronimo.management.WebModule;
-import org.apache.geronimo.management.geronimo.EJBConnector;
-import org.apache.geronimo.management.geronimo.EJBManager;
 import org.apache.geronimo.management.geronimo.J2EEApplication;
+import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAResource;
-import org.apache.geronimo.management.geronimo.JMSBroker;
-import org.apache.geronimo.management.geronimo.JMSConnector;
-import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JVM;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
-import org.apache.geronimo.management.geronimo.WebAccessLog;
-import org.apache.geronimo.management.geronimo.WebConnector;
-import org.apache.geronimo.management.geronimo.WebContainer;
-import org.apache.geronimo.management.geronimo.WebManager;
-import org.apache.geronimo.pool.GeronimoExecutor;
-import org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean;
-import org.apache.geronimo.security.realm.SecurityRealm;
 import org.apache.geronimo.system.logging.SystemLog;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
 
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginException;
@@ -70,12 +56,7 @@
     // root properties
     J2EEDomain[] getDomains();
 
-    // domain properties
-    J2EEServer[] getServers(J2EEDomain domain);
-    // todo: security realm
-
     // server properties
-    J2EEDeployedObject[] getDeployedObjects(J2EEServer server);
     J2EEApplication[] getApplications(J2EEServer server);
     AppClientModule[] getAppClients(J2EEServer server);
     WebModule[] getWebModules(J2EEServer server);
@@ -85,41 +66,10 @@
     ResourceAdapterModule[] getOutboundRAModules(J2EEServer server, String[] connectionFactoryInterfaces);
     ResourceAdapterModule[] getAdminObjectModules(J2EEServer server, String[] adminObjectInterfaces);
     JCAManagedConnectionFactory[] getOutboundFactories(J2EEServer server, String connectionFactoryInterface);
-    J2EEResource[] getResources(J2EEServer server);
     JCAResource[] getJCAResources(J2EEServer server);
     JDBCResource[] getJDBCResources(J2EEServer server);
     JMSResource[] getJMSResources(J2EEServer server);
     JVM[] getJavaVMs(J2EEServer server);
-    Repository[] getRepositories(J2EEServer server);
-    SecurityRealm[] getSecurityRealms(J2EEServer server);
-    ServerInfo getServerInfo(J2EEServer server);
-    JaasLoginServiceMBean getLoginService(J2EEServer server);
-    WebManager[] getWebManagers(J2EEServer server);
-    WebAccessLog getWebAccessLog(WebManager manager, WebContainer container);
-    WebAccessLog getWebAccessLog(WebManager manager, String containerObjectName);
-    WebContainer[] getWebContainers(WebManager manager);
-    WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container, String protocol);
-    WebConnector[] getWebConnectorsForContainer(WebManager manager, WebContainer container);
-    WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName, String protocol);
-    WebConnector[] getWebConnectorsForContainer(WebManager manager, String containerObjectName);
-    WebConnector[] getWebConnectors(WebManager manager, String protocol);
-    WebConnector[] getWebConnectors(WebManager manager);
-    EJBManager[] getEJBManagers(J2EEServer server);
-//todo    EJBContainer[] getEJBContainers(EJBManager manager);
-//todo    EJBConnector[] getEJBConnectors(EJBManager manager, EJBContainer container, String protocol);
-//todo    EJBConnector[] getEJBConnectors(EJBManager manager, EJBContainer container);
-    EJBConnector[] getEJBConnectors(EJBManager container, String protocol);
-    EJBConnector[] getEJBConnectors(EJBManager container);
-    JMSManager[] getJMSManagers(J2EEServer server);
-    JMSBroker[] getJMSBrokers(JMSManager manager);
-    JMSConnector[] getJMSConnectors(JMSManager manager, String protocol);
-    JMSConnector[] getJMSConnectors(JMSManager manager);
-    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker, String protocol);
-    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, JMSBroker broker);
-    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName, String protocol);
-    JMSConnector[] getJMSConnectorsForContainer(JMSManager manager, String brokerObjectName);
-    GeronimoExecutor[] getThreadPools(J2EEServer server);
-    //todo: repository, embedded database
 
     // JVM properties
     SystemLog getSystemLog(JVM jvm);
@@ -155,12 +105,13 @@
     JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory);
 
     // Generic utility methods
-    Object getObject(String objectName);
-    Artifact getConfigurationNameFor(String objectName);
-    String getGBeanDescription(String objectName);
+    Object getObject(AbstractName abstractName);
+    Artifact getConfigurationNameFor(AbstractName abstractName);
+    String getGBeanDescription(AbstractName abstractName);
 
     // Misc
     void testLoginModule(J2EEServer server, LoginModule module, Map options);
     Subject testLoginModule(J2EEServer server, LoginModule module, Map options, String username, String password) throws LoginException;
     Object[] findByInterface(Class iface);
+    AbstractName getNameFor(Object component);
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/databasemanager/wizard/DatabasePoolPortlet.java Wed Apr  5 21:00:33 2006
@@ -47,6 +47,7 @@
 import org.apache.geronimo.kernel.repository.WriteableRepository;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
+import org.apache.geronimo.gbean.AbstractName;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -87,6 +88,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URI;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.Driver;
@@ -504,8 +506,8 @@
         }
     }
 
-    private ResourceAdapterParams loadConfigPropertiesByObjectName(PortletRequest request, String objectName) {
-        ResourceAdapterModule module = (ResourceAdapterModule) PortletManager.getManagedBean(request, objectName);
+    private ResourceAdapterParams loadConfigPropertiesByObjectName(PortletRequest request, String abstractName) {
+        ResourceAdapterModule module = (ResourceAdapterModule) PortletManager.getManagedBean(request, new AbstractName(URI.create(abstractName)));
         String dd = module.getDeploymentDescriptor();
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setValidating(false);
@@ -563,8 +565,8 @@
     }
 
     private void loadConnectionFactory(ActionRequest actionRequest, String adapterName, String factoryName, PoolData data) {
-        ResourceAdapterModule adapter = (ResourceAdapterModule) PortletManager.getManagedBean(actionRequest, adapterName);
-        JCAManagedConnectionFactory factory = (JCAManagedConnectionFactory) PortletManager.getManagedBean(actionRequest, factoryName);
+        ResourceAdapterModule adapter = (ResourceAdapterModule) PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(adapterName)));
+        JCAManagedConnectionFactory factory = (JCAManagedConnectionFactory) PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(factoryName)));
         data.adapterDisplayName = adapter.getDisplayName();
         data.adapterDescription = adapter.getDescription();
         try {
@@ -587,7 +589,7 @@
             log.error("Unable to look up connection property", e);
         }
         //todo: push the lookup into ManagementHelper
-        PoolingAttributes pool = (PoolingAttributes) PortletManager.getManagedBean(actionRequest, factory.getConnectionManager());
+        PoolingAttributes pool = (PoolingAttributes) factory.getConnectionManager();
         data.minSize = Integer.toString(pool.getPartitionMinSize());
         data.maxSize = Integer.toString(pool.getPartitionMaxSize());
         data.blockingTimeout = Integer.toString(pool.getBlockingTimeoutMilliseconds());
@@ -682,7 +684,7 @@
     }
 
     private void renderEdit(RenderRequest renderRequest, RenderResponse renderResponse, PoolData data) throws IOException, PortletException {
-        if(data.objectName == null || data.objectName.equals("")) {
+        if(data.abstractName == null || data.abstractName.equals("")) {
             loadDriverJARList(renderRequest);
         }
         if(!data.isGeneric()) {
@@ -779,7 +781,7 @@
         renderRequest.setAttribute("deploymentPlan", renderRequest.getPortletSession().getAttribute("deploymentPlan"));
         // Digest the RAR URI
         String path = PortletManager.getRepositoryEntry(renderRequest, data.getRarPath()).getPath();
-        String base = PortletManager.getServerInfo(renderRequest).getCurrentBaseDirectory();
+        String base = PortletManager.getCurrentServer(renderRequest).getServerInfo().getCurrentBaseDirectory();
         if(base != null && path.startsWith(base)) {
             path = path.substring(base.length());
             if(path.startsWith("/")) {
@@ -818,7 +820,7 @@
 
     private static String save(PortletRequest request, ActionResponse response, PoolData data, boolean planOnly) {
         ImportStatus status = getImportStatus(request);
-        if(data.objectName == null || data.objectName.equals("")) { // we're creating a new pool
+        if(data.abstractName == null || data.abstractName.equals("")) { // we're creating a new pool
             data.name = data.name.replaceAll("\\s", "");
             DeploymentManager mgr = PortletManager.getDeploymentManager(request);
             try {
@@ -949,7 +951,7 @@
                 throw new UnsupportedOperationException("Can't update a plan for an existing deployment");
             }
             try {
-                JCAManagedConnectionFactory factory = (JCAManagedConnectionFactory) PortletManager.getManagedBean(request, data.getObjectName());
+                JCAManagedConnectionFactory factory = (JCAManagedConnectionFactory) PortletManager.getManagedBean(request, new AbstractName(URI.create(data.getAbstractName())));
                 if(data.isGeneric()) {
                     factory.setConfigProperty("connectionURL", data.getUrl());
                     factory.setConfigProperty("userName", data.getUser());
@@ -961,7 +963,7 @@
                     }
                 }
                 //todo: push the lookup into ManagementHelper
-                PoolingAttributes pool = (PoolingAttributes) PortletManager.getManagedBean(request, factory.getConnectionManager());
+                PoolingAttributes pool = (PoolingAttributes) factory.getConnectionManager();
                 pool.setPartitionMinSize(data.minSize == null || data.minSize.equals("") ? 0 : Integer.parseInt(data.minSize));
                 pool.setPartitionMaxSize(data.maxSize == null || data.maxSize.equals("") ? 10 : Integer.parseInt(data.maxSize));
                 pool.setBlockingTimeoutMilliseconds(data.blockingTimeout == null || data.blockingTimeout.equals("") ? 5000 : Integer.parseInt(data.blockingTimeout));
@@ -989,7 +991,7 @@
 
     private static File getRAR(PortletRequest request, String rarPath) {
         org.apache.geronimo.kernel.repository.Artifact uri = org.apache.geronimo.kernel.repository.Artifact.create(rarPath);
-        Repository[] repos = PortletManager.getRepositories(request);
+        Repository[] repos = PortletManager.getCurrentServer(request).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             Repository repo = repos[i];
             File url = repo.getLocation(uri);
@@ -1119,7 +1121,7 @@
         private String maxSize;
         private String blockingTimeout;
         private String idleTimeout;
-        private String objectName;
+        private String abstractName;
         private String adapterDisplayName;
         private String adapterDescription;
         private String rarPath;
@@ -1159,8 +1161,8 @@
             if(blockingTimeout != null && blockingTimeout.equals("")) blockingTimeout = null;
             idleTimeout = request.getParameter("idleTimeout");
             if(idleTimeout != null && idleTimeout.equals("")) idleTimeout = null;
-            objectName = request.getParameter("objectName");
-            if(objectName != null && objectName.equals("")) objectName = null;
+            abstractName = request.getParameter("objectName");
+            if(abstractName != null && abstractName.equals("")) abstractName = null;
             adapterDisplayName = request.getParameter("adapterDisplayName");
             if(adapterDisplayName != null && adapterDisplayName.equals("")) adapterDisplayName = null;
             adapterDescription = request.getParameter("adapterDescription");
@@ -1231,7 +1233,7 @@
             if(maxSize != null) response.setRenderParameter("maxSize", maxSize);
             if(blockingTimeout != null) response.setRenderParameter("blockingTimeout", blockingTimeout);
             if(idleTimeout != null) response.setRenderParameter("idleTimeout", idleTimeout);
-            if(objectName != null) response.setRenderParameter("objectName", objectName);
+            if(abstractName != null) response.setRenderParameter("objectName", abstractName);
             if(adapterDisplayName != null) response.setRenderParameter("adapterDisplayName", adapterDisplayName);
             if(adapterDescription != null) response.setRenderParameter("adapterDescription", adapterDescription);
             if(importSource != null) response.setRenderParameter("importSource", importSource);
@@ -1318,8 +1320,15 @@
             return urlPrototype;
         }
 
+        /**
+         * @deprecated Use getAbstractName instead
+         */
         public String getObjectName() {
-            return objectName;
+            return abstractName;
+        }
+
+        public String getAbstractName() {
+            return abstractName;
         }
 
         public String getAdapterDisplayName() {
@@ -1344,10 +1353,10 @@
         }
 
         public Map getObjectNameMap() {
-            if(objectName == null) return Collections.EMPTY_MAP;
+            if(abstractName == null) return Collections.EMPTY_MAP;
             if(objectNameMap != null) return objectNameMap;
             try {
-                ObjectName name = new ObjectName(objectName);
+                ObjectName name = new ObjectName(abstractName);
                 objectNameMap = new HashMap(name.getKeyPropertyList());
                 objectNameMap.put("domain", name.getDomain());
                 return objectNameMap;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/activemqCF/ActiveMQConnectorHelper.java Wed Apr  5 21:00:33 2006
@@ -134,7 +134,7 @@
             file.deleteOnExit();
             savePlan(file, args);
             if(MODULE_FILE == null) {
-                MODULE_FILE = PortletManager.getServerInfo(request).resolvePath(ACTIVEMQ_RAR);
+                MODULE_FILE = PortletManager.getCurrentServer(request).getServerInfo().resolvePath(ACTIVEMQ_RAR);
             }
             deployPlan(new File(MODULE_FILE), file);
         } catch (IOException e) {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/BaseJMSPortlet.java Wed Apr  5 21:00:33 2006
@@ -16,15 +16,16 @@
  */
 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.gbean.AbstractName;
 import org.apache.geronimo.management.geronimo.JMSBroker;
-import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
+import org.apache.geronimo.management.geronimo.JMSManager;
+
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 /**
  * Common methods for JMS portlets
@@ -32,18 +33,17 @@
  * @version $Rev$ $Date$
  */
 public class BaseJMSPortlet extends BasePortlet {
-    protected static Map getBrokerMap(RenderRequest renderRequest, String managerObjectName) throws PortletException {
-        JMSBroker[] brokers;
+    /**
+     * Gets a Map relating broker name to JMSBroker instance
+     */
+    protected static Map getBrokerMap(RenderRequest renderRequest, JMSManager manager) throws PortletException {
+
+        JMSBroker[] brokers = (JMSBroker[]) manager.getContainers();
         Map map = new LinkedHashMap();
         try {
-            String[] names = PortletManager.getJMSBrokerNames(renderRequest, managerObjectName);
-            brokers = new JMSBroker[names.length];
-            for (int i = 0; i < names.length; i++) {
-                String name = names[i];
-                JMSBroker broker = PortletManager.getJMSBroker(renderRequest, name);
-                brokers[i] = broker;
-                ObjectName objectName = ObjectName.getInstance(name);
-                map.put(objectName.getKeyProperty("name"), broker);
+            for (int i = 0; i < brokers.length; i++) {
+                AbstractName name = PortletManager.getNameFor(renderRequest, brokers[i]);
+                map.put(name.getName().get("name"), brokers[i]);
             }
         } catch (Exception e) {
             throw new PortletException(e);

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSBrokerPortlet.java Wed Apr  5 21:00:33 2006
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.util.Map;
+import java.net.URI;
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -27,6 +28,8 @@
 import javax.portlet.WindowState;
 import javax.portlet.PortletConfig;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -51,13 +54,13 @@
             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();
+                    PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(name))).startRecursive();
                 } catch (Exception e) {
                     throw new PortletException(e);
                 }
             } else if(mode.equals("stop")) {
                 try {
-                    PortletManager.getManagedBean(actionRequest, name).stop();
+                    PortletManager.getManagedBean(actionRequest,  new AbstractName(URI.create(name))).stop();
                 } catch (Exception e) {
                     throw new PortletException(e);
                 }
@@ -83,8 +86,8 @@
             if (WindowState.MINIMIZED.equals(renderRequest.getWindowState())) {
                 return;
             }
-            String managerName = PortletManager.getJMSManagerNames(renderRequest)[0];  //todo: handle multiple
-            Map map = getBrokerMap(renderRequest, managerName);
+            JMSManager manager = PortletManager.getCurrentServer(renderRequest).getJMSManagers()[0];  //todo: handle multiple
+            Map map = getBrokerMap(renderRequest, manager);
             renderRequest.setAttribute("brokers", map.entrySet());
             if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
                 normalView.include(renderRequest, renderResponse);

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/server/JMSConnectorPortlet.java Wed Apr  5 21:00:33 2006
@@ -36,6 +36,7 @@
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.geronimo.management.geronimo.JMSConnector;
 import org.apache.geronimo.management.geronimo.JMSManager;
+import org.apache.geronimo.management.geronimo.JMSBroker;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -60,14 +61,14 @@
                               ActionResponse actionResponse) throws PortletException, IOException {
         try {
             String mode = actionRequest.getParameter("mode");
-            String managerName = PortletManager.getJMSManagerNames(actionRequest)[0];  //todo: handle multiple
-            String brokerName = actionRequest.getParameter("brokerName");
+            JMSManager manager = PortletManager.getCurrentServer(actionRequest).getJMSManagers()[0];  //todo: handle multiple
+            AbstractName brokerName = new AbstractName(URI.create(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);
+                actionResponse.setRenderParameter("brokerName", brokerName.toString());
             } else if(mode.equals("add")) { // User just submitted the form to add a new connector
                 // Get submitted values
                 //todo: lots of validation
@@ -76,7 +77,7 @@
                 int port = Integer.parseInt(actionRequest.getParameter("port"));
                 String name = actionRequest.getParameter("name");
                 // Create and configure the connector
-                JMSConnector connector = PortletManager.createJMSConnector(actionRequest, managerName, brokerName, name, protocol, host, port);
+                JMSConnector connector = PortletManager.createJMSConnector(actionRequest, manager, brokerName, name, protocol, host, port);
                 // Start the connector
                 try {
                     ((GeronimoManagedBean)connector).startRecursive();
@@ -89,26 +90,26 @@
                 //todo: lots of validation
                 String host = actionRequest.getParameter("host");
                 int port = Integer.parseInt(actionRequest.getParameter("port"));
-                String objectName = actionRequest.getParameter("objectName");
+                String abstractNameString = actionRequest.getParameter("objectName");
                 // Identify and update the connector
-                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(actionRequest, objectName);
+                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(abstractNameString)));
                 if(connector != null) {
                     connector.setHost(host);
                     connector.setPort(port);
                 }
                 actionResponse.setRenderParameter("mode", "list");
             } else if(mode.equals("start")) {
-                String objectName = actionRequest.getParameter("objectName");
+                String abstractNameString = actionRequest.getParameter("objectName");
                 try {
-                    PortletManager.getManagedBean(actionRequest, objectName).startRecursive();
+                    PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(abstractNameString))).startRecursive();
                 } catch (Exception e) {
                     throw new PortletException(e);
                 }
                 actionResponse.setRenderParameter("mode", "list");
             } else if(mode.equals("stop")) {
-                String objectName = actionRequest.getParameter("objectName");
+                String abstractNameString = actionRequest.getParameter("objectName");
                 try {
-                    PortletManager.getManagedBean(actionRequest, objectName).stop();
+                    PortletManager.getManagedBean(actionRequest, new AbstractName(URI.create(abstractNameString))).stop();
                 } catch (Exception e) {
                     throw new PortletException(e);
                 }
@@ -118,8 +119,8 @@
                 actionResponse.setRenderParameter("objectName", objectName);
                 actionResponse.setRenderParameter("mode", "edit");
             } else if(mode.equals("delete")) {
-                String objectName = actionRequest.getParameter("objectName");
-                PortletManager.getJMSManager(actionRequest, managerName).removeConnector(new AbstractName(URI.create(objectName)));
+                String abstractNameString = actionRequest.getParameter("objectName");
+                manager.removeConnector(new AbstractName(URI.create(abstractNameString)));
                 actionResponse.setRenderParameter("mode", "list");
             }
         } catch (Throwable e) {
@@ -141,7 +142,7 @@
             if(mode == null || mode.equals("")) {
                 mode = "list";
             }
-            String managerName = PortletManager.getJMSManagerNames(renderRequest)[0];  //todo: handle multiple
+            JMSManager manager = PortletManager.getCurrentServer(renderRequest).getJMSManagers()[0];  //todo: handle multiple
 
             if(mode.equals("new")) {
                 String brokerName = renderRequest.getParameter("brokerName");
@@ -152,9 +153,9 @@
                 editView.include(renderRequest, renderResponse);
             } else if(mode.equals("edit")) {
                 String objectName = renderRequest.getParameter("objectName");
-                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(renderRequest, objectName);
+                JMSConnector connector = (JMSConnector)PortletManager.getManagedBean(renderRequest, new AbstractName(URI.create(objectName)));
                 if(connector == null) {
-                    doList(renderRequest, managerName, renderResponse);
+                    doList(renderRequest, manager, renderResponse);
                 } else {
                     renderRequest.setAttribute("objectName", objectName);
                     renderRequest.setAttribute("port", new Integer(connector.getPort()));
@@ -163,37 +164,36 @@
                     editView.include(renderRequest, renderResponse);
                 }
             } else if(mode.equals("list")) {
-                doList(renderRequest, managerName, renderResponse);
+                doList(renderRequest, manager, renderResponse);
             }
         } catch (Throwable e) {
             log.error("Unable to render portlet", e);
         }
     }
 
-    private void doList(RenderRequest renderRequest, String managerName, RenderResponse renderResponse) throws PortletException, IOException {
+    private void doList(RenderRequest renderRequest, JMSManager manager, RenderResponse renderResponse) throws PortletException, IOException {
         List beans = new ArrayList();
-        String[] brokerNames = PortletManager.getJMSBrokerNames(renderRequest, managerName);
-        for (int i = 0; i < brokerNames.length; i++) {
-            String brokerName = brokerNames[i];
+        JMSBroker[] brokers = (JMSBroker[]) manager.getContainers();
+        for (int i = 0; i < brokers.length; i++) {
+            JMSBroker broker = brokers[i];
+            AbstractName brokerName = PortletManager.getNameFor(renderRequest, broker);
             try {
-                ObjectName bon = ObjectName.getInstance(brokerName);
-                JMSConnector[] connectors = PortletManager.getJMSConnectorsForContainer(renderRequest, managerName, brokerName);
+                JMSConnector[] connectors = (JMSConnector[]) manager.getConnectorsForContainer(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(bon.getKeyProperty("name"), bon.getCanonicalName(),
-                                                                 connectorName, connector);
+                    ConnectorWrapper info = new ConnectorWrapper((String) brokerName.getName().get("name"),
+                                                                 brokerName.toString(), connectorName, connector);
                     beans.add(info);
                 }
             } catch (MalformedObjectNameException e) {
                 log.error("Unable to decode ObjectName", e);
             }
         }
-        renderRequest.setAttribute("brokers", getBrokerMap(renderRequest, managerName).entrySet());
+        renderRequest.setAttribute("brokers", getBrokerMap(renderRequest, manager).entrySet());
         renderRequest.setAttribute("connectors", beans);
-        JMSManager mgr = PortletManager.getJMSManager(renderRequest, managerName);
-        renderRequest.setAttribute("protocols", mgr.getSupportedProtocols());
+        renderRequest.setAttribute("protocols", manager.getSupportedProtocols());
 
         if (WindowState.NORMAL.equals(renderRequest.getWindowState())) {
             normalView.include(renderRequest, renderResponse);
@@ -224,21 +224,21 @@
         super.destroy();
     }
 
-    public final static boolean isValid(String s) {
+    public static boolean isValid(String s) {
         return s != null && !s.equals("");
     }
 
     public static class ConnectorWrapper {
         private String brokerName;
-        private String brokerObjectName;
+        private String brokerAbstractName;
         private String displayName;
         private JMSConnector connector;
 
-        public ConnectorWrapper(String brokerName, String brokerObjectName, String displayName, JMSConnector connector) {
+        public ConnectorWrapper(String brokerName, String brokerAbstractName, String displayName, JMSConnector connector) {
             this.brokerName = brokerName;
             this.displayName = displayName;
             this.connector = connector;
-            this.brokerObjectName = brokerObjectName;
+            this.brokerAbstractName = brokerAbstractName;
         }
 
         public String getBrokerName() {
@@ -253,8 +253,8 @@
             return connector;
         }
 
-        public String getBrokerObjectName() {
-            return brokerObjectName;
+        public String getBrokerAbstractName() {
+            return brokerAbstractName;
         }
     }
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ListScreenHandler.java Wed Apr  5 21:00:33 2006
@@ -98,7 +98,7 @@
                     if(name == null) {
                         name = ObjectName.getInstance(module.getObjectName()).getKeyProperty(NameFactory.J2EE_NAME);
                     }
-                    target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, module.getObjectName()).toString(),
+                    target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, PortletManager.getNameFor(renderRequest, module)).toString(),
                                                     module.getObjectName(), name, ((GeronimoManagedBean)module).getState());
                     resources.add(target);
                 }
@@ -138,7 +138,7 @@
                     if(name == null) {
                         name = ObjectName.getInstance(module.getObjectName()).getKeyProperty(NameFactory.J2EE_NAME);
                     }
-                    target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, module.getObjectName()).toString(),
+                    target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, PortletManager.getNameFor(renderRequest, module)).toString(),
                                                     module.getObjectName(), name, ((GeronimoManagedBean)module).getState());
                     resources.add(target);
                 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ShowPlanHandler.java Wed Apr  5 21:00:33 2006
@@ -46,7 +46,7 @@
         JMSResourceData data = (JMSResourceData) model;
         request.setAttribute("deploymentPlan", request.getPortletSession().getAttribute("deploymentPlan"));
         String path = PortletManager.getRepositoryEntry(request, data.getRarURI()).getPath();
-        String base = PortletManager.getServerInfo(request).getCurrentBaseDirectory();
+        String base = PortletManager.getCurrentServer(request).getServerInfo().getCurrentBaseDirectory();
         if(base != null && path.startsWith(base)) {
             path = path.substring(base.length());
             if(path.startsWith("/")) {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java Wed Apr  5 21:00:33 2006
@@ -22,7 +22,7 @@
 import uk.ltd.getahead.dwr.ExecutionContext;
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.console.util.ManagementHelper;
-import org.apache.geronimo.management.J2EEDomain;
+import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.StatisticsProvider;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JVM;
@@ -37,7 +37,7 @@
         HttpSession session = ExecutionContext.get().getSession();
         ManagementHelper helper = PortletManager.getManagementHelper(session);
         J2EEDomain[] domains = helper.getDomains();
-        J2EEServer[] servers = helper.getServers(domains[0]);
+        J2EEServer[] servers = domains[0].getServerInstances();
         JVM[] jvms = helper.getJavaVMs(servers[0]);
         long elapsed = System.currentTimeMillis() - jvms[0].getKernelBootTime().getTime();
         if(jvms[0].isStatisticsProvider()) {

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/logmanager/WebAccessLogViewerPortlet.java Wed Apr  5 21:00:33 2006
@@ -17,22 +17,29 @@
 
 package org.apache.geronimo.console.logmanager;
 
-import java.io.IOException;
-import java.util.Calendar;
-import java.util.Map;
-import java.util.LinkedHashMap;
-
-import javax.portlet.*;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.console.BasePortlet;
 import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.WebAccessLog;
+import org.apache.geronimo.management.geronimo.WebContainer;
 import org.apache.geronimo.management.geronimo.WebManager;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+import java.io.IOException;
+import java.util.Calendar;
+import java.util.LinkedHashMap;
+import java.util.Map;
 
 public class WebAccessLogViewerPortlet extends BasePortlet {
     private final static Log log = LogFactory.getLog(WebAccessLogViewerPortlet.class);
@@ -52,7 +59,7 @@
             return;
         }
 
-        String[] names = PortletManager.getWebManagerNames(renderRequest);
+        WebManager[] managers = PortletManager.getCurrentServer(renderRequest).getWebManagers();
 
         //todo: new
         Map products = new LinkedHashMap();
@@ -61,28 +68,24 @@
             renderRequest.setAttribute("selectedContainer", chosen);
         }
         WebAccessLog chosenLog = null;
-        if(names != null) {
-            for (int i = 0; i < names.length; i++) {
-                String webManagerName = names[i];
-                WebManager manager = (WebManager) PortletManager.getManagedBean(renderRequest, webManagerName);
-                String[] containers = PortletManager.getWebContainerNames(renderRequest, webManagerName);
+        if(managers != null) {
+            for (int i = 0; i < managers.length; i++) {
+                WebManager manager = managers[i];
+                AbstractName managerName = PortletManager.getNameFor(renderRequest, manager);
+                WebContainer[] containers = (WebContainer[]) manager.getContainers();
                 if (containers != null) {
                     for (int j = 0; j < containers.length; j++) {
-                        String containerName = containers[j];
-                        String combined = webManagerName+"%"+containerName;
+                        WebContainer container = containers[j];
+                        AbstractName containerName = PortletManager.getNameFor(renderRequest, container);
+                        String combined = managerName+"%"+containerName;
                         if(containers.length == 1) {
                             products.put(manager.getProductName(), combined);
                         } else {
-                            try {
-                                ObjectName containerON = ObjectName.getInstance(containerName);
-                                products.put(manager.getProductName()+" ("+containerON.getKeyProperty(NameFactory.J2EE_NAME)+")", combined);
-                            } catch (MalformedObjectNameException e) {
-                                log.error("Unable to parse ObjectName", e);
-                            }
+                            products.put(manager.getProductName()+" ("+containerName.getName().get(NameFactory.J2EE_NAME)+")", combined);
                         }
                         if(chosenLog == null) { // will pick the correct match, or the first if no selection is specified
                             if(chosen == null || chosen.equals(combined)) {
-                                chosenLog = PortletManager.getWebAccessLog(renderRequest, webManagerName, containerName);
+                                chosenLog = PortletManager.getWebAccessLog(renderRequest, managerName, containerName);
                             }
                         }
                     }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java?rev=391894&r1=391893&r2=391894&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/SecurityRealmPortlet.java Wed Apr  5 21:00:33 2006
@@ -46,6 +46,7 @@
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginConfigType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerLoginModuleType;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerOptionType;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
@@ -80,6 +81,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
+import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -203,7 +205,7 @@
             actionLoadExistingRealm(actionRequest, data);
             actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
         } else if(mode.equals(CONFIGURE_MODE)) {
-            if(data.getObjectName() != null || (data.getRealmType() != null && data.getRealmType().equals("Other"))) {
+            if(data.getAbstractName() != null || (data.getRealmType() != null && data.getRealmType().equals("Other"))) {
                 actionResponse.setRenderParameter(MODE_KEY, EDIT_MODE);
             } else {
                 actionResponse.setRenderParameter(MODE_KEY, CONFIGURE_MODE);
@@ -343,12 +345,10 @@
         realmName.setStringValue(data.getName());
         ReferenceType serverInfo = realm.addNewReference();
         serverInfo.setName2("ServerInfo");
-        //TODO configid unlikely to be correct
-        serverInfo.setName(PortletManager.getCurrentServer(request).getServerInfo());
+        serverInfo.setName((String)PortletManager.getNameFor(request, PortletManager.getCurrentServer(request).getServerInfo()).getName().get("name"));
         ReferenceType loginService = realm.addNewReference();
         loginService.setName2("LoginService");
-        //TODO configid unlikely to be correct
-        loginService.setName(PortletManager.getCurrentServer(request).getLoginService());
+        loginService.setName((String)PortletManager.getNameFor(request, PortletManager.getCurrentServer(request).getLoginService()).getName().get("name"));
         XmlAttributeType config = realm.addNewXmlReference();
         // Construct the content to put in the XmlAttributeType
         GerLoginConfigDocument lcDoc = GerLoginConfigDocument.Factory.newInstance();
@@ -427,32 +427,31 @@
     }
 
     private void actionLoadExistingRealm(PortletRequest request, RealmData data) {
-        SecurityRealm realm = (SecurityRealm) PortletManager.getManagedBean(request, data.getObjectName());
+        SecurityRealm realm = (SecurityRealm) PortletManager.getManagedBean(request, new AbstractName(URI.create(data.getAbstractName())));
         data.name = realm.getRealmName();
         List list = new ArrayList();
-        JaasLoginModuleChain node = (JaasLoginModuleChain) PortletManager.getManagedBean(request, realm.getLoginModuleChainName());
+        JaasLoginModuleChain node = realm.getLoginModuleChain();
         while(node != null) {
             LoginModuleDetails details = new LoginModuleDetails();
             details.setControlFlag(node.getControlFlag());
-            LoginModuleSettings module = (LoginModuleSettings) PortletManager.getManagedBean(request, node.getLoginModuleName());
+            LoginModuleSettings module = node.getLoginModule();
             details.setLoginDomainName(module.getLoginDomainName());
             details.setClassName(module.getLoginModuleClass());
             details.setServerSide(module.isServerSide());
             details.setWrapPrincipals(module.isWrapPrincipals());
             details.setOptions(module.getOptions());
             list.add(details);
-            final String next = node.getNextName();
-            if(next == null) {
+            node = node.getNext();
+            if(node == null) {
                 break;
             }
-            node = (JaasLoginModuleChain) PortletManager.getManagedBean(request, next);
         }
         data.modules = (LoginModuleDetails[]) list.toArray(new LoginModuleDetails[list.size()]);
     }
 
     private void actionSaveRealm(PortletRequest request, RealmData data) {
         normalize(data);
-        if(data.objectName == null || data.objectName.equals("")) { // we're creating a new realm
+        if(data.getAbstractName() == null || data.getAbstractName().equals("")) { // we're creating a new realm
             try {
                 XmlObject plan = actionGeneratePlan(request, data);
                 data.name = data.name.replaceAll("\\s", "");
@@ -479,25 +478,24 @@
                 log.error("Unable to save security realm", e);
             }
         } else {
-            SecurityRealm realm = (SecurityRealm) PortletManager.getManagedBean(request, data.getObjectName());
+            SecurityRealm realm = (SecurityRealm) PortletManager.getManagedBean(request, new AbstractName(URI.create(data.getAbstractName())));
             // index existing modules
             Map nodes = new HashMap();
-            JaasLoginModuleChain node = (JaasLoginModuleChain) PortletManager.getManagedBean(request, realm.getLoginModuleChainName());
+            JaasLoginModuleChain node = realm.getLoginModuleChain();
             while(node != null) {
-                LoginModuleSettings module = (LoginModuleSettings) PortletManager.getManagedBean(request, node.getLoginModuleName());
+                LoginModuleSettings module = node.getLoginModule();
                 nodes.put(module.getLoginDomainName(), node);
-                final String next = node.getNextName();
-                if(next == null) {
+                node = node.getNext();
+                if(node == null) {
                     break;
                 }
-                node = (JaasLoginModuleChain) PortletManager.getManagedBean(request, next);
             }
             // apply settings
             for (int i = 0; i < data.getModules().length; i++) {
                 LoginModuleDetails details = data.getModules()[i];
                 node = (JaasLoginModuleChain) nodes.get(details.getLoginDomainName());
                 node.setControlFlag(details.getControlFlag());
-                LoginModuleSettings module = (LoginModuleSettings) PortletManager.getManagedBean(request, node.getLoginModuleName());
+                LoginModuleSettings module = node.getLoginModule();
                 module.setOptions(details.getOptions());
                 module.setServerSide(details.isServerSide());
                 module.setWrapPrincipals(details.isWrapPrincipals());
@@ -507,7 +505,7 @@
     }
 
     private void renderList(RenderRequest request, RenderResponse response) throws IOException, PortletException {
-        SecurityRealm[] realms = PortletManager.getSecurityRealms(request);
+        SecurityRealm[] realms = (SecurityRealm[]) PortletManager.getCurrentServer(request).getSecurityRealms();
         ExistingRealm[] results = new ExistingRealm[realms.length];
         for (int i = 0; i < results.length; i++) {
             final GeronimoManagedBean managedBean = (GeronimoManagedBean)realms[i];
@@ -723,7 +721,7 @@
         } else {
             list.addAll(Arrays.asList(data.modules));
         }
-        if(data.getObjectName() == null) {
+        if(data.getAbstractName() == null) {
             for(int i=list.size(); i<5; i++) {
                 LoginModuleDetails module = new LoginModuleDetails();
                 list.add(module);
@@ -742,7 +740,7 @@
         private String lockoutWindow;
         private String lockoutDuration;
         private boolean storePassword;
-        private String objectName; // used when editing existing realms
+        private String abstractName; // used when editing existing realms
         private LoginModuleDetails[] modules;
 
         public void load(PortletRequest request) {
@@ -760,8 +758,8 @@
             if(lockoutWindow != null && lockoutWindow.equals("")) lockoutWindow = null;
             lockoutDuration = request.getParameter("lockoutDuration");
             if(lockoutDuration != null && lockoutDuration.equals("")) lockoutDuration = null;
-            objectName = request.getParameter("objectName");
-            if(objectName != null && objectName.equals("")) objectName = null;
+            abstractName = request.getParameter("objectName");
+            if(abstractName != null && abstractName.equals("")) abstractName = null;
             String test = request.getParameter("storePassword");
             storePassword = test != null && !test.equals("") && !test.equals("false");
             Map map = request.getParameterMap();
@@ -855,7 +853,7 @@
             if(lockoutCount != null) response.setRenderParameter("lockoutCount", lockoutCount);
             if(lockoutWindow != null) response.setRenderParameter("lockoutWindow", lockoutWindow);
             if(lockoutDuration != null) response.setRenderParameter("lockoutDuration", lockoutDuration);
-            if(objectName != null) response.setRenderParameter("objectName", objectName);
+            if(abstractName != null) response.setRenderParameter("objectName", abstractName);
             if(storePassword) response.setRenderParameter("storePassword", "true");
             for (Iterator it = options.keySet().iterator(); it.hasNext();) {
                 String name = (String) it.next();
@@ -921,8 +919,15 @@
             return lockoutCount != null || lockoutWindow != null || lockoutDuration != null;
         }
 
+        /**
+         * @deprecated Use getAbstractName instead
+         */
         public String getObjectName() {
-            return objectName;
+            return abstractName;
+        }
+
+        public String getAbstractName() {
+            return abstractName;
         }
 
         public boolean isTestable() {



Mime
View raw message