geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r385886 - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/connector-builder/src/test/org/apache/geronimo/co...
Date Tue, 14 Mar 2006 20:58:29 GMT
Author: djencks
Date: Tue Mar 14 12:58:25 2006
New Revision: 385886

URL: http://svn.apache.org/viewcvs?rev=385886&view=rev
Log:
Work on using references in jsr-77 objects instead of looking up names in the kernel.

Added:
    geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResourceAdapter.java
Removed:
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/JCAConnectionFactoryImpl.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ResourceAdapterModuleImpl.java
Modified:
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.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/ResourceAdapterImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImplGBean.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/ResourceAdapterModuleImplGBean.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImplGBean.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/Util.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -103,16 +103,15 @@
     }
 
     public J2EEDomain[] getDomains() {
-        String[] names = Util.getObjectNames(kernel, "*:", new String[]{"J2EEDomain"});
-        J2EEDomain[] domains = new J2EEDomain[names.length];
-        for (int i = 0; i < domains.length; i++) {
-            try {
-                domains[i] = (J2EEDomain)kernel.getProxyManager().createProxy(ObjectName.getInstance(names[i]), J2EEDomain.class);
-            } catch (MalformedObjectNameException e) {
-                log.error("Unable to look up related GBean", e);
-            }
+        //currently returns ObjectNames
+        Set domainNames = kernel.listGBeans(new GBeanQuery(null, J2EEDomain.class.getName()));
+        J2EEDomain[] result = new J2EEDomain[domainNames.size()];
+        int i = 0;
+        for (Iterator iterator = domainNames.iterator(); iterator.hasNext();) {
+            ObjectName domainName = (ObjectName) iterator.next();
+            result[i++] = (J2EEDomain) pm.createProxy(domainName, J2EEDomain.class)
         }
-        return domains;
+        return result;
     }
 
     public J2EEServer[] getServers(J2EEDomain domain) {

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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -109,11 +109,12 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.Collections;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
 
 /**
- * @version $Rev: 385372 $ $Date$
+ * @version $Rev:385659 $ $Date$
  */
 public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
 
@@ -279,7 +280,6 @@
 
         //set up the metadata for the ResourceAdapterModule
         GBeanData resourceAdapterModuleData = new GBeanData(resourceAdapterModuleName, ResourceAdapterModuleImplGBean.GBEAN_INFO);
-
         // initalize the GBean
         resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_SERVER, earContext.getServerName());
         if (!earContext.getModuleName().equals(resourceAdapterModuleName)) {
@@ -385,6 +385,16 @@
             AbstractName applicationName = earContext.getModuleName();
             resourceAdapterModuleName = Naming.createChildName(applicationName, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
         }
+        /*
+        The chain of idiotic jsr-77 meaningless objects is:
+        ResourceAdapterModule (1)  >
+        ResourceAdapter (n, but there can only be 1 resource adapter in a rar, so we use 1) >
+        JCAResource (1) >
+        JCAConnectionFactory (n) >
+        JCAManagedConnectionFactory (1)
+        We also include:
+        JCAResourceAdapter (n)  (from JCAResource) (actual instance of ResourceAdapter)
+        */
         AbstractName resourceAdapterjsr77Name = Naming.createChildName(resourceAdapterModuleName, NameFactory.RESOURCE_ADAPTER, module.getName());
 
         XmlObject specDD = module.getSpecDD();
@@ -398,7 +408,7 @@
         if (resourceAdapterModuleData == null) {
             throw new DeploymentException("Internal consistency bug: gbean data for module is missing: " + resourceAdapterModuleName);
         }
-        resourceAdapterModuleData.setAttribute("resourceAdapter", resourceAdapterjsr77Name.getObjectName().getCanonicalName());
+        resourceAdapterModuleData.setReferencePattern("ResourceAdapter", resourceAdapterjsr77Name);
 
         // add it
         try {
@@ -410,7 +420,7 @@
         //construct the bogus resource adapter and jca resource placeholders
         GBeanData resourceAdapterData = new GBeanData(resourceAdapterjsr77Name, ResourceAdapterImplGBean.GBEAN_INFO);
         AbstractName jcaResourcejsr77Name = Naming.createChildName(resourceAdapterjsr77Name, NameFactory.JCA_RESOURCE, module.getName());
-        resourceAdapterData.setAttribute("JCAResource", jcaResourcejsr77Name.getObjectName().getCanonicalName());
+        resourceAdapterData.setReferencePattern("JCAResource", jcaResourcejsr77Name);
         try {
             earContext.addGBean(resourceAdapterData);
         } catch (GBeanAlreadyExistsException e) {
@@ -418,6 +428,8 @@
         }
 
         GBeanData jcaResourceData = new GBeanData(jcaResourcejsr77Name, JCAResourceImplGBean.GBEAN_INFO);
+        jcaResourceData.setReferencePattern("ConnectionFactories", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), Collections.EMPTY_MAP));
+        jcaResourceData.setReferencePattern("ResourceAdapters", new AbstractNameQuery(resourceAdapterModuleName.getArtifact(), Collections.EMPTY_MAP));
         try {
             earContext.addGBean(jcaResourceData);
         } catch (GBeanAlreadyExistsException e) {
@@ -802,8 +814,7 @@
         // ConnectionFactory
         AbstractName connectionFactoryAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim());
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName, JCAConnectionFactoryImplGBean.GBEAN_INFO);
-        connectionFactoryGBeanData.setReferencePattern("J2EEServer", earContext.getServerName());
-        connectionFactoryGBeanData.setAttribute("managedConnectionFactory", managedConnectionFactoryAbstractName.getObjectName().getCanonicalName());
+        connectionFactoryGBeanData.setReferencePattern("JCAManagedConnectionFactory", managedConnectionFactoryAbstractName);
 
         try {
             earContext.addGBean(connectionFactoryGBeanData);

Modified: geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Tue Mar 14 12:58:25 2006
@@ -120,7 +120,7 @@
             return null;
         }
 
