geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r396206 [2/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
Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImpl.java Sat Apr 22 19:55:45 2006
@@ -19,10 +19,17 @@
 import org.apache.geronimo.management.geronimo.JCAResource;
 import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
 import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAAdminObject;
+import org.apache.geronimo.j2ee.management.impl.Util;
 
 import java.util.Collection;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * @version $Rev$ $Date$
@@ -32,20 +39,17 @@
 
     private final Collection connectionFactories;
     private final Collection resourceAdapters;
+    private final Collection adminObjects;
 
-    public JCAResourceImpl(String objectName, Collection connectionFactories, Collection resourceAdapters) {
+    public JCAResourceImpl(String objectName, Collection connectionFactories, Collection resourceAdapters, Collection adminObjects) {
         this.objectName = objectName;
         this.connectionFactories = connectionFactories;
         this.resourceAdapters = resourceAdapters;
+        this.adminObjects = adminObjects;
     }
 
     public String[] getConnectionFactories() {
-        ArrayList temp = new ArrayList();
-        for (Iterator iterator = connectionFactories.iterator(); iterator.hasNext();) {
-            JCAConnectionFactory jcaConnectionFactory = (JCAConnectionFactory) iterator.next();
-            temp.add(jcaConnectionFactory.getObjectName());
-        }
-        return (String[])temp.toArray(new String[temp.size()]);
+        return Util.getObjectNames(getConnectionFactoryInstances());
     }
 
     public String[] getResourceAdapterInstanceNames() {
@@ -64,6 +68,70 @@
     public JCAConnectionFactory[] getConnectionFactoryInstances() {
         return (JCAConnectionFactory[])connectionFactories.toArray(new JCAConnectionFactory[connectionFactories.size()]);
     }
+
+    public JCAManagedConnectionFactory[] getOutboundFactories() {
+        return getOutboundFactories((String[]) null);
+    }
+
+    public JCAManagedConnectionFactory[] getOutboundFactories(String connectionFactoryInterface) {
+        return getOutboundFactories(new String[]{connectionFactoryInterface});
+    }
+
+    public JCAManagedConnectionFactory[] getOutboundFactories(String[] connectionFactoryInterfaces) {
+        Set interfaceFilter = null;
+        if (connectionFactoryInterfaces != null) {
+            interfaceFilter = new HashSet(Arrays.asList(connectionFactoryInterfaces));
+        }
+
+        List list = new ArrayList();
+        for (Iterator iterator = connectionFactories.iterator(); iterator.hasNext();) {
+            JCAConnectionFactory jcaConnectionFactory = (JCAConnectionFactory) iterator.next();
+            JCAManagedConnectionFactory mcf = jcaConnectionFactory.getManagedConnectionFactoryInstance();
+            if (interfaceFilter == null || interfaceFilter.contains(mcf.getConnectionFactoryInterface())) {
+                list.add(mcf);
+                continue;
+            }
+            for (int m = 0; m < mcf.getImplementedInterfaces().length; m++) {
+                String iface = mcf.getImplementedInterfaces()[m];
+                if (interfaceFilter == null || interfaceFilter.contains(iface)) {
+                    list.add(mcf);
+                    break;
+                }
+            }
+        }
+        return (JCAManagedConnectionFactory[]) list.toArray(new JCAManagedConnectionFactory[list.size()]);
+    }
+
+    public String[] getAdminObjects() {
+        return Util.getObjectNames(getAdminObjectInstances());
+    }
+
+    public JCAAdminObject[] getAdminObjectInstances() {
+        return (JCAAdminObject[]) adminObjects.toArray(new JCAAdminObject[connectionFactories.size()]);
+    }
+
+    public JCAAdminObject[] getAdminObjectInstances(String adminObjectInterface) {
+        return getAdminObjectInstances(new String[] {adminObjectInterface});
+    }
+
+    public JCAAdminObject[] getAdminObjectInstances(String[] adminObjectInterfaces) {
+        Set interfaceFilter = null;
+        if (adminObjectInterfaces != null) {
+            interfaceFilter = new HashSet(Arrays.asList(adminObjectInterfaces));
+        }
+
+        List list = new ArrayList();
+
+        for (Iterator iterator = adminObjects.iterator(); iterator.hasNext();) {
+            JCAAdminObject adminObject = (JCAAdminObject) iterator.next();
+            if (interfaceFilter == null || interfaceFilter.contains(adminObject.getAdminObjectInterface())) {
+                list.add(adminObject);
+            }
+        }
+
+        return (JCAAdminObject[]) list.toArray(new JCAAdminObject[list.size()]);
+    }
+
 
     public String getObjectName() {
         return objectName;

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/JCAResourceImplGBean.java Sat Apr 22 19:55:45 2006
@@ -17,13 +17,13 @@
 
 package org.apache.geronimo.connector;
 
-import org.apache.geronimo.connector.outbound.JCAConnectionFactoryImpl;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
 import org.apache.geronimo.management.geronimo.JCAResource;
 import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAAdminObject;
 
 public class JCAResourceImplGBean {
 
@@ -34,12 +34,14 @@
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addReference("ConnectionFactories", JCAConnectionFactory.class, NameFactory.JCA_CONNECTION_FACTORY);
         infoBuilder.addReference("ResourceAdapters", JCAResourceAdapter.class, NameFactory.JCA_RESOURCE_ADAPTER);
+        infoBuilder.addReference("AdminObjects", JCAAdminObject.class, NameFactory.JCA_ADMIN_OBJECT);
         infoBuilder.addInterface(JCAResource.class);
 
         infoBuilder.setConstructor(new String[]{
             "objectName",
             "ConnectionFactories",
-            "ResourceAdapters"
+            "ResourceAdapters",
+            "AdminObjects"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java Sat Apr 22 19:55:45 2006
@@ -18,19 +18,18 @@
 
 import java.util.Hashtable;
 import java.util.Map;
-
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
+import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.geronimo.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
-import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
-import org.apache.geronimo.kernel.ObjectNameUtil;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 395155 $ $Date$
  */
 public class ResourceAdapterModuleImpl implements ResourceAdapterModule {
     private final J2EEServer server;

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java Sat Apr 22 19:55:45 2006
@@ -36,6 +36,7 @@
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 import org.apache.geronimo.transaction.manager.NamedXAResource;
@@ -71,6 +72,7 @@
     private Object proxy;
     private ConnectorMethodInterceptor interceptor;
     private final Kernel kernel;
+    private final AbstractName abstractName;
     private final String objectName;
     private final boolean isProxyable;
     private final ClassLoader classLoader;
@@ -84,6 +86,7 @@
         connectionInterface = null;
         connectionImplClass = null;
         kernel = null;
+        abstractName = null;
         objectName = null;
         allImplementedInterfaces = null;
         isProxyable = false;
@@ -101,6 +104,7 @@
                                            ResourceAdapterWrapper resourceAdapterWrapper,
                                            ConnectionManagerContainer connectionManagerContainer,
                                            Kernel kernel,
+                                           AbstractName abstractName,
                                            String objectName,
                                            ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
         this.managedConnectionFactoryClass = managedConnectionFactoryClass;
@@ -136,8 +140,8 @@
         delegate = new DynamicGBeanDelegate();
         delegate.addAll(managedConnectionFactory);
         this.kernel = kernel;
+        this.abstractName = abstractName;
         this.objectName = objectName;
-
     }
 
     public String getManagedConnectionFactoryClass() {
@@ -306,7 +310,7 @@
             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 {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperGBean.java Sat Apr 22 19:55:45 2006
@@ -19,6 +19,7 @@
 import org.apache.geronimo.connector.ResourceAdapterWrapper;
 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.transaction.manager.ResourceManager;
@@ -42,6 +43,7 @@
         infoFactory.addAttribute("connectionInterface", String.class, true);
         infoFactory.addAttribute("connectionImplClass", String.class, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("abstractName", AbstractName.class, false);
         infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
 
@@ -65,6 +67,7 @@
             "ResourceAdapterWrapper",
             "ConnectionManagerContainer",
             "kernel",
+            "abstractName",
             "objectName",
             "classLoader"});
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Sat Apr 22 19:55:45 2006
@@ -30,9 +30,9 @@
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.LinkedHashMap;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -63,10 +63,11 @@
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
@@ -487,7 +488,25 @@
                 } catch (Exception e) {
                     throw new DeploymentException("Error initializing J2EEApplication managed object");
                 }
-                gbeanData.setReferencePatterns("j2eeServer", new ReferencePatterns(new AbstractNameQuery(J2EEServer.class.getName())));
+                gbeanData.setReferencePatterns("Server", new ReferencePatterns(new AbstractNameQuery(J2EEServer.class.getName())));
+
+                Map thisApp = Collections.singletonMap(NameFactory.J2EE_APPLICATION, earContext.getModuleName().getNameProperty(NameFactory.J2EE_NAME));
+                LinkedHashSet resourcePatterns = new LinkedHashSet();
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JAVA_MAIL_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JCA_CONNECTION_FACTORY), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JDBC_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JDBC_DRIVER), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JMS_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JNDI_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.JTA_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.RMI_IIOP_RESOURCE), J2EEResource.class.getName()));
+                resourcePatterns.add(new AbstractNameQuery(null, filter(thisApp, NameFactory.J2EE_TYPE, NameFactory.URL_RESOURCE), J2EEResource.class.getName()));
+                gbeanData.setReferencePatterns("Resources", resourcePatterns);
+
+                gbeanData.setReferencePatterns("AppClientModules", new ReferencePatterns(new AbstractNameQuery(null, thisApp, org.apache.geronimo.management.AppClientModule.class.getName())));
+                gbeanData.setReferencePatterns("EJBModules", new ReferencePatterns(new AbstractNameQuery(null, thisApp, org.apache.geronimo.management.EJBModule.class.getName())));
+                gbeanData.setReferencePatterns("ResourceAdapterModules", new ReferencePatterns(new AbstractNameQuery(null, thisApp, org.apache.geronimo.management.geronimo.ResourceAdapterModule.class.getName())));
+                gbeanData.setReferencePatterns("WebModules", new ReferencePatterns(new AbstractNameQuery(null, thisApp, org.apache.geronimo.management.geronimo.WebModule.class.getName())));
                 earContext.addGBean(gbeanData);
             }
 
@@ -550,6 +569,12 @@
                 module.close();
             }
         }
