geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r396206 [1/2] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/wizard/ applications/console-standard/src/java/org...
Date Sun, 23 Apr 2006 02:55:52 GMT
Author: dain
Date: Sat Apr 22 19:55:45 2006
New Revision: 396206

URL: http://svn.apache.org/viewcvs?rev=396206&view=rev
Log:
Rewrote JSR-77 objects to use reference collections instead of name manipulations.
Rewrote KernelManagementHelper to use navigation instead of name manipulation.

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/jmsmanager/wizard/ListScreenHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/ListScreenHandler.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/KernelHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/branches/1.1/configs/client/src/plan/plan.xml
    geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapper.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapperGBean.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java
    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/JVMImpl.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java
    geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
    geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    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/JCAAdminObject.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java
    geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.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=396206&r1=396205&r2=396206&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 Sat Apr 22 19:55:45 2006
@@ -20,13 +20,10 @@
 import java.util.Arrays;
 import java.util.Collections;
 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;
@@ -35,22 +32,20 @@
 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;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.management.State;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.NoSuchStoreException;
-import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
-import org.apache.geronimo.kernel.proxy.ProxyManager;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJB;
@@ -58,20 +53,20 @@
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.J2EEModule;
 import org.apache.geronimo.management.J2EEResource;
-import org.apache.geronimo.management.JCAConnectionFactory;
 import org.apache.geronimo.management.JDBCDataSource;
 import org.apache.geronimo.management.JDBCDriver;
 import org.apache.geronimo.management.JDBCResource;
 import org.apache.geronimo.management.JMSResource;
-import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.Servlet;
 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.JCAConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAResource;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