-        public Reference createCORBAReference(URI corbaURL, String objectName, AbstractName containerName, String home) {
+        public Reference createCORBAReference(Artifact configId, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) throws DeploymentException {
             return null;
         }
 

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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -16,50 +16,55 @@
  */
 package org.apache.geronimo.connector;
 
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.j2ee.management.impl.Util;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.management.geronimo.JCAResource;
+import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
+import org.apache.geronimo.connector.outbound.JCAConnectionFactoryImpl;
+
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JCAResourceImpl implements JCAResource  {
-    private final Kernel kernel;
     private final String objectName;
-    private final J2eeContext moduleContext;
 
-    private static final String[] CONNECTION_FACTORY_TYPES = {NameFactory.JCA_CONNECTION_FACTORY};
-    private static final String[] RESOURCE_ADAPTER_INSTANCE_TYPES = {NameFactory.JCA_RESOURCE_ADAPTER};
+    private final Collection connectionFactories;
+    private final Collection resourceAdapters;
 
-    public JCAResourceImpl(String objectName, Kernel kernel) {
+    public JCAResourceImpl(String objectName, Collection connectionFactories, Collection resourceAdapters) {
         this.objectName = objectName;
-        this.kernel = kernel;
-
-        ObjectName myObjectName = JMXUtil.getObjectName(objectName);
-        moduleContext = J2eeContextImpl.newModuleContext(myObjectName, NameFactory.JCA_RESOURCE);
+        this.connectionFactories = connectionFactories;
+        this.resourceAdapters = resourceAdapters;
     }
 
     public String[] getConnectionFactories() {
-        try {
-            return Util.getObjectNames(kernel, moduleContext, CONNECTION_FACTORY_TYPES);
-        } catch (MalformedObjectNameException e) {
-            throw new AssertionError();
+        Collection copy;
+        synchronized(connectionFactories) {
+            copy = new ArrayList(connectionFactories);
         }
+        String[] result = new String[copy.size()];
+        int i = 0;
+        for (Iterator iterator = copy.iterator(); iterator.hasNext();) {
+            JCAConnectionFactoryImpl jcaConnectionFactory = (JCAConnectionFactoryImpl) iterator.next();
+            result[i++] = jcaConnectionFactory.getObjectName();
+        }
+        return result;
     }
 
     public String[] getResourceAdapterInstances() {
-        try {
-            return Util.getObjectNames(kernel, moduleContext, RESOURCE_ADAPTER_INSTANCE_TYPES);
-        } catch (MalformedObjectNameException e) {
-            throw new AssertionError();
+        Collection copy;
+        synchronized(resourceAdapters) {
+            copy = new ArrayList(resourceAdapters);
+        }
+        String[] result = new String[copy.size()];
+        int i = 0;
+        for (Iterator iterator = copy.iterator(); iterator.hasNext();) {
+            JCAResourceAdapter resourceAdapter = (JCAResourceAdapter) iterator.next();
+            result[i++] = resourceAdapter.getObjectName();
         }
+        return result;
     }
 
     public String getObjectName() {

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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -17,10 +17,11 @@
 
 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.kernel.Kernel;
+import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
 import org.apache.geronimo.management.geronimo.JCAResource;
 
 public class JCAResourceImplGBean {
@@ -30,12 +31,14 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JCAResourceImplGBean.class, JCAResourceImpl.class, NameFactory.JCA_RESOURCE);
         infoBuilder.addAttribute("objectName", String.class, false);
-        infoBuilder.addAttribute("kernel", Kernel.class, false);
+        infoBuilder.addReference("ConnectionFactories", JCAConnectionFactoryImpl.class, NameFactory.JCA_CONNECTION_FACTORY);
+        infoBuilder.addReference("ResourceAdapters", JCAResourceAdapter.class, NameFactory.JCA_RESOURCE_ADAPTER);
         infoBuilder.addInterface(JCAResource.class);
 
         infoBuilder.setConstructor(new String[]{
             "objectName",
-            "kernel"
+            "ConnectionFactories",
+            "ResourceAdapters"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImpl.java Tue Mar 14 12:58:25 2006
@@ -23,15 +23,15 @@
  */
 public class ResourceAdapterImpl implements ResourceAdapter {
     private final String objectName;
-    private final String jcaResource;
+    private final JCAResourceImpl jcaResource;
 
-    public ResourceAdapterImpl(String objectName, String jcaResource) {
+    public ResourceAdapterImpl(String objectName, JCAResourceImpl jcaResource) {
         this.objectName = objectName;
         this.jcaResource = jcaResource;
     }
 
     public String[] getJCAResources() {
-        return new String[] {jcaResource};
+        return new String[] {jcaResource.getObjectName()};
     }
 
     public String getObjectName() {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImplGBean.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImplGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterImplGBean.java Tue Mar 14 12:58:25 2006
@@ -29,12 +29,13 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceAdapterImplGBean.class, ResourceAdapterImpl.class, NameFactory.RESOURCE_ADAPTER);
         infoBuilder.addAttribute("objectName", String.class, false);
-        infoBuilder.addAttribute("JCAResource", String.class, true);
+        infoBuilder.addReference("JCAResourceImpl", JCAResourceImpl.class, NameFactory.JCA_RESOURCE);
+        infoBuilder.addAttribute("JCAResource", String.class, false);
         infoBuilder.addInterface(ResourceAdapter.class);
 
         infoBuilder.setConstructor(new String[]{
             "objectName",
-            "JCAResource"
+            "JCAResourceImpl"
         });
 
         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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -35,7 +35,7 @@
     private final J2EEServer server;
     private final J2EEApplication application;
     private final String deploymentDescriptor;
-    private final String[] resourceAdapters;
+    private final ResourceAdapterImpl resourceAdapter;
 
     private final GBeanData resourceAdapterGBeanData;
     private final Map activationSpecInfoMap;
@@ -48,10 +48,10 @@
     private final String resourceAdapterVersion;
     private final String eisType;
 
-    public ResourceAdapterModuleImpl(String resourceAdapter,
-                                     String objectName, 
-                                     J2EEServer server, 
-                                     J2EEApplication application, 
+    public ResourceAdapterModuleImpl(String objectName,
+                                     ResourceAdapterImpl resourceAdapter,
+                                     J2EEServer server,
+                                     J2EEApplication application,
                                      String deploymentDescriptor,
                                      GBeanData resourceAdapterGBeanData,
                                      Map activationSpecInfoMap,
@@ -66,7 +66,7 @@
         ObjectName myObjectName = JMXUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
 
-        this.resourceAdapters = new String[] {resourceAdapter};
+        this.resourceAdapter = resourceAdapter;
 
         this.server = server;
         this.application = application;
@@ -119,7 +119,7 @@
     }
 
     public String[] getResourceAdapters() {
-        return resourceAdapters;
+        return new String[]{resourceAdapter.getObjectName()};
     }
 
     public GBeanData getResourceAdapterGBeanData() {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImplGBean.java Tue Mar 14 12:58:25 2006
@@ -28,7 +28,6 @@
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
- * 
  * @version $Revision$
  */
 public class ResourceAdapterModuleImplGBean {
@@ -42,7 +41,7 @@
 
         infoBuilder.addAttribute("deploymentDescriptor", String.class, true);
 
-        infoBuilder.addAttribute("resourceAdapter", String.class, true);
+        infoBuilder.addReference("ResourceAdapter", ResourceAdapterImpl.class, NameFactory.RESOURCE_ADAPTER);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("server", String.class, false);
         infoBuilder.addAttribute("application", String.class, false);
@@ -64,20 +63,20 @@
         infoBuilder.addInterface(ResourceAdapterModule.class);
 
         infoBuilder.setConstructor(new String[]{
-            "resourceAdapter",
-            "objectName",
-            "J2EEServer",
-            "J2EEApplication",
-            "deploymentDescriptor",
-            "resourceAdapterGBeanData",
-            "activationSpecInfoMap",
-            "adminObjectInfoMap",
-            "managedConnectionFactoryInfoMap",
-            "displayName",
-            "description",
-            "vendorName",
-            "resourceAdapterVersion",
-            "EISType"
+                "objectName",
+                "ResourceAdapter",
+                "J2EEServer",
+                "J2EEApplication",
+                "deploymentDescriptor",
+                "resourceAdapterGBeanData",
+                "activationSpecInfoMap",
+                "adminObjectInfoMap",
+                "managedConnectionFactoryInfoMap",
+                "displayName",
+                "description",
+                "vendorName",
+                "resourceAdapterVersion",
+                "EISType"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java Tue Mar 14 12:58:25 2006
@@ -17,9 +17,6 @@
 
 package org.apache.geronimo.connector;
 
-import javax.resource.spi.ResourceAdapter;
-import javax.resource.spi.ResourceAdapterAssociation;
-
 import org.apache.geronimo.connector.work.GeronimoWorkManager;
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
@@ -27,23 +24,30 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.management.geronimo.JCAResourceAdapter;
+
+import javax.resource.spi.ResourceAdapter;
+import javax.resource.spi.ResourceAdapterAssociation;
 
 /**
  * 
  * @version $Revision$
  */
-public class ResourceAdapterWrapperGBean extends ResourceAdapterWrapper implements GBeanLifecycle, DynamicGBean {
+public class ResourceAdapterWrapperGBean extends ResourceAdapterWrapper implements GBeanLifecycle, DynamicGBean, JCAResourceAdapter {
 
     private final DynamicGBeanDelegate delegate;
+    private final String objectName;
 
     public ResourceAdapterWrapperGBean() {
         delegate=null;
+        objectName = null;
     }
 
-    public ResourceAdapterWrapperGBean(final String resourceAdapterClass, final GeronimoWorkManager workManager, ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+    public ResourceAdapterWrapperGBean(final String resourceAdapterClass, final GeronimoWorkManager workManager, ClassLoader cl, String objectName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
         super(resourceAdapterClass, workManager, cl);
         delegate = new DynamicGBeanDelegate();
         delegate.addAll(resourceAdapter);
+        this.objectName = objectName;
     }
 
     public Object getAttribute(String name) throws Exception {
@@ -59,20 +63,38 @@
         return null;
     }
 
+    public String getObjectName() {
+        return objectName;
+    }
+
+    public boolean isStateManageable() {
+        return false;
+    }
+
+    public boolean isStatisticsProvider() {
+        return false;
+    }
+
+    public boolean isEventProvider() {
+        return false;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceAdapterWrapperGBean.class, NameFactory.RESOURCE_ADAPTER);
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceAdapterWrapperGBean.class, NameFactory.JCA_RESOURCE_ADAPTER);
         infoBuilder.addAttribute("resourceAdapterClass", String.class, true);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+        infoBuilder.addAttribute("objectName", String.class, false);
 
         infoBuilder.addReference("WorkManager", GeronimoWorkManager.class, NameFactory.JCA_WORK_MANAGER);
 
         infoBuilder.addOperation("registerResourceAdapterAssociation", new Class[]{ResourceAdapterAssociation.class});
 
         infoBuilder.addInterface(ResourceAdapter.class);
+        infoBuilder.addInterface(JCAResourceAdapter.class);
 
-        infoBuilder.setConstructor(new String[]{"resourceAdapterClass", "WorkManager", "classLoader"});
+        infoBuilder.setConstructor(new String[]{"resourceAdapterClass", "WorkManager", "classLoader", "objectName"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImpl.java Tue Mar 14 12:58:25 2006
@@ -16,23 +16,22 @@
  */
 package org.apache.geronimo.connector.outbound;
 
-import java.util.Hashtable;
-
-import javax.management.ObjectName;
-
-import org.apache.geronimo.management.J2EEServer;
-import org.apache.geronimo.management.JCAConnectionFactory;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.management.JCAConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
+
+import javax.management.ObjectName;
+import java.util.Hashtable;
 
 /**
  * @version $Rev$ $Date$
  */
 public class JCAConnectionFactoryImpl implements JCAConnectionFactory  {
     private final String objectName;
-    private final String managedConnectionFactory;
+    private final JCAManagedConnectionFactory managedConnectionFactory;
 
-    public JCAConnectionFactoryImpl(String objectName, J2EEServer server, String managedConnectionFactory) {
+    public JCAConnectionFactoryImpl(String objectName, JCAManagedConnectionFactory managedConnectionFactory) {
         // todo do we really need to do this at runtime - shouldn't the builder set this up correctly?
         ObjectName myObjectName = JMXUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
@@ -42,7 +41,7 @@
     }
 
     public String getManagedConnectionFactory() {
-        return managedConnectionFactory;
+        return managedConnectionFactory.getObjectName();
     }
 
     public String getObjectName() {

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImplGBean.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImplGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/outbound/JCAConnectionFactoryImplGBean.java Tue Mar 14 12:58:25 2006
@@ -21,6 +21,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.J2EEServer;
 import org.apache.geronimo.management.JCAConnectionFactory;
+import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
 
 /**
  * 
@@ -32,13 +33,12 @@
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(JCAConnectionFactoryImplGBean.class, JCAConnectionFactoryImpl.class, NameFactory.JCA_CONNECTION_FACTORY);
-        infoFactory.addReference("J2EEServer", J2EEServer.class);
 
         infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("managedConnectionFactory", String.class, true);
+        infoFactory.addReference("JCAManagedConnectionFactory", JCAManagedConnectionFactory.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoFactory.addInterface(JCAConnectionFactory.class);
 
-        infoFactory.setConstructor(new String[]{"objectName", "J2EEServer", "managedConnectionFactory"});
+        infoFactory.setConstructor(new String[]{"objectName", "managedConnectionFactory"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java Tue Mar 14 12:58:25 2006
@@ -124,18 +124,6 @@
         return serviceReferenceBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, deploymentContext, module, classLoader);
     }
 
-    public String getResourceAdapterContainerId(URI moduleURI, String resourceLink, NamingContext context) throws UnresolvedReferenceException {
-        AbstractName moduleName = context.getModuleName();
-        AbstractName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_RESOURCE_ADAPTER, moduleName, context, "resource adapter");
-        return containerName.toString();
-    }
-
-    public String getConnectionFactoryContainerId(URI moduleURI, String resourceLink, String type, NamingContext context) throws UnresolvedReferenceException {
-        AbstractName moduleName = context.getModuleName();
-        AbstractName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, type, moduleName, context, "connection factory");
-        return containerName.toString();
-    }
-
     public Object getMessageDestination(String messageDestinationLink) throws DeploymentException {
         Object destination = null;
         int pos = messageDestinationLink.indexOf('#');
@@ -168,11 +156,6 @@
         return destination;
     }
 
-    public String getAdminObjectContainerId(URI moduleURI, String resourceLink, NamingContext context) throws DeploymentException {
-        AbstractName moduleName = context.getModuleName();
-        AbstractName containerName = locateComponentName(resourceLink, moduleURI, NameFactory.JCA_RESOURCE, NameFactory.JCA_ADMIN_OBJECT, moduleName, context, "admin object");
-        return containerName.toString();
-    }
 
     public Reference getImplicitEJBRemoteRef(URI module, String refName, boolean isSession, String home, String remote, NamingContext namingContext) throws DeploymentException {
         return ejbReferenceBuilder.getImplicitEJBRemoteRef(module, refName, isSession, home, remote, namingContext);
@@ -210,20 +193,6 @@
         AbstractNameQuery query = new AbstractNameQuery(null, Collections.singletonMap("name", "ejb/mgmt/MEJB"), (String)null);
         AbstractName mejbName = locateUniqueNameInKernel(query, "Management EJB");
         return mejbName.toString();
-    }
-
-    public AbstractName locateComponentName(String resourceLink, URI moduleURI, String moduleType, String type, AbstractName j2eeContext, NamingContext context, String queryType) throws UnresolvedReferenceException {
-        GBeanData match = locateComponent(resourceLink, moduleURI, moduleType, type, j2eeContext, context, queryType);
-        return match.getAbstractName();
-    }
-
-    private GBeanData locateComponent(String resourceLink, URI moduleURI, String moduleType, String type, AbstractName j2eeContext, NamingContext context, String queryType) throws UnresolvedReferenceException {
-        GBeanData match = locateComponentInApplication(resourceLink, moduleURI, moduleType, type, j2eeContext, context, true);
-        if (match == null) {
-            //no matches in current context, look in other modules with J2EEApplication=null
-            return locateGBeanInKernel(resourceLink, type, j2eeContext, queryType);
-        }
-        return match;
     }
 
     private GBeanData locateComponentData(AbstractName name, NamingContext context) throws UnresolvedReferenceException {

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java Tue Mar 14 12:58:25 2006
@@ -31,7 +31,7 @@
 import javax.management.ObjectName;
 
 /**
- * @version $Rev: 385487 $ $Date$
+ * @version $Rev:385692 $ $Date$
  */
 public class NameFactory {
 
@@ -58,6 +58,7 @@
     public static final String RESOURCE_ADAPTER = "ResourceAdapter";
     public static final String JAVA_MAIL_RESOURCE = "JavaMailResource";
     public static final String JCA_RESOURCE = "JCAResource";
+//    public static final String JCA_RESOURCE_ADAPTER defined in geronimo extensions
     public static final String JCA_CONNECTION_FACTORY = "JCAConnectionFactory";
     public static final String JCA_MANAGED_CONNECTION_FACTORY = "JCAManagedConnectionFactory";
     public static final String JDBC_RESOURCE = "JDBCResource";
@@ -160,6 +161,16 @@
     }
 
 
+    /**
+     *
+     * @deprecated
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     */
     public static ObjectName getApplicationName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, J2EE_APPLICATION);
@@ -168,6 +179,18 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
+    /**
+     *
+     * @deprecated
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param j2eeModuleType
+     * @param j2eeModuleName
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     */
     public static ObjectName getModuleName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleType, String j2eeModuleName, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         //N.B.! module context will have the module's j2eeType as its module type attribute.
@@ -178,6 +201,20 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
+    /**
+     *
+     * @deprecated
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param j2eeModuleType
+     * @param j2eeModuleName
+     * @param j2eeName
+     * @param j2eeType
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     */
     public static ObjectName getComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleType, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
         props.put(J2EE_TYPE, context.getJ2eeType(j2eeType));
@@ -188,19 +225,45 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
+    /**
+     *
+     * @deprecated
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param j2eeModuleName
+     * @param j2eeName
+     * @param j2eeType
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     */
     public static ObjectName getEjbComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, EJB_MODULE, j2eeModuleName, j2eeName, j2eeType, context);
     }
 
-//    public static String getEjbComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
-//        return getEjbComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
-//    }
-
-
+    /**
+     *
+     * @deprecated
+     * @param name
+     * @param type
+     * @param context
+     * @return AbstractNameQuery
+     */
     public static AbstractNameQuery getComponentNameQuery(String name, String type, AbstractName context) {
         return getComponentNameQuery(null, null, name, type, context);
     }
 
+    /**
+     *
+     * @deprecated
+     * @param moduleName
+     * @param moduleType
+     * @param name
+     * @param type
+     * @param context
+     * @return AbstractNameQuery
+     */
     public static AbstractNameQuery getComponentNameQuery(String moduleName, String moduleType, String name, String type, AbstractName context) {
         Map nameProperties = new HashMap(context.getName());
 
@@ -223,104 +286,38 @@
             nameProperties.put(J2EE_TYPE, type);
         }
 
-        return new AbstractNameQuery(context.getArtifact(), nameProperties, (String)null);
+        return new AbstractNameQuery(context.getArtifact(), nameProperties, (String) null);
     }
 
-    public static ObjectName getComponentNameQuery(String domainName, String serverName, String applicationName, String moduleType, String moduleName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
-        StringBuffer buffer = new StringBuffer();
-        if ("*".equals(domainName)) {
-            buffer.append("*");
-        } else {
-            buffer.append(context.getJ2eeDomainName(domainName));
-        }
-        boolean query = false;
-        String sep = ":";
-        //implicit attributes, if they are missing it means "use value from j2eecontext": if they are * it means skip and make a query
-        if ("*".equals(serverName)) {
-            query = true;
-        } else {
-            buffer.append(sep).append(J2EE_SERVER).append("=").append(context.getJ2eeServerName(serverName));
-            sep = ",";
-        }
-        if ("*".equals(applicationName)) {
-            query = true;
-        } else {
-            buffer.append(sep).append(J2EE_APPLICATION).append("=").append(context.getJ2eeApplicationName(applicationName));
-            sep = ",";
-        }
-        if ("*".equals(moduleName)) {
-            query = true;
-        } else {
-            buffer.append(sep).append(context.getJ2eeModuleType(moduleType)).append("=").append(context.getJ2eeModuleName(moduleName));
-            sep = ",";
-        }
-        if ("*".equals(type)) {
-            query = true;
-        } else {
-            buffer.append(sep).append(J2EE_TYPE).append("=").append(context.getJ2eeType(type));
-            sep = ",";
-        }
-        //explicit attributes, must be included: if * then make a query
-        if ("*".equals(name)) {
-            query = true;
-        } else {
-            buffer.append(sep).append(J2EE_NAME).append("=").append(context.getJ2eeName(name));
-            sep = ",";
-        }
-        //make a query, possibly
-        if (query) {
-            buffer.append(sep).append("*");
-        }
-        try {
-            return ObjectName.getInstance(buffer.toString());
-        } catch (MalformedObjectNameException e) {
-            throw (MalformedObjectNameException) new MalformedObjectNameException("Could not construct object name: " + buffer.toString()).initCause(e);
-        }
-    }
-
-//    public static ObjectName getComponentNameQuery(String domainName, String serverName, String applicationName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
-//        return getComponentNameQuery(domainName, serverName, applicationName, null, "*", name, type, context);
-//    }
-
-    public static ObjectName getComponentInModuleQuery(String domainName, String serverName, String applicationName, String moduleType, String moduleName, String type, J2eeContext context) throws MalformedObjectNameException {
-        return getComponentNameQuery(domainName, serverName, applicationName, moduleType, moduleName, "*", type, context);
-    }
-
-//    /**
-//     * Creates a query for components that are in no application with given name.
-//     *
-//     * @param domainName
-//     * @param serverName
-//     * @param name
-//     * @param type
-//     * @param context
-//     * @return
-//     * @throws MalformedObjectNameException
-//     */
-//    public static ObjectName getComponentRestrictedQueryName(String domainName, String serverName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
-//        return getComponentNameQuery(domainName, serverName, NULL, null, "*", name, type, context);
-//    }
-
+    /**
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param j2eeModuleName
+     * @param j2eeName
+     * @param j2eeType
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     * @deprecated
+     */
     public static ObjectName getWebComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, WEB_MODULE, j2eeModuleName, j2eeName, j2eeType, context);
     }
 
-    //TODO THIS IS KIND OF WEIRD. Is there a better way???
-    public static ObjectName getWebFilterMappingName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String filterName, String servletName, String urlPattern, J2eeContext context) throws MalformedObjectNameException {
-        Properties props = new Properties();
-        props.put(J2EE_TYPE, URL_WEB_FILTER_MAPPING);
-        props.put(J2EE_SERVER, context.getJ2eeServerName(j2eeServerName));
-        props.put(J2EE_APPLICATION, context.getJ2eeApplicationName(j2eeApplicationName));
-        props.put(WEB_MODULE, context.getJ2eeModuleName(j2eeModuleName));
-        props.put(WEB_FILTER, filterName);
-        if (servletName != null) {
-            props.put(SERVLET, servletName);
-        } else {
-            props.put(URL_PATTERN, ObjectName.quote(urlPattern));
-        }
-        return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
-    }
 
+    /**
+     * @param j2eeDomainName
+     * @param j2eeServerName
+     * @param j2eeApplicationName
+     * @param j2eeModuleName
+     * @param j2eeName
+     * @param j2eeType
+     * @param context
+     * @return
+     * @throws MalformedObjectNameException
+     * @deprecated
+     */
     //for non-j2ee-deployable resources such as the transaction manager
     public static ObjectName getComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         Properties props = new Properties();
@@ -335,14 +332,4 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-//    public static ObjectName getChildName(ObjectName parentObjectName, String type, String name) throws MalformedObjectNameException {
-//        String domain = parentObjectName.getDomain();
-//        Hashtable parentKeys = parentObjectName.getKeyPropertyList();
-//        String parentType = (String) parentKeys.remove(J2EE_TYPE);
-//        String parentName = (String) parentKeys.remove(J2EE_NAME);
-//        parentKeys.put(parentType, parentName);
-//        parentKeys.put(J2EE_TYPE, type);
-//        parentKeys.put(J2EE_NAME, name);
-//        return ObjectName.getInstance(domain, parentKeys);
-//    }
 }

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=385886&r1=385885&r2=385886&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 Tue Mar 14 12:58:25 2006
@@ -17,45 +17,18 @@
 
 package org.apache.geronimo.j2ee.management.impl;
 
+import org.apache.geronimo.kernel.Kernel;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Set;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.DependencyManager;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
 
 /**
  * @version $Rev$ $Date$
  */
 public class Util {
-    private final static Log log = LogFactory.getLog(Util.class);
-
-    public static String[] getObjectNames(Kernel kernel, J2eeContext context, String[] j2eeTypes) throws MalformedObjectNameException {
-        List objectNames = new LinkedList();
-        for (int i = 0; i < j2eeTypes.length; i++) {
-            String j2eeType = j2eeTypes[i];
-            ObjectName query = NameFactory.getComponentInModuleQuery(null, null, null, null, null, j2eeType,  context);
-            objectNames.addAll(kernel.listGBeans(query));
-        }
-        String[] names = new String[objectNames.size()];
-        Iterator iterator = objectNames.iterator();
-        for (int i = 0; iterator.hasNext(); i++) {
-            names[i] = iterator.next().toString();
-        }
-        return names;
-    }
 
     public static String[] getObjectNames(Kernel kernel, Object parentName, String[] j2eeTypes) {
         List objectNames = new LinkedList();
@@ -76,46 +49,5 @@
         return names;
     }
 
-    /**
-     * Gets a Configuration that is the parent of the specified object.
-     *
-     * @param objectName the bean to find the Configuration for
-     * @return the Configuration the bean is in, or null if it is not in a Configuration
-     */
-    public synchronized static ObjectName getConfiguration(Kernel kernel, ObjectName objectName) {
-        try {
-            GBeanData data = kernel.getGBeanData(objectName);
-            AbstractName abstractName = data.getAbstractName();
-            AbstractName result = getConfiguration(kernel, abstractName);
-            if (result == null) {
-                return null;
-            }
-            return result.getObjectName();
-        } catch (GBeanNotFoundException e) {
-            log.warn("gbean not found" + objectName);
-            return null;
-        }
-    }
 
-    public synchronized static AbstractName getConfiguration(Kernel kernel, AbstractName abstractName) {
-        DependencyManager mgr = kernel.getDependencyManager();
-        Set parents = mgr.getParents(abstractName);
-        if(parents == null || parents.isEmpty()) {
-            log.warn("No parents found for "+abstractName);
-            return null;
-        }
-        for (Iterator it = parents.iterator(); it.hasNext();) {
-            AbstractName name = (AbstractName) it.next();
-            try {
-                GBeanInfo info = kernel.getGBeanInfo(name);
-                if(info.getClassName().equals(Configuration.class.getName())) {
-                    return name;
-                }
-            } catch (GBeanNotFoundException e) {
-                // should never happen
-            }
-        }
-        log.warn("No Configuration parent found");
-        return null;
-    }
 }

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java Tue Mar 14 12:58:25 2006
@@ -129,7 +129,8 @@
             servletContext.setAttribute(pojoClassID, pojoClass);
 
             //this now starts the servlet in the appropriate context
-            context.registerServletHolder(this, getServletName(), this.servletMappings, this.webRoleRefPermissions);
+            //TODO check that we should not call this a servlet for jsr-77 benefit.
+            context.registerServletHolder(this, getServletName(), this.servletMappings, null);
 //            start();
         }
     }

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletHolder.java Tue Mar 14 12:58:25 2006
@@ -19,8 +19,6 @@
 import java.io.IOException;
 import java.util.Map;
 import java.util.Set;
-import java.util.Collections;
-import javax.security.jacc.PolicyContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
@@ -74,7 +72,7 @@
                 setInitOrder(loadOnStartup.intValue());
             }
             //this now starts the servlet in the appropriate context
-            context.registerServletHolder(this, servletName, servletMappings, webRoleRefPermissions == null? Collections.EMPTY_MAP: webRoleRefPermissions);
+            context.registerServletHolder(this, servletName, servletMappings, objectName);
         }
         setRunAs(runAsRole);
         this.objectName = objectName;

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyServletRegistration.java Tue Mar 14 12:58:25 2006
@@ -28,7 +28,7 @@
  */
 public interface JettyServletRegistration {
 
-    void registerServletHolder(ServletHolder servletHolder, String servletName, Set servletMappings, Map webRoleRefPermissions) throws Exception;
+    void registerServletHolder(ServletHolder servletHolder, String servletName, Set servletMappings, String objectName) throws Exception;
 
     ServletHandler getServletHandler();
 

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=385886&r1=385885&r2=385886&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Tue Mar 14 12:58:25 2006
@@ -22,11 +22,8 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
-import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
-import org.apache.geronimo.j2ee.management.impl.Util;
 import org.apache.geronimo.jetty.interceptor.BeforeAfter;
 import org.apache.geronimo.jetty.interceptor.ComponentContextBeforeAfter;
 import org.apache.geronimo.jetty.interceptor.InstanceContextBeforeAfter;
@@ -61,7 +58,6 @@
 import org.mortbay.jetty.servlet.WebApplicationContext;
 import org.mortbay.jetty.servlet.WebApplicationHandler;
 
-import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.naming.Context;
 import java.io.IOException;
@@ -70,6 +66,7 @@
 import java.security.PermissionCollection;
 import java.util.Collection;
 import java.util.EventListener;
+import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
@@ -83,9 +80,6 @@
 public class JettyWebAppContext extends WebApplicationContext implements GBeanLifecycle, JettyServletRegistration, WebModule {
     private static Log log = LogFactory.getLog(JettyWebAppContext.class);
 
-    private final Kernel kernel;
-    //jsr-77 stuff
-    private final J2eeContext moduleContext;
     private final String originalSpecDD;
     private final J2EEServer server;
     private final J2EEApplication application;
@@ -101,10 +95,11 @@
     private final BeforeAfter chain;
     private final int contextLength;
     private final SecurityContextBeforeAfter securityInterceptor;
-    private static final String[] J2EE_TYPES = {NameFactory.SERVLET};
 
     private final String objectName;
 
+    private final Set servletNames = new HashSet();
+
     private String sessionManager;
 
 
@@ -143,10 +138,8 @@
      * @deprecated never use this... this is only here because Jetty WebApplicationContext is externalizable
      */
     public JettyWebAppContext() {
-        kernel = null;
         server = null;
         application = null;
-        moduleContext = null;
         originalSpecDD = null;
         webClassLoader = null;
         jettyContainer = null;
@@ -208,13 +201,11 @@
         assert trackedConnectionAssociator != null;
         assert jettyContainer != null;
 
-        this.kernel = kernel;
         this.server = server;
         this.application = application;
         this.objectName = objectName;
         ObjectName myObjectName = JMXUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
-        moduleContext = J2eeContextImpl.newContext(myObjectName, NameFactory.WEB_MODULE);
 
         this.jettyContainer = jettyContainer;
 
@@ -479,15 +470,11 @@
     }
 
     public String[] getServlets() {
-        try {
-            return Util.getObjectNames(kernel, moduleContext, J2EE_TYPES);
-        } catch (MalformedObjectNameException e) {
-            log.error(e);
-            return new String[0];
+        synchronized(servletNames) {
+            return (String[]) servletNames.toArray(new String[servletNames.size()]);
         }
     }
 
-
     public String getSessionManager() {
         return this.sessionManager;
     }
@@ -535,7 +522,7 @@
         }
     }
 
-    public void registerServletHolder(ServletHolder servletHolder, String servletName, Set servletMappings, Map webRoleRefPermissions) throws Exception {
+    public void registerServletHolder(ServletHolder servletHolder, String servletName, Set servletMappings, String objectName) throws Exception {
         //TODO filters
         handler.addServletHolder(servletHolder);
         if (servletMappings != null) {
@@ -544,14 +531,16 @@
                 handler.mapPathToServlet(urlPattern, servletName);
             }
         }
-//        if (securityInterceptor != null) {
-//            securityInterceptor.registerServletHolder(webRoleRefPermissions);
-//        }
         Object context = enterContextScope(null, null);
         try {
             servletHolder.start();
         } finally {
             leaveContextScope(null, null, context);
+        }
+        if (objectName != null) {
+            synchronized(servletNames) {
+                servletNames.add(objectName);
+            }
         }
     }
 

Added: geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResourceAdapter.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResourceAdapter.java?rev=385886&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResourceAdapter.java (added)
+++ geronimo/branches/1.1/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAResourceAdapter.java Tue Mar 14 12:58:25 2006
@@ -0,0 +1,29 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.management.geronimo;
+
+import org.apache.geronimo.management.J2EEManagedObject;
+
+/**
+ * Represents the JSR-77 type with the same name
+ *
+ * @version $Rev: 355877 $ $Date: 2005-12-10 18:48:27 -0800 (Sat, 10 Dec 2005) $
+ */
+public interface JCAResourceAdapter extends J2EEManagedObject {
+    //TODO consider adding references to ManagedConnectionFactory and ActivationSpec/MessageEndpointFactory.
+}



Mime
View raw message