+    }
+
+    private static Map filter(Map original, String key, String value) {
+        LinkedHashMap filter = new LinkedHashMap(original);
+        filter.put(key, value);
+        return filter;
     }
 
     private void addModules(JarFile earFile, ApplicationType application, GerApplicationType gerApplication, Set moduleLocations, Set modules, Environment environment, AbstractName earName) throws DeploymentException {

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEApplicationImpl.java Sat Apr 22 19:55:45 2006
@@ -17,11 +17,12 @@
 package org.apache.geronimo.j2ee.management.impl;
 
 import java.util.Hashtable;
+import java.util.Collection;
+import java.util.ArrayList;
 import javax.management.ObjectName;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.AppClientModule;
 import org.apache.geronimo.management.EJBModule;
@@ -36,26 +37,35 @@
  * @version $Rev$ $Date$
  */
 public class J2EEApplicationImpl implements J2EEApplication {
+    private final String objectName;
     private final String deploymentDescriptor;
-    private final String baseName;
-    private final Kernel kernel;
     private final J2EEServer server;
-    private final String objectName;
+    private final Collection resources;
+    private final Collection appClientModules;
+    private final Collection ejbModules;
+    private final Collection resourceAdapterModules;
+    private final Collection webModules;
+
+    public J2EEApplicationImpl(String objectName,
+            String deploymentDescriptor,
+            J2EEServer server,
+            Collection resources,
+            Collection appClientModules,
+            Collection ejbModules,
+            Collection resourceAdapterModules,
+            Collection webModules) {
 
-    public J2EEApplicationImpl(Kernel kernel, String objectName, J2EEServer server, String deploymentDescriptor) {
         this.objectName = objectName;
         ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
-        // build the base name used to query the server for child modules
-        Hashtable keyPropertyList = myObjectName.getKeyPropertyList();
-        String name = (String) keyPropertyList.get("name");
-        String j2eeServerName = (String) keyPropertyList.get("J2EEServer");
-        baseName = myObjectName.getDomain() + ":J2EEServer=" + j2eeServerName + ",J2EEApplication=" + name + ",";
-
-        this.kernel = kernel;
-        this.server = server;
         this.deploymentDescriptor = deploymentDescriptor;
+        this.server = server;
+        this.resources = resources;
+        this.appClientModules = appClientModules;
+        this.ejbModules = ejbModules;
+        this.resourceAdapterModules = resourceAdapterModules;
+        this.webModules = webModules;
     }
 
     public String getObjectName() {
@@ -99,39 +109,50 @@
     }
 
     public String[] getModules() {
-        return Util.getObjectNames(kernel,
-                baseName,
-                new String[]{"AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"});
+        return Util.getObjectNames(getModulesInstances());
     }
 
     public J2EEModule[] getModulesInstances() {
-        return (J2EEModule[]) Util.getObjects(kernel, baseName,
-                new String[]{"AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"}, J2EEModule.class);
+        ArrayList objects = new ArrayList();
+        if (appClientModules != null) {
+            objects.addAll(appClientModules);
+        }
+        if (ejbModules != null) {
+            objects.addAll(ejbModules);
+        }
+        if (webModules != null) {
+            objects.addAll(webModules);
+        }
+        if (resourceAdapterModules != null) {
+            objects.addAll(resourceAdapterModules);
+        }
+
+        return (J2EEModule[]) objects.toArray(new J2EEModule[objects.size()]);
     }
 
     public J2EEResource[] getResources() {
-        return (J2EEResource[]) Util.getObjects(kernel, baseName,
-                new String[]{"JavaMailResource", "JCAConnectionFactory", "JDBCResource", "JDBCDriver", "JMSResource", "JNDIResource", "JTAResource", "RMI_IIOPResource", "URLResource"}, J2EEResource.class);
+        if (resources == null) return new J2EEResource[0];
+        return (J2EEResource[]) resources.toArray(new J2EEResource[resources.size()]);
     }
 
     public AppClientModule[] getClientModules() {
-        return (AppClientModule[]) Util.getObjects(kernel, baseName,
-                new String[]{"AppClientModule"}, AppClientModule.class);
+        if (appClientModules == null) return new AppClientModule[0];
+        return (AppClientModule[]) appClientModules.toArray(new AppClientModule[appClientModules.size()]);
     }
 
     public EJBModule[] getEJBModules() {
-        return (EJBModule[]) Util.getObjects(kernel, baseName,
-                new String[]{"EJBModule"}, EJBModule.class);
+        if (ejbModules == null) return new EJBModule[0];
+        return (EJBModule[]) ejbModules.toArray(new EJBModule[ejbModules.size()]);
     }
 
     public ResourceAdapterModule[] getRAModules() {
-        return (ResourceAdapterModule[]) Util.getObjects(kernel, baseName,
-                new String[]{"ResourceAdapterModule"}, ResourceAdapterModule.class);
+        if (resourceAdapterModules == null) return new ResourceAdapterModule[0];
+        return (ResourceAdapterModule[]) resourceAdapterModules.toArray(new ResourceAdapterModule[resourceAdapterModules.size()]);
     }
 
     public WebModule[] getWebModules() {
-        return (WebModule[]) Util.getObjects(kernel, baseName,
-                new String[]{"WebModule"}, WebModule.class);
+        if (webModules == null) return new WebModule[0];
+        return (WebModule[]) webModules.toArray(new WebModule[webModules.size()]);
     }
 
     public String getDeploymentDescriptor() {
@@ -146,17 +167,24 @@
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(J2EEApplicationImpl.class, NameFactory.J2EE_APPLICATION);
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addReference("j2eeServer", J2EEServer.class);
         infoFactory.addAttribute("deploymentDescriptor", String.class, true);
-        infoFactory.addInterface(J2EEApplication.class);
+        infoFactory.addReference("Server", J2EEServer.class);
+        infoFactory.addReference("Resources", J2EEResource.class);
+        infoFactory.addReference("AppClientModules", AppClientModule.class);
+        infoFactory.addReference("EJBModules", EJBModule.class);
+        infoFactory.addReference("ResourceAdapterModules", ResourceAdapterModule.class);
+        infoFactory.addReference("WebModules", WebModule.class);
 
         infoFactory.setConstructor(new String[]{
-            "kernel",
-            "objectName",
-            "j2eeServer",
-            "deploymentDescriptor"});
+                "objectName",
+                "deploymentDescriptor",
+                "Server",
+                "Resources",
+                "AppClientModules",
+                "EJBModules",
+                "ResourceAdapterModules",
+                "WebModules",
+        });
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEDomainImpl.java Sat Apr 22 19:55:45 2006
@@ -18,11 +18,11 @@
 package org.apache.geronimo.j2ee.management.impl;
 
 import java.util.Hashtable;
+import java.util.Collection;
 import javax.management.ObjectName;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.J2EEDomain;
@@ -32,17 +32,14 @@
  * @version $Rev$ $Date$
  */
 public class J2EEDomainImpl implements J2EEDomain {
-    private final Kernel kernel;
-    private final String baseName;
     private final String objectName;
+    private final Collection servers;
 
-    public J2EEDomainImpl(Kernel kernel, String objectName) {
+    public J2EEDomainImpl(String objectName, Collection servers) {
         this.objectName = objectName;
         ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
-        baseName = myObjectName.getDomain() + ":";
-
-        this.kernel = kernel;
+        this.servers = servers;
     }
 
     public String getObjectName() {
@@ -82,11 +79,12 @@
 
 
     public String[] getServers() {
-        return Util.getObjectNames(kernel, baseName, new String[]{"J2EEServer"});
+        return Util.getObjectNames(getServerInstances());
     }
 
     public J2EEServer[] getServerInstances() {
-        return (J2EEServer[]) Util.getObjects(kernel, baseName, new String[]{"J2EEServer"}, J2EEServer.class);
+        if (servers == null) return new J2EEServer[0];
+        return (J2EEServer[]) servers.toArray(new J2EEServer[servers.size()]);
     }
 
     public static final GBeanInfo GBEAN_INFO;
@@ -94,12 +92,8 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(J2EEDomainImpl.class, NameFactory.J2EE_DOMAIN);
 
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("servers", String[].class, false);
-        infoFactory.addInterface(J2EEDomain.class);
-
-        infoFactory.setConstructor(new String[]{"kernel", "objectName"});
+        infoFactory.addReference("Servers", J2EEServer.class, NameFactory.J2EE_SERVER);
+        infoFactory.setConstructor(new String[]{"objectName", "Servers"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/J2EEServerImpl.java Sat Apr 22 19:55:45 2006
@@ -17,34 +17,34 @@
 
 package org.apache.geronimo.j2ee.management.impl;
 
-import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Set;
 import javax.management.ObjectName;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.proxy.ProxyManager;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.management.AppClientModule;
+import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.J2EEResource;
 import org.apache.geronimo.management.geronimo.EJBManager;
+import org.apache.geronimo.management.geronimo.J2EEApplication;
 import org.apache.geronimo.management.geronimo.J2EEServer;
 import org.apache.geronimo.management.geronimo.JMSManager;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.geronimo.KeystoreManager;
 import org.apache.geronimo.management.geronimo.LoginService;
+import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.management.geronimo.SecurityRealm;
 import org.apache.geronimo.management.geronimo.WebManager;
-import org.apache.geronimo.management.geronimo.KeystoreManager;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.system.configuration.ConfigurationInstaller;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.system.threads.ThreadPool;
 
 /**
@@ -52,23 +52,71 @@
  */
 public class J2EEServerImpl implements J2EEServer {
     private static final String SERVER_VENDOR = "The Apache Software Foundation";
-    private final Kernel kernel;
-    private final String baseName;
-    private final ServerInfo serverInfo;
     private final String objectName;
+    private final ServerInfo serverInfo;
+    private final Collection jvms;
+    private final Collection resources;
+    private final Collection j2eeApplications;
+    private final Collection appClientModules;
+    private final Collection webModules;
+    private final Collection ejbModules;
+    private final Collection resourceAdapterModules;
+    private final Collection webManagers;
+    private final Collection ejbManagers;
+    private final Collection jmsManagers;
+    private final Collection threadPools;
+    private final Collection repositories;
+    private final Collection securityRealms;
+    private final Collection loginServices;
+    private final Collection keystoreManagers;
+    private final ConfigurationInstaller configurationInstaller;
+    private final ConfigurationManager configurationManager;
+
+    public J2EEServerImpl(String objectName,
+            ServerInfo serverInfo,
+            Collection jvms,
+            Collection resources,
+            Collection applications,
+            Collection appClientModules,
+            Collection webModules,
+            Collection ejbModules,
+            Collection resourceAdapterModules,
+            Collection webManagers,
+            Collection ejbManagers,
+            Collection jmsManagers,
+            Collection threadPools,
+            Collection repositories,
+            Collection securityRealms,
+            Collection loginServices,
+            Collection keystoreManagers,
+            ConfigurationInstaller configurationInstaller,
+            ConfigurationManager configurationManager) {
 
-    public J2EEServerImpl(Kernel kernel, String objectName, ServerInfo serverInfo) {
         this.objectName = objectName;
         ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
 
-        // build the base name used to query the server for child modules
-        Hashtable keyPropertyList = myObjectName.getKeyPropertyList();
-        String name = (String) keyPropertyList.get("name");
-        baseName = myObjectName.getDomain() + ":J2EEServer=" + name + ",";
-
-        this.kernel = kernel;
         this.serverInfo = serverInfo;
+        this.jvms = jvms;
+        this.resources = resources;
+
+        this.j2eeApplications = applications;
+        this.appClientModules = appClientModules;
+        this.webModules = webModules;
+        this.ejbModules = ejbModules;
+        this.resourceAdapterModules = resourceAdapterModules;
+
+        this.webManagers = webManagers;
+        this.ejbManagers = ejbManagers;
+        this.jmsManagers = jmsManagers;
+
+        this.threadPools = threadPools;
+        this.repositories = repositories;
+        this.securityRealms = securityRealms;
+        this.loginServices = loginServices;
+        this.keystoreManagers = keystoreManagers;
+        this.configurationInstaller = configurationInstaller;
+        this.configurationManager = configurationManager;
     }
 
     public String getObjectName() {
@@ -110,77 +158,124 @@
 
 
     public String[] getDeployedObjects() {
-        return Util.getObjectNames(kernel,
-                baseName,
-                new String[]{"J2EEApplication", "AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"});
+        return Util.getObjectNames(getDeployedObjectInstances());
     }
 
     public J2EEDeployedObject[] getDeployedObjectInstances() {
-        return (J2EEDeployedObject[]) Util.getObjects(kernel, baseName,
-                new String[]{"J2EEApplication", "AppClientModule", "EJBModule", "WebModule", "ResourceAdapterModule"}, J2EEDeployedObject.class);
+        ArrayList objects = new ArrayList();
+        if (j2eeApplications != null) {
+            objects.addAll(j2eeApplications);
+        }
+        if (appClientModules  != null) {
+            objects.addAll(appClientModules);
+        }
+        if (ejbModules  != null) {
+            objects.addAll(ejbModules);
+        }
+        if (webModules  != null) {
+            objects.addAll(webModules);
+        }
+        if (resourceAdapterModules != null) {
+            objects.addAll(resourceAdapterModules);
+        }
+
+        return (J2EEDeployedObject[]) objects.toArray(new J2EEDeployedObject[objects.size()]);
     }
 
     public String[] getResources() {
-        return Util.getObjectNames(kernel,
-                baseName,
-                new String[]{"JCAResource", "JavaMailResource", "JDBCResource", "JMSResource", "JNDIResource", "JTAResource", "RMI_IIOPResource", "URLResource"});
+        return Util.getObjectNames(getResourceInstances());
     }
 
     public J2EEResource[] getResourceInstances() {
-        return (J2EEResource[]) Util.getObjects(kernel, baseName,
-                new String[]{"JCAResource", "JavaMailResource", "JDBCResource", "JMSResource", "JNDIResource", "JTAResource", "RMI_IIOPResource", "URLResource"}, J2EEResource.class);
+        if (resources == null) return new J2EEResource[0];
+        return (J2EEResource[]) resources.toArray(new J2EEResource[resources.size()]);
     }
 
     public String[] getJavaVMs() {
-        return Util.getObjectNames(kernel, baseName, new String[]{"JVM"});
+        return Util.getObjectNames(getJavaVMInstances());
     }
 
     public JVM[] getJavaVMInstances() {
-        return (JVM[]) Util.getObjects(kernel, baseName, new String[]{"JVM"}, JVM.class);
+        if (jvms == null) return new JVM[0];
+        return (JVM[]) jvms.toArray(new JVM[jvms.size()]);
     }
 
+    public J2EEApplication[] getApplications() {
+        if (j2eeApplications == null) return new J2EEApplication[0];
+        return (J2EEApplication[]) j2eeApplications.toArray(new J2EEApplication[j2eeApplications.size()]);
+    }
+
+    public AppClientModule[] getAppClients() {
+        if (appClientModules == null) return new AppClientModule[0];
+        return (AppClientModule[]) appClientModules.toArray(new AppClientModule[appClientModules.size()]);
+    }
+
+    public WebModule[] getWebModules() {
+        if (webModules == null) return new WebModule[0];
+        return (WebModule[]) webModules.toArray(new WebModule[webModules.size()]);
+    }
+
+    public EJBModule[] getEJBModules() {
+        if (ejbModules == null) return new EJBModule[0];
+        return (EJBModule[]) ejbModules.toArray(new EJBModule[ejbModules.size()]);
+    }
+
+    public ResourceAdapterModule[] getResourceAdapterModules() {
+        if (resourceAdapterModules == null) return new ResourceAdapterModule[0];
+        return (ResourceAdapterModule[]) resourceAdapterModules.toArray(new ResourceAdapterModule[resourceAdapterModules.size()]);
+    }
+
+
     public WebManager[] getWebManagers() {
-        return (WebManager[]) getObjects(WebManager.class, false);
+        if (webManagers == null) return new WebManager[0];
+        return (WebManager[]) webManagers.toArray(new WebManager[webManagers.size()]);
     }
 
     public EJBManager[] getEJBManagers() {
-        return (EJBManager[]) getObjects(EJBManager.class, false);
+        if (ejbManagers == null) return new EJBManager[0];
+        return (EJBManager[]) ejbManagers.toArray(new EJBManager[ejbManagers.size()]);
     }
 
     public JMSManager[] getJMSManagers() {
-        return (JMSManager[]) getObjects(JMSManager.class, false);
+        if (jmsManagers == null) return new JMSManager[0];
+        return (JMSManager[]) jmsManagers.toArray(new JMSManager[jmsManagers.size()]);
     }
 
     public ThreadPool[] getThreadPools() {
-        return (ThreadPool[]) getObjects(ThreadPool.class, true);
+        if (threadPools == null) return new ThreadPool[0];
+        return (ThreadPool[]) threadPools.toArray(new ThreadPool[threadPools.size()]);
     }
 
     public Repository[] getRepositories() {
-        return (Repository[]) getObjects(Repository.class, true);
+        if (repositories == null) return new Repository[0];
+        return (Repository[]) repositories.toArray(new Repository[repositories.size()]);
     }
 
     public SecurityRealm[] getSecurityRealms() {
-        return (SecurityRealm[]) getObjects(SecurityRealm.class, true);
+        if (securityRealms == null) return new SecurityRealm[0];
+        return (SecurityRealm[]) securityRealms.toArray(new SecurityRealm[securityRealms.size()]);
     }
 
     public ServerInfo getServerInfo() {
-        return (ServerInfo) getObject(ServerInfo.class);
+        return serverInfo;
     }
 
     public LoginService getLoginService() {
-        return (LoginService) getObject(LoginService.class);
+        if (loginServices == null) return null;
+        return (LoginService) loginServices.iterator().next();
     }
 
     public KeystoreManager getKeystoreManager() {
-        return (KeystoreManager) getObject(KeystoreManager.class);
+        if (keystoreManagers == null) return null;
+        return (KeystoreManager) keystoreManagers.iterator().next();
     }
 
     public ConfigurationInstaller getConfigurationInstaller() {
-        return (ConfigurationInstaller) getObject(ConfigurationInstaller.class);
+        return configurationInstaller;
     }
 
     public ConfigurationManager getConfigurationManager() {
-        return ConfigurationUtil.getConfigurationManager(kernel);
+        return configurationManager;
     }
 
     public String getServerVendor() {
@@ -191,53 +286,51 @@
         return serverInfo.getVersion();
     }
 
-    private Object getObject(Class type) {
-        Set names = kernel.listGBeans(new AbstractNameQuery(type.getName()));
-        if (names.isEmpty()) {
-            return null;
-        }
-        AbstractName name = (AbstractName) names.iterator().next();
-        return kernel.getProxyManager().createProxy(name, type);
-    }
-
-    private Object[] getObjects(Class type, boolean returnEmpty) {
-        Set names = kernel.listGBeans(new AbstractNameQuery(type.getName()));
-
-        if(names.size() == 0) {
-            if (returnEmpty) {
-                return (Object[]) Array.newInstance(type, 0);
-            } else {
-                return null;
-            }
-        }
-
-        Object[] results = (Object[]) Array.newInstance(type, names.size());
-        ProxyManager mgr = kernel.getProxyManager();
-        int i=0;
-        for (Iterator it = names.iterator(); it.hasNext();) {
-            AbstractName name = (AbstractName) it.next();
-            results[i++] = mgr.createProxy(name, type.getClassLoader());
-        }
-        return results;
-    }
-
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(J2EEServerImpl.class, NameFactory.J2EE_SERVER);
 
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("deployedObjects", String[].class, false);
-        infoFactory.addAttribute("resources", String[].class, false);
-        infoFactory.addAttribute("javaVMs", String[].class, false);
-        infoFactory.addAttribute("serverVendor", String.class, false);
-        infoFactory.addAttribute("serverVersion", String.class, false);
-        infoFactory.addInterface(J2EEServer.class);
-
         infoFactory.addReference("ServerInfo", ServerInfo.class, NameFactory.GERONIMO_SERVICE);
-
-        infoFactory.setConstructor(new String[]{"kernel", "objectName", "ServerInfo"});
+        infoFactory.addReference("JVMs", JVM.class, NameFactory.JVM);
+        infoFactory.addReference("Resources", J2EEResource.class); // several types match this
+        infoFactory.addReference("Applications", J2EEApplication.class, NameFactory.J2EE_APPLICATION);
+        infoFactory.addReference("AppClientModules", AppClientModule.class, NameFactory.APP_CLIENT_MODULE);
+        infoFactory.addReference("WebModules", WebModule.class, NameFactory.WEB_MODULE);
+        infoFactory.addReference("EJBModules", EJBModule.class, NameFactory.EJB_MODULE);
+        infoFactory.addReference("ResourceAdapterModules", ResourceAdapterModule.class, NameFactory.RESOURCE_ADAPTER_MODULE);
+        infoFactory.addReference("WebManagers", WebManager.class);
+        infoFactory.addReference("EJBManagers", EJBManager.class);
+        infoFactory.addReference("JMSManagers", JMSManager.class);
+        infoFactory.addReference("ThreadPools", ThreadPool.class);
+        infoFactory.addReference("Repositories", Repository.class);
+        infoFactory.addReference("SecurityRealms", SecurityRealm.class);
+        infoFactory.addReference("LoginServices", LoginService.class);
+        infoFactory.addReference("KeystoreManagers", KeystoreManager.class);
+        infoFactory.addReference("ConfigurationInstaller", ConfigurationInstaller.class);
+        infoFactory.addReference("ConfigurationManager", ConfigurationManager.class);
+
+        infoFactory.setConstructor(new String[]{
+                "objectName",
+                "ServerInfo",
+                "JVMs",
+                "Resources",
+                "Applications",
+                "AppClientModules",
+                "WebModules",
+                "EJBModules",
+                "ResourceAdapterModules",
+                "WebManagers",
+                "EJBManagers",
+                "JMSManagers",
+                "ThreadPools",
+                "Repositories",
+                "SecurityRealms",
+                "LoginServices",
+                "KeystoreManagers",
+                "ConfigurationInstaller",
+                "ConfigurationManager",
+        });
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java Sat Apr 22 19:55:45 2006
@@ -20,22 +20,21 @@
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.Date;
-import java.util.Properties;
 import java.util.Hashtable;
-
+import java.util.Properties;
 import javax.management.ObjectName;
 import javax.management.j2ee.statistics.Stats;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.management.geronimo.JVM;
-import org.apache.geronimo.management.StatisticsProvider;
-import org.apache.geronimo.management.stats.JVMStatsImpl;
-import org.apache.geronimo.management.stats.BoundedRangeImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.ObjectNameUtil;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
+import org.apache.geronimo.management.StatisticsProvider;
+import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.stats.BoundedRangeImpl;
+import org.apache.geronimo.management.stats.JVMStatsImpl;
+import org.apache.geronimo.system.logging.SystemLog;
 
 /**
  *
@@ -43,7 +42,6 @@
  * @version $Rev$ $Date$
  */
 public class JVMImpl implements JVM, StatisticsProvider {
-    private final static Log log = LogFactory.getLog(JVMImpl.class);
     public static final String JAVA_VERSION = System.getProperty("java.version");
     public static final String JAVA_VENDOR = System.getProperty("java.vendor");
     public static final String NODE;
@@ -61,19 +59,15 @@
 
     private final String objectName;
     private final Kernel kernel;
-    private final String baseName;
+    private final SystemLog systemLog;
     private JVMStatsImpl stats;
 
-    public JVMImpl(String objectName, Kernel kernel) {
+    public JVMImpl(String objectName, Kernel kernel, SystemLog systemLog) {
         this.objectName = objectName;
         this.kernel = kernel;
+        this.systemLog = systemLog;
         ObjectName myObjectName = ObjectNameUtil.getObjectName(this.objectName);
         verifyObjectName(myObjectName);
-
-        // build the base name used to query the server for related modules
-        Hashtable keyPropertyList = myObjectName.getKeyPropertyList();
-        String serverName = (String) keyPropertyList.get("J2EEServer");
-        baseName = myObjectName.getDomain() + ":J2EEServer=" + serverName + ",";
     }
 
     /**
@@ -183,25 +177,16 @@
         return System.getProperties();
     }
 
-    public String getSystemLog() {
-        String[] logs = Util.getObjectNames(kernel, baseName, new String[]{NameFactory.SYSTEM_LOG});
-        if(logs.length != 1) {
-            log.error("Unable to resolve ObjectName for system log; got "+logs.length+" results!");
-            return null;
-        }
-        return logs[0];
+    public SystemLog getSystemLog() {
+        return systemLog;
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(JVMImpl.class, NameFactory.JVM);
-
-//        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addInterface(JVM.class);
-        infoFactory.addInterface(StatisticsProvider.class);
-        infoFactory.setConstructor(new String[] {"objectName", "kernel"});
+        infoFactory.addReference("SystemLog", SystemLog.class);
+        infoFactory.setConstructor(new String[] {"objectName", "kernel", "SystemLog"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java Sat Apr 22 19:55:45 2006
@@ -17,59 +17,21 @@
 
 package org.apache.geronimo.j2ee.management.impl;
 
-import java.lang.reflect.Array;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.proxy.ProxyManager;
+import org.apache.geronimo.management.J2EEManagedObject;
 
 /**
  * @version $Rev$ $Date$
  */
 public class Util {
-
-    public static String[] getObjectNames(Kernel kernel, String parentName, String[] j2eeTypes) {
-        List objectNames = new LinkedList();
-        for (int i = 0; i < j2eeTypes.length; i++) {
-            String j2eeType = j2eeTypes[i];
-            String name = parentName + "j2eeType=" + j2eeType + ",*";
-            try {
-                objectNames.addAll(kernel.listGBeans(new ObjectName(name)));
-            } catch (MalformedObjectNameException e) {
-                throw new IllegalArgumentException("Malformed ObjectName: " + name);
-            }
-        }
-        String[] names = new String[objectNames.size()];
-        Iterator iterator = objectNames.iterator();
-        for (int i = 0; iterator.hasNext(); i++) {
-            names[i] = iterator.next().toString();
-        }
-        return names;
+    private Util() {
     }
 
-
-    public static Object[] getObjects(Kernel kernel, String parentName, String[] j2eeTypes, Class target) {
-        List objectNames = new LinkedList();
-        for (int i = 0; i < j2eeTypes.length; i++) {
-            String j2eeType = j2eeTypes[i];
-            String name = parentName + "j2eeType=" + j2eeType + ",*";
-            try {
-                objectNames.addAll(kernel.listGBeans(new ObjectName(name)));
-            } catch (MalformedObjectNameException e) {
-                throw new IllegalArgumentException("Malformed ObjectName: " + name);
-            }
+    public static String[] getObjectNames(J2EEManagedObject[] objects) {
+        String[] objectNames = new String[objects.length];
+        for (int i = 0; i < objects.length; i++) {
+            J2EEManagedObject object = objects[i];
+            objectNames[i] = object.getObjectName();
         }
-        Object[] objects = (Object[]) Array.newInstance(target,objectNames.size());
-        ProxyManager pm = kernel.getProxyManager();
-        Iterator iterator = objectNames.iterator();
-        for (int i = 0; iterator.hasNext(); i++) {
-            objects[i] = pm.createProxy((ObjectName)iterator.next(), target.getClassLoader());
-        }
-        return objects;
+        return objectNames;
     }
-
-
 }

Modified: geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java Sat Apr 22 19:55:45 2006
@@ -20,6 +20,8 @@
 import java.util.HashSet;
 import java.util.Set;
 import java.util.Hashtable;
+import java.util.LinkedHashSet;
+import java.util.Collections;
 import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
 
@@ -27,13 +29,24 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.management.impl.J2EEDomainImpl;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.j2ee.management.impl.JVMImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.management.J2EEResource;
+import org.apache.geronimo.management.EJBModule;
+import org.apache.geronimo.management.AppClientModule;
+import org.apache.geronimo.management.geronimo.WebModule;
+import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
+import org.apache.geronimo.management.geronimo.J2EEApplication;
+import org.apache.geronimo.management.geronimo.J2EEServer;
+import org.apache.geronimo.management.geronimo.JVM;
 import org.apache.log4j.Logger;
 import org.apache.log4j.Level;
 import org.apache.log4j.ConsoleAppender;
@@ -53,11 +66,11 @@
     protected Kernel kernel;
 
     private static GBeanData buildGBeanData(String[] key, String[] value, GBeanInfo info) {
-        AbstractName abstractName = buildAbstractName(key, value, info);
+        AbstractName abstractName = buildAbstractName(key, value);
         return new GBeanData(abstractName, info);
     }
 
-    private static AbstractName buildAbstractName(String[] key, String value[], GBeanInfo info) {
+    private static AbstractName buildAbstractName(String[] key, String value[]) {
         Hashtable names = new Hashtable();
         for (int i = 0; i < key.length; i++) {
             String k = key[i];
@@ -82,16 +95,39 @@
         kernel.boot();
 
         ClassLoader classLoader = getClass().getClassLoader();
+
+        // server info
         SERVER_INFO_DATA.setAttribute("baseDirectory", System.getProperty("java.io.tmpdir"));
         kernel.loadGBean(SERVER_INFO_DATA, classLoader);
 
+        // domain
+        DOMAIN_DATA.setReferencePatterns("Servers", new ReferencePatterns(new AbstractNameQuery(J2EEServer.class.getName())));
         kernel.loadGBean(DOMAIN_DATA, classLoader);
 
+        // server
         SERVER_DATA.setReferencePattern("ServerInfo", SERVER_INFO_DATA.getAbstractName());
+        SERVER_DATA.setReferencePatterns("JVMs", new ReferencePatterns(new AbstractNameQuery(JVM.class.getName())));
+        LinkedHashSet resourcePatterns = new LinkedHashSet();
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JAVA_MAIL_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JCA_CONNECTION_FACTORY), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JDBC_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JMS_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JNDI_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.JTA_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.RMI_IIOP_RESOURCE), J2EEResource.class.getName()));
+        resourcePatterns.add(new AbstractNameQuery(null, Collections.singletonMap(NameFactory.J2EE_TYPE, NameFactory.URL_RESOURCE), J2EEResource.class.getName()));
+        SERVER_DATA.setReferencePatterns("Resources", resourcePatterns);
+        SERVER_DATA.setReferencePatterns("Applications", new ReferencePatterns(new AbstractNameQuery(J2EEApplication.class.getName())));
+        SERVER_DATA.setReferencePatterns("AppClientModules", new ReferencePatterns(new AbstractNameQuery(AppClientModule.class.getName())));
+        SERVER_DATA.setReferencePatterns("EJBModules", new ReferencePatterns(new AbstractNameQuery(EJBModule.class.getName())));
+        SERVER_DATA.setReferencePatterns("ResourceAdapterModules", new ReferencePatterns(new AbstractNameQuery(ResourceAdapterModule.class.getName())));
+        SERVER_DATA.setReferencePatterns("WebModules", new ReferencePatterns(new AbstractNameQuery(WebModule.class.getName())));
         kernel.loadGBean(SERVER_DATA, classLoader);
 
-
+        // JVM
         kernel.loadGBean(JVM_DATA, classLoader);
+
+        // start um
         kernel.startGBean(SERVER_INFO_DATA.getAbstractName());
         kernel.startGBean(DOMAIN_DATA.getAbstractName());
         kernel.startGBean(SERVER_DATA.getAbstractName());

Modified: geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/JVMTest.java Sat Apr 22 19:55:45 2006
@@ -39,9 +39,9 @@
 
     public void testStandardAttributes() throws Exception {
         assertEquals(JVM_DATA.getAbstractName().getObjectName().getCanonicalName(), kernel.getAttribute(JVM_DATA.getAbstractName(), "objectName"));
-        assertEquals(System.getProperty("java.version"), kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "javaVersion"));
-        assertEquals(System.getProperty("java.vendor"), kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "javaVendor"));
-        assertEquals(node, kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "node"));
+        assertEquals(System.getProperty("java.version"), kernel.getAttribute(JVM_DATA.getAbstractName(), "javaVersion"));
+        assertEquals(System.getProperty("java.vendor"), kernel.getAttribute(JVM_DATA.getAbstractName(), "javaVendor"));
+        assertEquals(node, kernel.getAttribute(JVM_DATA.getAbstractName(), "node"));
     }
 
     public void testGeronimoInterface() {
@@ -50,12 +50,12 @@
     }
 
     public void testGeronimoAttributes() throws Exception {
-        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "availableProcessors"));
+        assertEquals(new Integer(runtime.availableProcessors()), kernel.getAttribute(JVM_DATA.getAbstractName(), "availableProcessors"));
     }
 
     public void testStatistics() throws Exception {
-        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "statisticsProvider"));
-        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_DATA.getAbstractName().getObjectName(), "stats");
+        assertEquals(Boolean.TRUE, kernel.getAttribute(JVM_DATA.getAbstractName(), "statisticsProvider"));
+        JVMStats stats = (JVMStats) kernel.getAttribute(JVM_DATA.getAbstractName(), "stats");
         assertNotNull(stats.getHeapSize());
         assertTrue(stats.getHeapSize().getCurrent() > 0);
         assertNotNull(stats.getHeapSize().getDescription());

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java Sat Apr 22 19:55:45 2006
@@ -224,6 +224,16 @@
                                 attribute.isManageable(),
                                 attribute.getGetterName(),
                                 attribute.getSetterName()));
+            } else {
+                if (attributeName.equals("kernel")) {
+                    addAttribute("kernel", Kernel.class, false);
+                } else if (attributeName.equals("classLoader")) {
+                    addAttribute("classLoader", ClassLoader.class, false);
+                } else if (attributeName.equals("abstractName")) {
+                    addAttribute("abstractName", AbstractName.class, false);
+                } else if (attributeName.equals("objectName")) {
+                    addAttribute("obectName", String.class, false);
+                }
             }
         }
     }
@@ -249,6 +259,7 @@
         String type = attributeInfo.getType();
         return ("kernel".equals(name) && Kernel.class.getName().equals(type)) ||
                 ("classLoader".equals(name) && ClassLoader.class.getName().equals(type)) ||
+                ("abstractName".equals(name) && AbstractName.class.getName().equals(type)) ||
                 ("objectName".equals(name) && String.class.getName().equals(type));
     }
 
@@ -444,14 +455,14 @@
         boolean[] isReference = new boolean[arguments.size()];
         for (int i = 0; i < argumentTypes.length; i++) {
             String argumentName = (String) arguments.get(i);
-            if (attributes.containsKey(argumentName)) {
+            if (references.containsKey(argumentName)) {
+                argumentTypes[i] = ((RefInfo) references.get(argumentName)).getJavaType();
+                isReference[i] = true;
+            } else if (attributes.containsKey(argumentName)) {
                 GAttributeInfo attribute = (GAttributeInfo) attributes.get(argumentName);
                 argumentTypes[i] = attribute.getType();
                 isReference[i] = false;
-            } else if (references.containsKey(argumentName)) {
-                argumentTypes[i] = ((RefInfo) references.get(argumentName)).getJavaType();
-                isReference[i] = true;
-            }
+            }  
         }
 
         Constructor[] constructors = gbeanType.getConstructors();

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanAttribute.java Sat Apr 22 19:55:45 2006
@@ -366,7 +366,7 @@
     public Object getValue(Object target) throws Exception {
         if (!readable) {
             if (persistent) {
-                throw new IllegalStateException("This persistent attribute is not accessible while started. " + getDescription());
+                return persistentValue;
             } else {
                 throw new IllegalStateException("This attribute is not readable. " + getDescription());
             }
@@ -389,7 +389,7 @@
     public void setValue(Object target, Object value) throws Exception {
         if (!writable) {
             if (persistent) {
-                throw new IllegalStateException("This persistent attribute is not modifable while running. " + getDescription());
+                throw new IllegalStateException("This persistent attribute is not modifable while the gbean is running. " + getDescription());
             } else {
                 throw new IllegalStateException("This attribute is not writable. " + getDescription());
             }

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Sat Apr 22 19:55:45 2006
@@ -310,15 +310,15 @@
         Class[] parameterTypes = new Class[arguments.size()];
         for (int i = 0; i < parameterTypes.length; i++) {
             String argumentName = (String) arguments.get(i);
-            if (attributeIndex.containsKey(argumentName)) {
-                Integer index = (Integer) attributeIndex.get(argumentName);
-                GBeanAttribute attribute = attributes[index.intValue()];
-                parameterTypes[i] = attribute.getType();
-            } else if (referenceIndex.containsKey(argumentName)) {
+            if (referenceIndex.containsKey(argumentName)) {
                 Integer index = (Integer) referenceIndex.get(argumentName);
                 GBeanReference reference = references[index.intValue()];
                 parameterTypes[i] = reference.getProxyType();
-            }
+            } else if (attributeIndex.containsKey(argumentName)) {
+                Integer index = (Integer) attributeIndex.get(argumentName);
+                GBeanAttribute attribute = attributes[index.intValue()];
+                parameterTypes[i] = attribute.getType();
+            } 
         }
         try {
             constructor = type.getConstructor(parameterTypes);
@@ -1183,6 +1183,13 @@
         //
         //  Special attributes
         //
+        attributesMap.put("abstractName",
+                GBeanAttribute.createSpecialAttribute((GBeanAttribute) attributesMap.get("abstractName"),
+                        this,
+                        "abstractName",
+                        AbstractName.class,
+                        getAbstractName()));
+
         attributesMap.put("objectName",
                 GBeanAttribute.createSpecialAttribute((GBeanAttribute) attributesMap.get("objectName"),
                         this,

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java Sat Apr 22 19:55:45 2006
@@ -82,7 +82,6 @@
             objectNameMap.clear();
             objectNameMap.put(J2EE_TYPE, "J2EEDomain");
             objectNameMap.put(J2EE_NAME, DEFAULT_DOMAIN_NAME);
-            objectNameMap.put("J2EEServer", DEFAULT_SERVER_NAME);
         } else if ("J2EEServer".equals(type)) {
             //special case J2EEServer gbean
             objectNameMap.clear();

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java Sat Apr 22 19:55:45 2006
@@ -354,10 +354,6 @@
     /**
      * @deprecated Use AbstractName version instead
      */
-    ClassLoader getClassLoaderFor(ObjectName name) throws GBeanNotFoundException;
-    /**
-     * @deprecated Use AbstractName version instead
-     */
     GBeanInfo getGBeanInfo(ObjectName name) throws GBeanNotFoundException;
     /**
      * @deprecated Use AbstractName version instead
@@ -373,10 +369,6 @@
      * @deprecated Use AbstractName version instead
      */
     Object getAttribute(ObjectName name, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception;
-    /**
-     * @deprecated Use AbstractName version instead
-     */
-    void setAttribute(ObjectName name, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception;
     /**
      * @deprecated Use AbstractName version instead
      */

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java Sat Apr 22 19:55:45 2006
@@ -214,10 +214,6 @@
         return kernel.getGBeanStartTime(shortName, type);
     }
 
-    public ClassLoader getClassLoaderFor(ObjectName name) throws GBeanNotFoundException {
-        return kernel.getClassLoaderFor(name);
-    }
-
     public ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException {
         return kernel.getClassLoaderFor(name);
     }
@@ -300,10 +296,6 @@
 
     public Object getAttribute(String shortName, Class type, String attributeName) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
         return kernel.getAttribute(shortName, type, attributeName);
-    }
-
-    public void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
-        kernel.setAttribute(objectName, attributeName, attributeValue);
     }
 
     public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java Sat Apr 22 19:55:45 2006
@@ -191,11 +191,6 @@
         return gbeanInstance.getAttribute(attributeName);
     }
 
-    public void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
-        GBeanInstance gbeanInstance = registry.getGBeanInstance(objectName);
-        gbeanInstance.setAttribute(attributeName, attributeValue);
-    }
-
     public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
         GBeanInstance gbeanInstance = registry.getGBeanInstance(abstractName);
         gbeanInstance.setAttribute(attributeName, attributeValue);
@@ -684,11 +679,6 @@
 
     public boolean isRunning() {
         return running;
-    }
-
-    public ClassLoader getClassLoaderFor(ObjectName name) throws GBeanNotFoundException {
-        GBeanInstance gbeanInstance = registry.getGBeanInstance(name);
-        return gbeanInstance.getClassLoader();
     }
 
     public ClassLoader getClassLoaderFor(AbstractName name) throws GBeanNotFoundException {

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/J2EEServer.java Sat Apr 22 19:55:45 2006
@@ -18,6 +18,8 @@
 
 import org.apache.geronimo.management.J2EEDeployedObject;
 import org.apache.geronimo.management.J2EEResource;
+import org.apache.geronimo.management.AppClientModule;
+import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
@@ -86,8 +88,6 @@
     /**
      * Gets the SecurityRealms associated with this J2EEServer.
      *
-     * @see org.apache.geronimo.security.realm.SecurityRealm
-     *
      * @return The ObjectNames of the realms, in String form.
      */
     public SecurityRealm[] getSecurityRealms();
@@ -101,8 +101,6 @@
      * Gets the ObjectName of the LoginService associated with this
      * J2EEServer.
      *
-     * @see org.apache.geronimo.security.jaas.server.JaasLoginServiceMBean
-     *
      * @return The ObjectName of the LoginService, in String form.
      */
     public LoginService getLoginService();
@@ -111,8 +109,6 @@
      * Gets the ObjectName of the KeystoreManager associated with this
      * J2EEServer.
      *
-     * @see org.apache.geronimo.security.keystore.FileKeystoreManager
-     *
      * @return The ObjectName of the KeystoreManager, in String form.
      */
     public KeystoreManager getKeystoreManager();
@@ -126,4 +122,14 @@
      * Gets the ConfigurationManager associated with this J2EEServer.
      */
     public ConfigurationManager getConfigurationManager();
+
+    J2EEApplication[] getApplications();
+
+    AppClientModule[] getAppClients();
+
+    WebModule[] getWebModules();
+
+    EJBModule[] getEJBModules();
+
+    ResourceAdapterModule[] getResourceAdapterModules();
 }

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAAdminObject.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAAdminObject.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAAdminObject.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAAdminObject.java Sat Apr 22 19:55:45 2006
@@ -18,13 +18,14 @@
 
 import java.util.Map;
 
+import org.apache.geronimo.management.J2EEManagedObject;
+
 /**
  * Management interface for admin objects
- * todo: make it implement J2EEManagedObject
  *
  * @version $Rev: 368994 $ $Date: 2006-01-14 02:07:18 -0500 (Sat, 14 Jan 2006) $
  */
-public interface JCAAdminObject {
+public interface JCAAdminObject extends J2EEManagedObject {
     public String getAdminObjectClass();
     public String getAdminObjectInterface();
 

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResource.java Sat Apr 22 19:55:45 2006
@@ -33,4 +33,18 @@
 
     JCAResourceAdapter[] getResourceAdapterInstances();
     JCAConnectionFactory[] getConnectionFactoryInstances();
+
+    JCAManagedConnectionFactory[] getOutboundFactories();
+
+    JCAManagedConnectionFactory[] getOutboundFactories(String connectionFactoryInterface);
+
+    JCAManagedConnectionFactory[] getOutboundFactories(String[] connectionFactoryInterfaces);
+
+    String[] getAdminObjects();
+
+    JCAAdminObject[] getAdminObjectInstances();
+
+    JCAAdminObject[] getAdminObjectInstances(String adminObjectInterface);
+
+    JCAAdminObject[] getAdminObjectInstances(String[] adminObjectInterfaces);
 }

Modified: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java (original)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JVM.java Sat Apr 22 19:55:45 2006
@@ -20,6 +20,8 @@
 import java.util.Date;
 import java.util.Properties;
 
+import org.apache.geronimo.system.logging.SystemLog;
+
 /**
  * Geronimo extensions to the standard JSR-77 JVM type.
  *
@@ -38,7 +40,8 @@
     Properties getSystemProperties();
 
     /**
-     * Gets the ObjectName of the system log for this JVM
+     * Gets the system log instance
      */
-    String getSystemLog();
+    SystemLog getSystemLog();
+
 }

Modified: geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java (original)
+++ geronimo/branches/1.1/modules/security/src/java/org/apache/geronimo/security/keystore/FileKeystoreInstance.java Sat Apr 22 19:55:45 2006
@@ -47,8 +47,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Vector;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.TrustManager;
@@ -58,6 +56,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+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.KeystoreInstance;
@@ -83,7 +82,7 @@
     private char[] keystorePassword; // Used to "unlock" the keystore for other services
     private Map keyPasswords = new HashMap();
     private Kernel kernel;
-    private ObjectName objectName;
+    private AbstractName abstractName;
     private char[] openPassword; // The password last used to open the keystore for editing
     // The following variables are the state of the keystore, which should be chucked if the file on disk changes
     private List privateKeys = new ArrayList();
@@ -91,12 +90,12 @@
     private KeyStore keystore;
     private long keystoreReadDate = Long.MIN_VALUE;
 
-    public FileKeystoreInstance(ServerInfo serverInfo, URI keystorePath, String keystoreName, String keystorePassword, String keyPasswords, Kernel kernel, String objectName) throws MalformedObjectNameException {
+    public FileKeystoreInstance(ServerInfo serverInfo, URI keystorePath, String keystoreName, String keystorePassword, String keyPasswords, Kernel kernel, AbstractName abstractName) {
         this.serverInfo = serverInfo;
         this.keystorePath = keystorePath;
         this.keystoreName = keystoreName;
         this.kernel = kernel;
-        this.objectName = ObjectName.getInstance(objectName);
+        this.abstractName = abstractName;
         this.keystorePassword = keystorePassword == null ? null : keystorePassword.toCharArray();
         if(keyPasswords != null) {
             String[] keys = keyPasswords.split("\\]\\!\\[");
@@ -193,7 +192,7 @@
             buf.append(entry.getKey()).append("=").append(entry.getValue());
         }
         try {
-            kernel.setAttribute(objectName, "keyPasswords", buf.toString());
+            kernel.setAttribute(abstractName, "keyPasswords", buf.toString());
         } catch (Exception e) {
             log.error("Unable to save key passwords in keystore '"+keystoreName+"'", e);
         }
@@ -320,10 +319,10 @@
         infoFactory.addAttribute("keystorePassword", String.class, true, true);
         infoFactory.addAttribute("keyPasswords", String.class, true, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addAttribute("objectName", String.class, false);
+        infoFactory.addAttribute("abstractName", AbstractName.class, false);
         infoFactory.addReference("ServerInfo", ServerInfo.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addInterface(KeystoreInstance.class);
-        infoFactory.setConstructor(new String[]{"ServerInfo","keystorePath", "keystoreName", "keystorePassword", "keyPasswords", "kernel", "objectName"});
+        infoFactory.setConstructor(new String[]{"ServerInfo","keystorePath", "keystoreName", "keystorePassword", "keyPasswords", "kernel", "abstractName"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.java?rev=396206&r1=396205&r2=396206&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/KernelDelegate.java Sat Apr 22 19:55:45 2006
@@ -545,10 +545,6 @@
         return invokeKernel("getAttribute", new Object[]{shortName, type, attributeName}, new String[]{String.class.getName(), Class.class.getName(), String.class.getName()});
     }
 
-    public void setAttribute(ObjectName objectName, String attributeName, Object attributeValue) throws Exception {
-        invokeKernel("setAttribute", new Object[]{objectName, attributeName, attributeValue}, new String[]{ObjectName.class.getName(), String.class.getName(), Object.class.getName()});
-    }
-
     public void setAttribute(AbstractName abstractName, String attributeName, Object attributeValue) throws GBeanNotFoundException, NoSuchAttributeException, Exception {
         invokeKernel("setAttribute", new Object[]{abstractName, attributeName, attributeValue}, new String[]{AbstractName.class.getName(), String.class.getName(), Object.class.getName()});
     }
@@ -748,18 +744,6 @@
     public void shutdown() {
         try {
             invokeKernel("shutdown", new Object[] {}, new String[] {});
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new InternalKernelException(e);
-        }
-    }
-
-    public ClassLoader getClassLoaderFor(ObjectName name) throws GBeanNotFoundException {
-        try {
-            return (ClassLoader) invokeKernel("getClassLoaderFor", new Object[] {name}, new String[] {ObjectName.class.getName()});
-        } catch (GBeanNotFoundException e) {
-            throw e;
         } catch (RuntimeException e) {
             throw e;
         } catch (Exception e) {



Mime
View raw message