@@ -79,19 +74,15 @@
 
 /**
  * An implementation of the ManagementHelper interface that uses a Geronimo
- * kernel. That may be an in-VM kernel or a remote kernel, we don't really
- * care.
+ * kernel. That must be an in-VM kernel.
  *
  * @version $Rev:386276 $ $Date$
  */
 public class KernelManagementHelper implements ManagementHelper {
-    private final static Log log = LogFactory.getLog(KernelManagementHelper.class);
     private final Kernel kernel;
-    private final ProxyManager pm;
 
     public KernelManagementHelper(Kernel kernel) {
         this.kernel = kernel;
-        pm = kernel.getProxyManager();
     }
 
     public J2EEDomain[] getDomains() {
@@ -100,159 +91,55 @@
         int i = 0;
         for (Iterator iterator = domainNames.iterator(); iterator.hasNext();) {
             AbstractName domainName = (AbstractName) iterator.next();
-            result[i++] = (J2EEDomain) pm.createProxy(domainName, J2EEDomain.class);
+            result[i++] = (J2EEDomain) kernel.getProxyManager().createProxy(domainName, J2EEDomain.class);
         }
         return result;
     }
 
     public J2EEServer[] getServers(J2EEDomain domain) {
-        J2EEServer[] servers = new J2EEServer[0];
-        try {
-            String[] names = domain.getServers();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            servers = new J2EEServer[temp.length];
-            System.arraycopy(temp, 0, servers, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return servers;
+        return domain.getServerInstances();
     }
 
     public J2EEDeployedObject[] getDeployedObjects(J2EEServer server) {
-        J2EEDeployedObject[] result = new J2EEDeployedObject[0];
-        try {
-            String[] names = server.getDeployedObjects();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new J2EEDeployedObject[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
+        return server.getDeployedObjectInstances();
     }
 
     public J2EEApplication[] getApplications(J2EEServer server) {
-        List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.J2EE_APPLICATION)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (J2EEApplication[]) list.toArray(new J2EEApplication[list.size()]);
+        return server.getApplications();
     }
 
     public AppClientModule[] getAppClients(J2EEServer server) {
-        List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.APP_CLIENT_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (AppClientModule[]) list.toArray(new AppClientModule[list.size()]);
+        return server.getAppClients();
     }
 
     public WebModule[] getWebModules(J2EEServer server) {
-        List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.WEB_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (WebModule[]) list.toArray(new WebModule[list.size()]);
+        return server.getWebModules();
     }
 
     public EJBModule[] getEJBModules(J2EEServer server) {
-        List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.EJB_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (EJBModule[]) list.toArray(new EJBModule[list.size()]);
+        return server.getEJBModules();
     }
 
     public ResourceAdapterModule[] getRAModules(J2EEServer server) {
-        List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
+        return server.getResourceAdapterModules();
     }
 
     public JCAManagedConnectionFactory[] getOutboundFactories(J2EEServer server, String connectionFactoryInterface) {
         List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    ResourceAdapterModule module = (ResourceAdapterModule) pm.createProxy(name, KernelManagementHelper.class.getClassLoader());
-                    ResourceAdapter[] adapters = getResourceAdapters(module);
-                    for (int j = 0; j < adapters.length; j++) {
-                        ResourceAdapter adapter = adapters[j];
-                        JCAResource[] resources = getRAResources(adapter);
-                        for (int k = 0; k < resources.length; k++) {
-                            JCAResource resource = resources[k];
-                            JCAConnectionFactory[] factories = getConnectionFactories(resource);
-                            for (int l = 0; l < factories.length; l++) {
-                                JCAConnectionFactory factory = factories[l];
-                                JCAManagedConnectionFactory mcf = getManagedConnectionFactory(factory);
-                                if(mcf.getConnectionFactoryInterface().equals(connectionFactoryInterface)) {
-                                    list.add(mcf);
-                                    continue;
-                                }
-                                for (int m = 0; m < mcf.getImplementedInterfaces().length; m++) {
-                                    String iface = mcf.getImplementedInterfaces()[m];
-                                    if(iface.equals(connectionFactoryInterface)) {
-                                        list.add(mcf);
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-                    }
+        ResourceAdapterModule[] modules = server.getResourceAdapterModules();
+        for (int i = 0; i < modules.length; i++) {
+            ResourceAdapterModule module = modules[i];
+            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
+            for (int j = 0; j < adapters.length; j++) {
+                ResourceAdapter adapter = adapters[j];
+                JCAResource[] resources = adapter.getJCAResourceImplementations();
+                for (int k = 0; k < resources.length; k++) {
+                    JCAResource resource = resources[k];
+                    JCAManagedConnectionFactory[] outboundFactories = resource.getOutboundFactories();
+                    list.addAll(Arrays.asList(outboundFactories));
                 }
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
+
         }
         return (JCAManagedConnectionFactory[]) list.toArray(new JCAManagedConnectionFactory[list.size()]);
     }
@@ -262,199 +149,114 @@
     }
 
     public ResourceAdapterModule[] getOutboundRAModules(J2EEServer server, String[] connectionFactoryInterfaces) {
-        Set targets = new HashSet(Arrays.asList(connectionFactoryInterfaces));
         List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    ResourceAdapterModule module = (ResourceAdapterModule) pm.createProxy(name, KernelManagementHelper.class.getClassLoader());
-                    ResourceAdapter[] adapters = getResourceAdapters(module);
-                    outer:
-                    for (int j = 0; j < adapters.length; j++) {
-                        ResourceAdapter adapter = adapters[j];
-                        JCAResource[] resources = getRAResources(adapter);
-                        for (int k = 0; k < resources.length; k++) {
-                            JCAResource resource = resources[k];
-                            JCAConnectionFactory[] factories = getConnectionFactories(resource);
-                            for (int l = 0; l < factories.length; l++) {
-                                JCAConnectionFactory factory = factories[l];
-                                JCAManagedConnectionFactory mcf = getManagedConnectionFactory(factory);
-                                if(targets.contains(mcf.getConnectionFactoryInterface())) {
-                                    list.add(module);
-                                    break outer;
-                                }
-                                for (int m = 0; m < mcf.getImplementedInterfaces().length; m++) {
-                                    String iface = mcf.getImplementedInterfaces()[m];
-                                    if(targets.contains(iface)) {
-                                        list.add(module);
-                                        break outer;
-                                    }
-                                }
-                            }
-                        }
+
+        ResourceAdapterModule[] modules = server.getResourceAdapterModules();
+
+        outer:
+        for (int i = 0; i < modules.length; i++) {
+            ResourceAdapterModule module = modules[i];
+            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
+            for (int j = 0; j < adapters.length; j++) {
+                ResourceAdapter adapter = adapters[j];
+                JCAResource[] resources = adapter.getJCAResourceImplementations();
+                for (int k = 0; k < resources.length; k++) {
+                    JCAResource resource = resources[k];
+                    JCAManagedConnectionFactory[] outboundFactories = resource.getOutboundFactories(connectionFactoryInterfaces);
+                    if (outboundFactories.length > 0) {
+                        list.add(module);
+                        continue outer;
                     }
                 }
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
+
         }
         return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
     }
 
     public ResourceAdapterModule[] getAdminObjectModules(J2EEServer server, String[] adminObjectInterfaces) {
         List list = new ArrayList();
-        try {
-            String[] names = server.getDeployedObjects();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    ResourceAdapterModule module = (ResourceAdapterModule) pm.createProxy(name, KernelManagementHelper.class.getClassLoader());
-                    ResourceAdapter[] adapters = getResourceAdapters(module);
-                    outer:
-                    for (int j = 0; j < adapters.length; j++) {
-                        ResourceAdapter adapter = adapters[j];
-                        JCAResource[] resources = getRAResources(adapter);
-                        for (int k = 0; k < resources.length; k++) {
-                            JCAResource resource = resources[k];
-                            JCAAdminObject[] admins = getAdminObjects(resource);
-                            for (int l = 0; l < admins.length; l++) {
-                                JCAAdminObject admin = admins[l];
-                                String adminIface = admin.getAdminObjectInterface();
-                                for (int m = 0; m < adminObjectInterfaces.length; m++) {
-                                    if(adminIface.equals(adminObjectInterfaces[m])) {
-                                        list.add(module);
-                                        break outer;
-                                    }
 
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
-    }
+        ResourceAdapterModule[] modules = server.getResourceAdapterModules();
 
-    public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module) {
-        List list = new ArrayList();
-        try {
-            ResourceAdapter[] adapters = getResourceAdapters(module);
+        outer:
+        for (int i = 0; i < modules.length; i++) {
+            ResourceAdapterModule module = modules[i];
+            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
             for (int j = 0; j < adapters.length; j++) {
                 ResourceAdapter adapter = adapters[j];
-                JCAResource[] resources = getRAResources(adapter);
+                JCAResource[] resources = adapter.getJCAResourceImplementations();
                 for (int k = 0; k < resources.length; k++) {
                     JCAResource resource = resources[k];
-                    JCAConnectionFactory[] factories = getConnectionFactories(resource);
-                    for (int l = 0; l < factories.length; l++) {
-                        JCAConnectionFactory factory = factories[l];
-                        JCAManagedConnectionFactory mcf = getManagedConnectionFactory(factory);
-                        list.add(mcf);
+                    JCAAdminObject[] adminObjects = resource.getAdminObjectInstances(adminObjectInterfaces);
+                    if (adminObjects.length > 0) {
+                        list.add(module);
+                        continue outer;
                     }
                 }
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
+
         }
-        return (JCAManagedConnectionFactory[]) list.toArray(new JCAManagedConnectionFactory[list.size()]);
+        return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
+    }
+
+    public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module) {
+        return getOutboundFactories(module, (String[]) null);
     }
 
     public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String connectionFactoryInterface) {
         return getOutboundFactories(module, new String[]{connectionFactoryInterface});
     }
+
     public JCAManagedConnectionFactory[] getOutboundFactories(ResourceAdapterModule module, String[] connectionFactoryInterfaces) {
-        Set targets = new HashSet(Arrays.asList(connectionFactoryInterfaces));
         List list = new ArrayList();
-        try {
-            ResourceAdapter[] adapters = getResourceAdapters(module);
-            for (int j = 0; j < adapters.length; j++) {
-                ResourceAdapter adapter = adapters[j];
-                JCAResource[] resources = getRAResources(adapter);
-                for (int k = 0; k < resources.length; k++) {
-                    JCAResource resource = resources[k];
-                    JCAConnectionFactory[] factories = getConnectionFactories(resource);
-                    for (int l = 0; l < factories.length; l++) {
-                        JCAConnectionFactory factory = factories[l];
-                        JCAManagedConnectionFactory mcf = getManagedConnectionFactory(factory);
-                        if(targets.contains(mcf.getConnectionFactoryInterface())) {
-                            list.add(mcf);
-                            continue;
-                        }
-                        for (int m = 0; m < mcf.getImplementedInterfaces().length; m++) {
-                            String iface = mcf.getImplementedInterfaces()[m];
-                            if(targets.contains(iface)) {
-                                list.add(mcf);
-                                break;
-                            }
-                        }
-                    }
-                }
+
+        ResourceAdapter[] resourceAdapters = module.getResourceAdapterInstances();
+        for (int i = 0; i < resourceAdapters.length; i++) {
+            ResourceAdapter resourceAdapter = resourceAdapters[i];
+            JCAResource[] jcaResources = resourceAdapter.getJCAResourceImplementations();
+            for (int j = 0; j < jcaResources.length; j++) {
+                JCAResource jcaResource = jcaResources[j];
+                JCAManagedConnectionFactory[] outboundFactories = jcaResource.getOutboundFactories(connectionFactoryInterfaces);
+                list.addAll(Arrays.asList(outboundFactories));
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
         }
+
         return (JCAManagedConnectionFactory[]) list.toArray(new JCAManagedConnectionFactory[list.size()]);
     }
 
     public JCAAdminObject[] getAdminObjects(ResourceAdapterModule module, String[] adminObjectInterfaces) {
         List list = new ArrayList();
-        try {
-            ResourceAdapter[] adapters = getResourceAdapters(module);
-            for (int j = 0; j < adapters.length; j++) {
-                ResourceAdapter adapter = adapters[j];
-                JCAResource[] resources = getRAResources(adapter);
-                for (int k = 0; k < resources.length; k++) {
-                    JCAResource resource = resources[k];
-                    JCAAdminObject[] admins = getAdminObjects(resource);
-                    for (int l = 0; l < admins.length; l++) {
-                        JCAAdminObject admin = admins[l];
-                        String adminIface = admin.getAdminObjectInterface();
-                        for (int m = 0; m < adminObjectInterfaces.length; m++) {
-                            if(adminIface.equals(adminObjectInterfaces[m])) {
-                                list.add(admin);
-                                break;
-                            }
-                        }
-                    }
-                }
+        ResourceAdapter[] resourceAdapters = module.getResourceAdapterInstances();
+        for (int i = 0; i < resourceAdapters.length; i++) {
+            ResourceAdapter resourceAdapter = resourceAdapters[i];
+            JCAResource[] jcaResources = resourceAdapter.getJCAResourceImplementations();
+            for (int j = 0; j < jcaResources.length; j++) {
+                JCAResource jcaResource = jcaResources[j];
+                JCAAdminObject[] adminObjects  = jcaResource.getAdminObjectInstances(adminObjectInterfaces);
+                list.addAll(Arrays.asList(adminObjects));
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
         }
+
         return (JCAAdminObject[]) list.toArray(new JCAAdminObject[list.size()]);
     }
 
     public J2EEResource[] getResources(J2EEServer server) {
-        J2EEResource[] result = new J2EEResource[0];
-        try {
-            String[] names = server.getResources();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new J2EEResource[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
+        return server.getResourceInstances();
     }
 
     public JCAResource[] getJCAResources(J2EEServer server) {
         List list = new ArrayList();
-        try {
-            //todo: filter based on ObjectName or something, but what counts as a "JCAResource"?
-            J2EEResource[] all = getResources(server);
-            for (int i = 0; i < all.length; i++) {
-                if(all[i] instanceof JCAResource) {
-                    list.add(all[i]);
-                }
+        ResourceAdapterModule[] modules = server.getResourceAdapterModules();
+        for (int i = 0; i < modules.length; i++) {
+            ResourceAdapterModule module = modules[i];
+            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
+            for (int j = 0; j < adapters.length; j++) {
+                ResourceAdapter adapter = adapters[j];
+                JCAResource[] resources = adapter.getJCAResourceImplementations();
+                list.addAll(Arrays.asList(resources));
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
+
         }
         return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
     }
@@ -468,125 +270,47 @@
     }
 
     public JVM[] getJavaVMs(J2EEServer server) {
-        JVM[] result = new JVM[0];
-        try {
-            String[] names = server.getJavaVMs();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new JVM[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up JVMs for J2EEServer", e);
-        }
-        return result;
+        return server.getJavaVMInstances();
     }
 
     public SystemLog getSystemLog(JVM jvm) {
-        SystemLog result = null;
-        try {
-            String name = jvm.getSystemLog();
-            Object temp = pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-            result = (SystemLog)temp;
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
+        return jvm.getSystemLog();
     }
 
     // application properties
     public J2EEModule[] getModules(J2EEApplication application) {
-        J2EEModule[] result = new J2EEModule[0];
-        try {
-            String[] names = application.getModules();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new J2EEModule[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return result;
+        return application.getModulesInstances();
     }
 
     public AppClientModule[] getAppClients(J2EEApplication application) {
-        List list = new ArrayList();
-        try {
-            String[] names = application.getModules();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.APP_CLIENT_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (AppClientModule[]) list.toArray(new AppClientModule[list.size()]);
+        return application.getClientModules();
     }
 
     public WebModule[] getWebModules(J2EEApplication application) {
-        List list = new ArrayList();
-        try {
-            String[] names = application.getModules();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.WEB_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (WebModule[]) list.toArray(new WebModule[list.size()]);
+        return application.getWebModules();
     }
 
     public EJBModule[] getEJBModules(J2EEApplication application) {
-        List list = new ArrayList();
-        try {
-            String[] names = application.getModules();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.EJB_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (EJBModule[]) list.toArray(new EJBModule[list.size()]);
+        return application.getEJBModules();
     }
 
     public ResourceAdapterModule[] getRAModules(J2EEApplication application) {
-        List list = new ArrayList();
-        try {
-            String[] names = application.getModules();
-            for (int i = 0; i < names.length; i++) {
-                ObjectName name = ObjectName.getInstance(names[i]);
-                String type = name.getKeyProperty(NameFactory.J2EE_TYPE);
-                if(type.equals(NameFactory.RESOURCE_ADAPTER_MODULE)) {
-                    list.add(pm.createProxy(name, KernelManagementHelper.class.getClassLoader()));
-                }
-            }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
-        }
-        return (ResourceAdapterModule[]) list.toArray(new ResourceAdapterModule[list.size()]);
+        return application.getRAModules();
     }
 
 
     public JCAResource[] getJCAResources(J2EEApplication application) {
         List list = new ArrayList();
-        try {
-            //todo: filter based on ObjectName or something, but what counts as a "JCAResource"?
-            J2EEResource[] all = application.getResources();
-            for (int i = 0; i < all.length; i++) {
-                if(all[i] instanceof JCAResource) {
-                    list.add(all[i]);
-                }
+        ResourceAdapterModule[] modules = application.getRAModules();
+        for (int i = 0; i < modules.length; i++) {
+            ResourceAdapterModule module = modules[i];
+            ResourceAdapter[] adapters = module.getResourceAdapterInstances();
+            for (int j = 0; j < adapters.length; j++) {
+                ResourceAdapter adapter = adapters[j];
+                JCAResource[] resources = adapter.getJCAResourceImplementations();
+                list.addAll(Arrays.asList(resources));
             }
-        } catch (Exception e) {
-            log.error("Unable to look up related GBean", e);
+
         }
         return (JCAResource[]) list.toArray(new JCAResource[list.size()]);
     }
@@ -609,30 +333,12 @@
     }
 
     public ResourceAdapter[] getResourceAdapters(ResourceAdapterModule module) {
-        ResourceAdapter[] result = new ResourceAdapter[0];
-        try {
-            String[] names = module.getResourceAdapters();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new ResourceAdapter[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up resource adapters for module", e);
-        }
-        return result;
+        return module.getResourceAdapterInstances();
     }
 
     // resource adapter properties
     public JCAResource[] getRAResources(ResourceAdapter adapter) {
-        JCAResource[] result = new JCAResource[0];
-        try {
-            String[] names = adapter.getJCAResources();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new JCAResource[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up JCA resources for resource adapter", e);
-        }
-        return result;
+        return adapter.getJCAResourceImplementations();
     }
 
     // resource properties
@@ -645,48 +351,15 @@
     }
 
     public JCAConnectionFactory[] getConnectionFactories(JCAResource resource) {
-        JCAConnectionFactory[] result = new JCAConnectionFactory[0];
-        try {
-            String[] names = resource.getConnectionFactories();
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new JCAConnectionFactory[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (Exception e) {
-            log.error("Unable to look up connection factories for JCA resource", e);
-        }
-        return result;
+        return resource.getConnectionFactoryInstances();
     }
 
     public JCAAdminObject[] getAdminObjects(JCAResource resource) {
-        JCAAdminObject[] result = new JCAAdminObject[0];
-        String objectName = resource.getObjectName();
-        try {
-            String name = ObjectName.getInstance(objectName).getKeyProperty(NameFactory.J2EE_NAME);
-            String query = "*:JCAResource="+name+",j2eeType=JCAAdminObject,*";
-            Set results = kernel.listGBeans(ObjectName.getInstance(query));
-            String[] names = new String[results.size()];
-            int i = 0;
-            for (Iterator it = results.iterator(); it.hasNext();) {
-                ObjectName next = (ObjectName) it.next();
-                names[i++] = next.getCanonicalName();
-            }
-            Object[] temp = pm.createProxies(names, KernelManagementHelper.class.getClassLoader());
-            result = new JCAAdminObject[temp.length];
-            System.arraycopy(temp, 0, result, 0, temp.length);
-        } catch (MalformedObjectNameException e) {
-            log.error("Unable to look up admin objects for resource adapter", e);
-        }
-        return result;
+        return resource.getAdminObjectInstances();
     }
 
     public JCAManagedConnectionFactory getManagedConnectionFactory(JCAConnectionFactory factory) {
-        try {
-            String name = factory.getManagedConnectionFactory();
-            return (JCAManagedConnectionFactory) pm.createProxy(ObjectName.getInstance(name), KernelManagementHelper.class.getClassLoader());
-        } catch (Exception e) {
-            log.error("Unable to look up managed connection factory for connection factory", e);
-            return null;
-        }
+        return factory.getManagedConnectionFactoryInstance();
     }
 
     public Object getObject(AbstractName objectName) {
@@ -708,7 +381,7 @@
     public void testLoginModule(J2EEServer server, LoginModule module, Map options) {
         options.put(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION, kernel.getKernelName());
         options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
-        if(!options.containsKey(JaasLoginModuleUse.CLASSLOADER_LM_OPTION)) {
+        if (!options.containsKey(JaasLoginModuleUse.CLASSLOADER_LM_OPTION)) {
             options.put(JaasLoginModuleUse.CLASSLOADER_LM_OPTION, module.getClass().getClassLoader());
         }
         module.initialize(null, null, new HashMap(), options);
@@ -716,7 +389,7 @@
 
     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());
-        if(!options.containsKey(JaasLoginModuleUse.CLASSLOADER_LM_OPTION)) {
+        if (!options.containsKey(JaasLoginModuleUse.CLASSLOADER_LM_OPTION)) {
             options.put(JaasLoginModuleUse.CLASSLOADER_LM_OPTION, module.getClass().getClassLoader());
         }
         options.put(JaasLoginModuleUse.SERVERINFO_LM_OPTION, server.getServerInfo());
@@ -725,10 +398,10 @@
             public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
                 for (int i = 0; i < callbacks.length; i++) {
                     Callback callback = callbacks[i];
-                    if(callback instanceof PasswordCallback) {
-                        ((PasswordCallback)callback).setPassword(password.toCharArray());
-                    } else if(callback instanceof NameCallback) {
-                        ((NameCallback)callback).setName(username);
+                    if (callback instanceof PasswordCallback) {
+                        ((PasswordCallback) callback).setPassword(password.toCharArray());
+                    } else if (callback instanceof NameCallback) {
+                        ((NameCallback) callback).setName(username);
                     } else {
                         throw new UnsupportedCallbackException(callback);
                     }
@@ -736,7 +409,7 @@
             }
         };
         module.initialize(sub, handler, new HashMap(), options);
-        if(module.login() && module.commit()) {
+        if (module.login() && module.commit()) {
             return sub;
         } else {
             module.abort();
@@ -747,7 +420,7 @@
     public Object[] findByInterface(Class iface) {
         Set set = kernel.listGBeans(new AbstractNameQuery(iface.getName()));
         Object[] result = new Object[set.size()];
-        int i=0;
+        int i = 0;
         for (Iterator it = set.iterator(); it.hasNext();) {
             AbstractName name = (AbstractName) it.next();
             result[i++] = kernel.getProxyManager().createProxy(name, iface.getClassLoader());
@@ -770,39 +443,43 @@
                 for (Iterator j = infos.iterator(); j.hasNext();) {
                     ConfigurationInfo info = (ConfigurationInfo) j.next();
                     AbstractName configuration = Configuration.getConfigurationAbstractName(info.getConfigID());
-                    if(type == null || type.getValue() == info.getType().getValue()) {
+                    if (type == null || type.getValue() == info.getType().getValue()) {
                         results.add(new ConfigurationData(info.getConfigID(), configuration, null, info.getState(), info.getType(), kernel.getAbstractNameFor(getModuleForConfiguration(info.getConfigID()))));
                     }
-                    if(includeChildModules && info.getType().getValue() == ConfigurationModuleType.EAR.getValue() && info.getState().toInt() == State.RUNNING_INDEX) {
+                    if (includeChildModules && info.getType().getValue() == ConfigurationModuleType.EAR.getValue() && info.getState().toInt() == State.RUNNING_INDEX)
+                    {
                         J2EEApplication app = (J2EEApplication) getModuleForConfiguration(info.getConfigID());
-                        if(app == null) {
-                            throw new IllegalStateException("Unable to load children for J2EE Application '"+info.getConfigID()+"' (no J2EEApplication found)");
+                        if (app == null) {
+                            throw new IllegalStateException("Unable to load children for J2EE Application '" + info.getConfigID() + "' (no J2EEApplication found)");
                         }
                         Object[] modules = null;
-                        if(type == null) {
+                        if (type == null) {
                             modules = app.getModulesInstances();
-                        } else if(type.equals(ConfigurationModuleType.CAR)) {
+                        } else if (type.equals(ConfigurationModuleType.CAR)) {
                             modules = app.getClientModules();
-                        } else if(type.equals(ConfigurationModuleType.EJB)) {
+                        } else if (type.equals(ConfigurationModuleType.EJB)) {
                             modules = app.getEJBModules();
-                        } else if(type.equals(ConfigurationModuleType.RAR)) {
+                        } else if (type.equals(ConfigurationModuleType.RAR)) {
                             modules = app.getRAModules();
-                        } else if(type.equals(ConfigurationModuleType.WAR)) {
+                        } else if (type.equals(ConfigurationModuleType.WAR)) {
                             modules = app.getWebModules();
                         } //todo: handle dynamically registered module types, etc.
-                        if(modules == null) continue;
+                        if (modules == null) continue;
                         for (int k = 0; k < modules.length; k++) {
                             Object module = modules[k];
                             ConfigurationModuleType moduleType = type;
-                            if(moduleType == null) {
-                                if(module instanceof WebModule) moduleType = ConfigurationModuleType.WAR;
-                                else if(module instanceof EJBModule) moduleType = ConfigurationModuleType.EJB;
-                                else if(module instanceof ResourceAdapterModule) moduleType = ConfigurationModuleType.RAR;
-                                else if(module instanceof AppClientModule) moduleType = ConfigurationModuleType.CAR;
+                            if (moduleType == null) {
+                                if (module instanceof WebModule) {
+                                    moduleType = ConfigurationModuleType.WAR;
+                                } else if (module instanceof EJBModule) {
+                                    moduleType = ConfigurationModuleType.EJB;
+                                } else if (module instanceof ResourceAdapterModule) {
+                                    moduleType = ConfigurationModuleType.RAR;
+                                } else if (module instanceof AppClientModule) moduleType = ConfigurationModuleType.CAR;
                             }
                             String moduleName;
-                            if(type != null && type.equals(ConfigurationModuleType.WAR)) {
-                                moduleName = ((WebModule)module).getWARName();
+                            if (type != null && type.equals(ConfigurationModuleType.WAR)) {
+                                moduleName = ((WebModule) module).getWARName();
                             } else {
                                 //todo: solutions for other module types
                                 moduleName = (String) kernel.getAbstractNameFor(module).getName().get(NameFactory.J2EE_NAME);
@@ -831,28 +508,28 @@
     public J2EEDeployedObject getModuleForConfiguration(Artifact configuration) {
         ConfigurationManager manager = ConfigurationUtil.getConfigurationManager(kernel);
         Configuration config = manager.getConfiguration(configuration);
-        if(config == null) {
+        if (config == null) {
             return null; // The configuration is not running, so we can't get its contents
         }
         ConfigurationModuleType type = config.getModuleType();
         AbstractName result;
         try {
-            if(type.equals(ConfigurationModuleType.CAR)) {
+            if (type.equals(ConfigurationModuleType.CAR)) {
                 result = config.findGBean(new AbstractNameQuery(AppClientModule.class.getName()));
-            } else if(type.equals(ConfigurationModuleType.EAR)) {
+            } else if (type.equals(ConfigurationModuleType.EAR)) {
                 result = config.findGBean(new AbstractNameQuery(J2EEApplication.class.getName()));
-            } else if(type.equals(ConfigurationModuleType.EJB)) {
+            } else if (type.equals(ConfigurationModuleType.EJB)) {
                 result = config.findGBean(new AbstractNameQuery(EJBModule.class.getName()));
-            } else if(type.equals(ConfigurationModuleType.RAR)) {
+            } else if (type.equals(ConfigurationModuleType.RAR)) {
                 result = config.findGBean(new AbstractNameQuery(ResourceAdapterModule.class.getName()));
-            } else if(type.equals(ConfigurationModuleType.WAR)) {
+            } else if (type.equals(ConfigurationModuleType.WAR)) {
                 result = config.findGBean(new AbstractNameQuery(WebModule.class.getName()));
             } else {
                 return null;
             }
             return (J2EEDeployedObject) kernel.getProxyManager().createProxy(result, getClass().getClassLoader());
         } catch (GBeanNotFoundException e) {
-            throw new IllegalStateException("Bad config ID: "+e.getMessage());
+            throw new IllegalStateException("Bad config ID: " + e.getMessage());
         }
     }
 
@@ -860,7 +537,7 @@
      * Helper method to connect to a remote kernel.
      */
     public static KernelManagementHelper getRemoteKernelManager(String host, String user, String password) throws java.io.IOException {
-        String uri = "jmx:rmi://"+host+"/jndi/rmi:/JMXConnector";
+        String uri = "jmx:rmi://" + host + "/jndi/rmi:/JMXConnector";
         java.util.Map environment = new java.util.HashMap();
         String[] credentials = new String[]{user, password};
         environment.put(javax.management.remote.JMXConnector.CREDENTIALS, credentials);

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=396206&r1=396205&r2=396206&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 Sat Apr 22 19:55:45 2006
@@ -20,30 +20,29 @@
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginException;
 import javax.security.auth.spi.LoginModule;
+
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
 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.J2EEModule;
-import org.apache.geronimo.management.J2EEResource;
-import org.apache.geronimo.management.JCAConnectionFactory;
 import org.apache.geronimo.management.JDBCDataSource;
 import org.apache.geronimo.management.JDBCDriver;
 import org.apache.geronimo.management.JDBCResource;
 import org.apache.geronimo.management.JMSResource;
-import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.Servlet;
-import org.apache.geronimo.management.J2EEDeployedObject;
 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.JCAConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAResource;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.system.logging.SystemLog;

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=396206&r1=396205&r2=396206&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 Sat Apr 22 19:55:45 2006
@@ -16,25 +16,30 @@
  */
 package org.apache.geronimo.console.jmsmanager.wizard;
 
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
-import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
-import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 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.ResourceAdapter;
-import org.apache.geronimo.console.util.PortletManager;
-import org.apache.geronimo.console.MultiPageModel;
-
-import javax.portlet.*;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-import java.io.IOException;
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.List;
-import java.util.ArrayList;
+import org.apache.geronimo.management.geronimo.ResourceAdapter;
+import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
  * A handles for the front page that lists available resources.
@@ -57,24 +62,23 @@
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model) throws PortletException, IOException {
         JMSResourceData data = (JMSResourceData) model;
         String provider = request.getParameter(PROVIDER_PARAMETER);
-        if(isEmpty(provider)) {
-            return SELECT_PROVIDER_MODE+BEFORE_ACTION;
+        if (isEmpty(provider)) {
+            return SELECT_PROVIDER_MODE + BEFORE_ACTION;
         }
         JMSProviderData providerData = JMSProviderData.getProviderByName(provider);
         data.setRarURI(providerData.getRaURI());
         data.setDependency(providerData.getDependency());
-        return CONFIGURE_RA_MODE+BEFORE_ACTION;
+        return CONFIGURE_RA_MODE + BEFORE_ACTION;
     }
 
 
-
     private void populateExistingList(PortletRequest renderRequest) {
         // Prepare a list of JMS configurations
         List resources = new ArrayList();
 
         // Get the list of connection factories
         ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(renderRequest, new String[]{
-                "javax.jms.ConnectionFactory","javax.jms.QueueConnectionFactory","javax.jms.TopicConnectionFactory",});
+                "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory",});
         try {
             for (int i = 0; i < modules.length; i++) {
                 ResourceAdapterModule module = modules[i];
@@ -82,75 +86,75 @@
                 JMSResourceSummary target = null;
                 for (int j = 0; j < resources.size(); j++) {
                     JMSResourceSummary data = (JMSResourceSummary) resources.get(j);
-                    if(data.adapterObjectName.equals(module.getObjectName())) {
+                    if (data.adapterObjectName.equals(module.getObjectName())) {
                         target = data;
                         break;
                     }
                 }
-                if(target == null) {
+                if (target == null) {
                     ResourceAdapter[] adapters = PortletManager.getResourceAdapters(renderRequest, module);
                     String name = null;
-                    if(adapters.length == 1 && adapters[0].getJCAResources().length == 1) {
+                    if (adapters.length == 1 && adapters[0].getJCAResources().length == 1) {
                         JCAResource[] resource = PortletManager.getJCAResources(renderRequest, adapters[0]);
-                        if(resource.length == 1 && resource[0].getResourceAdapterInstances().length == 1) {
+                        if (resource.length == 1 && resource[0].getResourceAdapterInstances().length == 1) {
                             name = ObjectName.getInstance(resource[0].getResourceAdapterInstanceNames()[0]).getKeyProperty(NameFactory.J2EE_NAME);
                         }
                     }
-                    if(name == null) {
+                    if (name == null) {
                         name = ObjectName.getInstance(module.getObjectName()).getKeyProperty(NameFactory.J2EE_NAME);
                     }
                     target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, PortletManager.getNameFor(renderRequest, module)).toString(),
-                                                    module.getObjectName(), name, ((GeronimoManagedBean)module).getState());
+                            module.getObjectName(), name, ((GeronimoManagedBean) module).getState());
                     resources.add(target);
                 }
 
                 JCAManagedConnectionFactory[] factories = PortletManager.getOutboundFactoriesForRA(renderRequest, module, new String[]{
-                        "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory", });
+                        "javax.jms.ConnectionFactory", "javax.jms.QueueConnectionFactory", "javax.jms.TopicConnectionFactory",});
                 for (int j = 0; j < factories.length; j++) {
                     JCAManagedConnectionFactory factory = factories[j];
                     ObjectName name = ObjectName.getInstance(factory.getObjectName());
                     target.getConnectionFactories().add(new ConnectionFactorySummary(factory.getObjectName(), name.getKeyProperty(NameFactory.J2EE_NAME),
-                                                      ((GeronimoManagedBean)factory).getState()));
+                            ((GeronimoManagedBean) factory).getState()));
                 }
             }
 
             // Get the list of admin objects
-            modules = PortletManager.getAdminObjectModules(renderRequest, new String[]{"javax.jms.Queue","javax.jms.Topic"});
+            modules = PortletManager.getAdminObjectModules(renderRequest, new String[]{"javax.jms.Queue", "javax.jms.Topic"});
             for (int i = 0; i < modules.length; i++) {
                 ResourceAdapterModule module = modules[i];
 
                 JMSResourceSummary target = null;
                 for (int j = 0; j < resources.size(); j++) {
                     JMSResourceSummary data = (JMSResourceSummary) resources.get(j);
-                    if(data.adapterObjectName.equals(module.getObjectName())) {
+                    if (data.adapterObjectName.equals(module.getObjectName())) {
                         target = data;
                         break;
                     }
                 }
-                if(target == null) {
+                if (target == null) {
                     ResourceAdapter[] adapters = PortletManager.getResourceAdapters(renderRequest, module);
                     String name = null;
-                    if(adapters.length == 1 && adapters[0].getJCAResources().length == 1) {
+                    if (adapters.length == 1 && adapters[0].getJCAResources().length == 1) {
                         JCAResource[] resource = PortletManager.getJCAResources(renderRequest, adapters[0]);
-                        if(resource.length == 1 && resource[0].getResourceAdapterInstances().length == 1) {
+                        if (resource.length == 1 && resource[0].getResourceAdapterInstances().length == 1) {
                             name = ObjectName.getInstance(resource[0].getResourceAdapterInstanceNames()[0]).getKeyProperty(NameFactory.J2EE_NAME);
                         }
                     }
-                    if(name == null) {
+                    if (name == null) {
                         name = ObjectName.getInstance(module.getObjectName()).getKeyProperty(NameFactory.J2EE_NAME);
                     }
                     target = new JMSResourceSummary(PortletManager.getConfigurationFor(renderRequest, PortletManager.getNameFor(renderRequest, module)).toString(),
-                                                    module.getObjectName(), name, ((GeronimoManagedBean)module).getState());
+                            module.getObjectName(), name, ((GeronimoManagedBean) module).getState());
                     resources.add(target);
                 }
 
-                JCAAdminObject[] admins = PortletManager.getAdminObjectsForRA(renderRequest, module, new String[]{"javax.jms.Queue","javax.jms.Topic"});
+                JCAAdminObject[] admins = PortletManager.getAdminObjectsForRA(renderRequest, module, new String[]{"javax.jms.Queue", "javax.jms.Topic"});
                 for (int j = 0; j < admins.length; j++) {
                     GeronimoManagedBean bean = (GeronimoManagedBean) admins[j];
                     ObjectName name = ObjectName.getInstance(bean.getObjectName());
                     target.getAdminObjects().add(new AdminObjectSummary(bean.getObjectName(), name.getKeyProperty(NameFactory.J2EE_NAME),
-                                                      admins[j].getAdminObjectInterface().indexOf("Queue") > -1 ? "Queue" : "Topic",
-                                                      bean.getState()));
+                            admins[j].getAdminObjectInterface().indexOf("Queue") > -1 ? "Queue" : "Topic",
+                            bean.getState()));
                 }
             }
         } catch (MalformedObjectNameException e) {
@@ -164,8 +168,8 @@
     }
 
 
-
     public static class JMSResourceSummary implements Serializable, Comparable {
+        private static final long serialVersionUID = -2788803234448047035L;
         private final String configurationName;
         private final String adapterObjectName;
         private final String name;
@@ -181,7 +185,7 @@
             try {
                 ObjectName objectName = ObjectName.getInstance(adapterObjectName);
                 String parent = objectName.getKeyProperty(NameFactory.J2EE_APPLICATION);
-                if(parent != null && parent.equals("null")) {
+                if (parent != null && parent.equals("null")) {
                     parent = null;
                 }
                 parentName = parent;
@@ -224,20 +228,20 @@
         }
 
         public int compareTo(Object o) {
-            final JMSResourceSummary pool = (JMSResourceSummary)o;
+            final JMSResourceSummary pool = (JMSResourceSummary) o;
             int names = name.toLowerCase().compareTo(pool.name.toLowerCase());
-            if(parentName == null) {
-                if(pool.parentName == null) {
+            if (parentName == null) {
+                if (pool.parentName == null) {
                     return names;
                 } else {
                     return -1;
                 }
             } else {
-                if(pool.parentName == null) {
+                if (pool.parentName == null) {
                     return 1;
                 } else {
                     int test = parentName.compareTo(pool.parentName);
-                    if(test != 0) {
+                    if (test != 0) {
                         return test;
                     } else {
                         return names;
@@ -248,6 +252,7 @@
     }
 
     public static class ConnectionFactorySummary implements Serializable, Comparable {
+        private static final long serialVersionUID = 5777507920880039759L;
         private final String factoryObjectName;
         private final String name;
         private final int state;
@@ -275,13 +280,14 @@
         }
 
         public int compareTo(Object o) {
-            final ConnectionFactorySummary pool = (ConnectionFactorySummary)o;
+            final ConnectionFactorySummary pool = (ConnectionFactorySummary) o;
             return name.compareTo(pool.name);
         }
     }
 
 
     public static class AdminObjectSummary implements Serializable, Comparable {
+        private static final long serialVersionUID = 3941332145785485903L;
         private final String adminObjectName;
         private final String name;
         private final String type;
@@ -315,7 +321,7 @@
         }
 
         public int compareTo(Object o) {
-            final AdminObjectSummary pool = (AdminObjectSummary)o;
+            final AdminObjectSummary pool = (AdminObjectSummary) o;
             int result = name.compareTo(pool.name);
             return result == 0 ? type.compareTo(pool.type) : result;
         }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/ListScreenHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/ListScreenHandler.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/ListScreenHandler.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/threads/ListScreenHandler.java Sat Apr 22 19:55:45 2006
@@ -63,6 +63,7 @@
     }
 
     public static class ThreadPoolSummary implements Serializable, Comparable {
+        private static final long serialVersionUID = -7515061254194067140L;
         private final String abstractName;
         private final int maxSize;
         private final String name;

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/KernelHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/KernelHelper.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/KernelHelper.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/KernelHelper.java Sat Apr 22 19:55:45 2006
@@ -40,25 +40,4 @@
         ret = kernel.invoke(mBeanName, function, args, types);
         return ret;
     }
-
-    protected static Object get(ObjectName mBeanName, String attributeName) {
-        Object ret = null;
-        try {
-            ret = kernel.getAttribute(mBeanName, attributeName);
-        } catch (Exception e) {
-            e.printStackTrace(System.out);
-        }
-        return ret;
-    }
-
-    protected static void set(ObjectName mBeanName, String attributeName,
-            Object value) {
-        Object ret = null;
-        try {
-            kernel.setAttribute(mBeanName, attributeName, value);
-        } catch (Exception e) {
-            e.printStackTrace(System.out);
-        }
-    }
-
 }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java Sat Apr 22 19:55:45 2006
@@ -32,20 +32,19 @@
 import javax.security.auth.spi.LoginModule;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.config.ConfigurationInfo;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.WriteableRepository;
-import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.geronimo.J2EEDomain;
 import org.apache.geronimo.management.geronimo.J2EEServer;
@@ -56,6 +55,7 @@
 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.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.WebAccessLog;
 import org.apache.geronimo.management.geronimo.WebConnector;

Modified: geronimo/branches/1.1/configs/client/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/client/src/plan/plan.xml?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/client/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/client/src/plan/plan.xml Sat Apr 22 19:55:45 2006
@@ -25,10 +25,7 @@
 by the app client.
                parentId="${pom.groupId}/client-system/${pom.currentVersion}/car"
 -->
-<configuration
-        xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
-
-        >
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
     <!-- Naming properties -->
     <gbean name="NamingProperties" class="org.apache.geronimo.system.properties.NamingProperties">
@@ -99,6 +96,48 @@
         <reference name="ServerInfo">
             <name>ServerInfo</name>
         </reference>
+        <reference name="JVMs"/>
+        <references name="Resources">
+            <pattern>
+                <type>JCAResource</type>
+            </pattern>
+            <pattern>
+                <type>JavaMailResource</type>
+            </pattern>
+            <pattern>
+                <type>JDBCResource</type>
+            </pattern>
+            <pattern>
+                <type>JMSResource</type>
+            </pattern>
+            <pattern>
+                <type>JNDIResource</type>
+            </pattern>
+            <pattern>
+                <type>JTAResource</type>
+            </pattern>
+            <pattern>
+                <type>RMI_IIOPResource</type>
+            </pattern>
+            <pattern>
+                <type>URLResource</type>
+            </pattern>
+        </references>
+        <reference name="Applications"/>
+        <reference name="AppClientModules"/>
+        <reference name="WebModules"/>
+        <reference name="EJBModules"/>
+        <reference name="ResourceAdapterModules"/>
+        <reference name="WebManagers"/>
+        <reference name="EJBManagers"/>
+        <reference name="JMSManagers"/>
+        <reference name="ThreadPools"/>
+        <reference name="Repositories"/>
+        <reference name="SecurityRealms"/>
+        <reference name="LoginServices"/>
+        <reference name="KeystoreManagers"/>
+        <reference name="ConfigurationManager">
+            <name>ConfigurationManager</name>
+        </reference>
     </gbean>
-
 </configuration>

Modified: geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-server/src/plan/plan.xml Sat Apr 22 19:55:45 2006
@@ -26,10 +26,7 @@
                parentId="${pom.groupId}/rmi-naming/${pom.currentVersion}/car"
 
 -->
-<configuration
-        xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1"
-
-        >
+<configuration xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
 
     <gbean name="ConnectionTracker"
            class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean">
@@ -110,14 +107,66 @@
     </gbean>
 
     <!-- JSR77 Management Objects -->
-    <gbean name="geronimo.server" class="org.apache.geronimo.j2ee.management.impl.J2EEDomainImpl"/>
+    <gbean name="geronimo.server" class="org.apache.geronimo.j2ee.management.impl.J2EEDomainImpl">
+        <reference name="Servers"/>
+    </gbean>
     <gbean name="geronimo" class="org.apache.geronimo.j2ee.management.impl.J2EEServerImpl">
         <reference name="ServerInfo">
             <name>ServerInfo</name>
         </reference>
+        <reference name="JVMs"/>
+        <references name="Resources">
+            <pattern>
+                <type>JCAResource</type>
+            </pattern>
+            <pattern>
+                <type>JavaMailResource</type>
+            </pattern>
+            <pattern>
+                <type>JDBCResource</type>
+            </pattern>
+            <pattern>
+                <type>JMSResource</type>
+            </pattern>
+            <pattern>
+                <type>JNDIResource</type>
+            </pattern>
+            <pattern>
+                <type>JTAResource</type>
+            </pattern>
+            <pattern>
+                <type>RMI_IIOPResource</type>
+            </pattern>
+            <pattern>
+                <type>URLResource</type>
+            </pattern>
+        </references>
+        <reference name="Applications"/>
+        <reference name="AppClientModules"/>
+        <reference name="WebModules"/>
+        <reference name="EJBModules"/>
+        <reference name="ResourceAdapterModules"/>
+        <reference name="WebManagers"/>
+        <reference name="EJBManagers"/>
+        <reference name="JMSManagers"/>
+        <reference name="ThreadPools"/>
+        <reference name="Repositories"/>
+        <reference name="SecurityRealms"/>
+        <reference name="LoginServices"/>
+        <reference name="KeystoreManagers"/>
+        <reference name="ConfigurationInstaller">
+            <name>ConfigurationInstaller</name>
+        </reference>
+        <reference name="ConfigurationManager">
+            <name>ConfigurationManager</name>
+        </reference>
     </gbean>
 
-    <gbean name="JVM" class="org.apache.geronimo.j2ee.management.impl.JVMImpl"/>
+    <gbean name="JVM" class="org.apache.geronimo.j2ee.management.impl.JVMImpl">
+        <reference name="SystemLog">
+            <name>Logger</name>
+        </reference>
+    </gbean>
 
     <gbean name="eis/JAXR" class="org.apache.geronimo.webservices.jaxr.JAXRGBean"/>
 

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Sat Apr 22 19:55:45 2006
@@ -87,6 +87,7 @@
 import org.apache.geronimo.xbeans.j2ee.ResourceadapterType;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
+import org.apache.geronimo.management.geronimo.JCAAdminObject;
 import org.apache.geronimo.management.JCAConnectionFactory;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
@@ -112,6 +113,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.Collection;
+import java.util.LinkedHashMap;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
@@ -353,8 +355,13 @@
         }
 
         GBeanData jcaResourceData = new GBeanData(jcaResourcejsr77Name, JCAResourceImplGBean.GBEAN_INFO);
-        jcaResourceData.setReferencePattern("ConnectionFactories", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), Collections.EMPTY_MAP, JCAConnectionFactory.class.getName()));
-        jcaResourceData.setReferencePattern("ResourceAdapters", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), Collections.EMPTY_MAP, JCAResourceAdapter.class.getName()));
+        Map thisModule = new LinkedHashMap(2);
+        thisModule .put(NameFactory.J2EE_APPLICATION, resourceAdapterModuleName.getNameProperty(NameFactory.J2EE_APPLICATION));
+        thisModule .put(NameFactory.RESOURCE_ADAPTER_MODULE, resourceAdapterModuleName.getNameProperty(NameFactory.J2EE_NAME));
+        jcaResourceData.setReferencePattern("ConnectionFactories", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), thisModule, JCAConnectionFactory.class.getName()));
+        jcaResourceData.setReferencePattern("ResourceAdapters", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), thisModule, JCAResourceAdapter.class.getName()));
+        jcaResourceData.setReferencePattern("AdminObjects", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), thisModule, JCAAdminObject.class.getName()));
+
         try {
             earContext.addGBean(jcaResourceData);
         } catch (GBeanAlreadyExistsException e) {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapper.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapper.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapper.java Sat Apr 22 19:55:45 2006
@@ -19,10 +19,10 @@
 
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
 
-import javax.management.ObjectName;
 import java.util.Map;
 import java.util.HashMap;
 import java.lang.reflect.Constructor;
@@ -43,6 +43,7 @@
 
 
     private final Kernel kernel;
+    private final AbstractName abstractName;
     private final String objectName;
 
     /**
@@ -54,6 +55,7 @@
         adminObject = null;
         delegate = null;
         kernel = null;
+        abstractName = null;
         objectName = null;
     }
 
@@ -68,11 +70,13 @@
     public AdminObjectWrapper(final String adminObjectInterface,
                               final String adminObjectClass,
                               final Kernel kernel,
+                              final AbstractName abstractName,
                               final String objectName,
                               final ClassLoader cl) throws IllegalAccessException, InstantiationException, ClassNotFoundException {
         this.adminObjectInterface = adminObjectInterface;
         this.adminObjectClass = adminObjectClass;
         this.kernel = kernel;
+        this.abstractName = abstractName;
         this.objectName = objectName;
         Class clazz = cl.loadClass(adminObjectClass);
         adminObject = clazz.newInstance();
@@ -178,11 +182,26 @@
             Constructor con = cls.getConstructor(new Class[]{String.class});
             value = con.newInstance(new Object[]{value});
         }
-        kernel.setAttribute(ObjectName.getInstance(objectName), property, value);
+        kernel.setAttribute(abstractName, property, value);
     }
 
     public Object getConfigProperty(String property) throws Exception {
         return delegate.getAttribute(property);
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return false;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
 }

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapperGBean.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapperGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectWrapperGBean.java Sat Apr 22 19:55:45 2006
@@ -19,6 +19,7 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.geronimo.JCAAdminObject;
@@ -36,6 +37,7 @@
         infoBuilder.addAttribute("adminObjectInterface", String.class, true);
         infoBuilder.addAttribute("adminObjectClass", String.class, true);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
+        infoBuilder.addAttribute("abstractName", AbstractName.class, false);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
 
@@ -46,6 +48,7 @@
             "adminObjectInterface",
             "adminObjectClass",
             "kernel",
+            "abstractName",
             "objectName",
             "classLoader"
         });



Mime
View raw message