geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r386505 [1/2] - in /geronimo/branches/1.1: modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/connector-builder/src/test-data/connector_1_...
Date Fri, 17 Mar 2006 02:21:42 GMT
Author: djencks
Date: Thu Mar 16 18:21:37 2006
New Revision: 386505

URL: http://svn.apache.org/viewcvs?rev=386505&view=rev
Log:
Remove interfaces from AbstractName.  Numerous fixes to Connector module.  Connector-builder tests now pass.

Modified:
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.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-data/connector_1_0/geronimo-ra.xml
    geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
    geronimo/branches/1.1/modules/connector-builder/src/test-data/data/external-application-plan.xml
    geronimo/branches/1.1/modules/connector-builder/src/test-data/data/old-schema-plan.xml
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.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/outbound/JCAConnectionFactoryImplGBean.java
    geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
    geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
    geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/branches/1.1/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
    geronimo/branches/1.1/modules/j2ee-schema/src/test-data/geronimo/ejb-naming-post.xml
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
    geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/management/Abstract77Test.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractNameQuery.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanInfoBuilder.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
    geronimo/branches/1.1/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/branches/1.1/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java
    geronimo/branches/1.1/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
    geronimo/branches/1.1/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
    geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/1.1/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Thu Mar 16 18:21:37 2006
@@ -170,11 +170,8 @@
 
         AbstractName moduleName;
         if (earName == null) {
-            try {
-                moduleName = NameFactory.buildModuleName(environment.getProperties(), environment.getConfigId(), ConfigurationModuleType.CAR, null);
-            } catch (MalformedObjectNameException e) {
-                throw new DeploymentException("Could not construct standalone app client module name", e);
-            }
+            earName = Naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
+            moduleName = Naming.createChildName(earName, NameFactory.APP_CLIENT_MODULE, environment.getConfigId().toString());
         } else {
             moduleName = naming.createChildName(earName, targetPath, NameFactory.APP_CLIENT_MODULE);
         }
@@ -268,12 +265,7 @@
             clientEnvironment.setConfigId(configId);
         }
 
-        AbstractName clientBaseName;
-        try {
-            clientBaseName = NameFactory.buildModuleName(clientEnvironment.getProperties(), clientEnvironment.getConfigId(), ConfigurationModuleType.CAR, moduleFile.getName());
-        } catch (MalformedObjectNameException e) {
-            throw new DeploymentException("Could not construct abstract name for app client", e);
-        }
+        AbstractName clientBaseName = Naming.createRootName(clientEnvironment.getConfigId(), clientEnvironment.getConfigId().toString(), NameFactory.APP_CLIENT_MODULE);
         File appClientDir;
         try {
             appClientDir = configurationStore.createNewConfigurationDir(clientEnvironment.getConfigId());

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -43,26 +43,25 @@
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.DynamicGAttributeInfo;
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.ConnectorModule;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
@@ -93,7 +92,6 @@
 
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
-import javax.management.MalformedObjectNameException;
 import java.beans.Introspector;
 import java.beans.PropertyEditor;
 import java.io.File;
@@ -102,6 +100,7 @@
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -109,7 +108,6 @@
 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;
 
@@ -129,12 +127,12 @@
     static final String GERCONNECTOR_NAMESPACE = CONNECTOR_QNAME.getNamespaceURI();
 
     public ConnectorModuleBuilder(Environment defaultEnvironment,
-                                  int defaultMaxSize,
-                                  int defaultMinSize,
-                                  int defaultBlockingTimeoutMilliseconds,
-                                  int defaultIdleTimeoutMinutes,
-                                  boolean defaultXATransactionCaching,
-                                  boolean defaultXAThreadCaching) {
+            int defaultMaxSize,
+            int defaultMinSize,
+            int defaultBlockingTimeoutMilliseconds,
+            int defaultIdleTimeoutMinutes,
+            boolean defaultXATransactionCaching,
+            boolean defaultXAThreadCaching) {
         this.defaultEnvironment = defaultEnvironment;
 
         this.defaultMaxSize = defaultMaxSize;
@@ -232,11 +230,8 @@
 
         AbstractName moduleName;
         if (earName == null) {
-            try {
-                moduleName = NameFactory.buildModuleName(environment.getProperties(), environment.getConfigId(), ConfigurationModuleType.RAR, null);
-            } catch (MalformedObjectNameException e) {
-                throw new DeploymentException("Could not construct standalone connector module name", e);
-            }
+            earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
+            moduleName = naming.createChildName(earName, environment.getConfigId().toString(), NameFactory.RESOURCE_ADAPTER_MODULE);
         } else {
             moduleName = naming.createChildName(earName, targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
         }
@@ -272,19 +267,34 @@
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         ConnectorModule resourceModule = (ConnectorModule) module;
-        AbstractName resourceAdapterModuleName = resourceModule.getModuleName();
-
-        AbstractName resourceName = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.JCA_RESOURCE);
 
         final ConnectorType connector = (ConnectorType) module.getSpecDD();
 
+        /*
+        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)
+        TODO include admin objects (n) from JCAResource presumably
+        */
+        AbstractName resourceAdapterModuleName = resourceModule.getModuleName();
+
+        AbstractName resourceAdapterjsr77Name = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.RESOURCE_ADAPTER);
+        AbstractName jcaResourcejsr77Name = earContext.getNaming().createChildName(resourceAdapterjsr77Name, module.getName(), NameFactory.JCA_RESOURCE);
+
         //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());
+        //TODO configid when we figure out how to install the J2EEServer gbean, uncomment this
+//        resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_SERVER, earContext.getServerName());
         if (!earContext.getModuleName().equals(resourceAdapterModuleName)) {
             resourceAdapterModuleData.setReferencePattern(NameFactory.J2EE_APPLICATION, earContext.getModuleName());
         }
+        resourceAdapterModuleData.setReferencePattern("ResourceAdapter", resourceAdapterjsr77Name);
 
         resourceAdapterModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
         resourceAdapterModuleData.setAttribute("displayName", connector.getDisplayNameArray().length == 0 ? null : connector.getDisplayNameArray(0).getStringValue());
@@ -321,105 +331,8 @@
             throw new DeploymentException("Could not add resource adapter module gbean to context", e);
         }
 
-        //register the instances we will create later
-        GerConnectorType geronimoConnector = (GerConnectorType) module.getVendorDD();
-        GerResourceadapterType[] geronimoResourceAdapters = geronimoConnector.getResourceadapterArray();
-        for (int k = 0; k < geronimoResourceAdapters.length; k++) {
-            GerResourceadapterType geronimoResourceAdapter = geronimoResourceAdapters[k];
-
-            if (resourceadapter.isSetResourceadapterClass()) {
-                // set the resource adapter class and activationSpec info map
-                if (resourceadapter.isSetInboundResourceadapter() && resourceadapter.getInboundResourceadapter().isSetMessageadapter())
-                {
-                    String resourceAdapterNameString = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
-                    AbstractName resourceAdapterName = earContext.getNaming().createChildName(resourceName, resourceAdapterNameString, NameFactory.JCA_RESOURCE_ADAPTER);
-                    GBeanData resourceAdapterData = new GBeanData(resourceAdapterName, null);
-                    try {
-                        earContext.addGBean(resourceAdapterData);
-                    } catch (GBeanAlreadyExistsException e) {
-                        throw new DeploymentException("Could not add resource adapter gbean to context", e);
-                    }
-                }
-            }
-            if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
-                GerConnectionDefinitionType[] connectionDefinitions = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray();
-                for (int i = 0; i < connectionDefinitions.length; i++) {
-                    GerConnectionDefinitionType connectionDefinition = connectionDefinitions[i];
-                    GerConnectiondefinitionInstanceType[] connectionDefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
-                    for (int j = 0; j < connectionDefinitionInstances.length; j++) {
-                        GerConnectiondefinitionInstanceType connectionDefinitionInstance = connectionDefinitionInstances[j];
-                        AbstractName connectionFactoryObjectName = earContext.getNaming().createChildName(resourceName, connectionDefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
-                        GBeanData connectionFactoryData = new GBeanData(connectionFactoryObjectName, null);
-                        try {
-                            earContext.addGBean(connectionFactoryData);
-                        } catch (GBeanAlreadyExistsException e) {
-                            throw new DeploymentException("Could not add connection factory gbean to context", e);
-                        }
-                    }
-                }
-            }
-        }
-        for (int i = 0; i < geronimoConnector.getAdminobjectArray().length; i++) {
-            GerAdminobjectType gerAdminObject = geronimoConnector.getAdminobjectArray()[i];
-            for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
-                GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
-
-                AbstractName adminObjectObjectName = earContext.getNaming().createChildName(resourceName, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT);
-                GBeanData adminObjectData = new GBeanData(adminObjectObjectName, null);
-                try {
-                    earContext.addGBean(adminObjectData);
-                } catch (GBeanAlreadyExistsException e) {
-                    throw new DeploymentException("Could not add admin object gbean to context", e);
-                }
-            }
-        }
-
-    }
-
-    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
-        ConnectorModule resourceModule = (ConnectorModule) module;
-        AbstractName resourceAdapterModuleName;
-        if (resourceModule.isStandAlone()) {
-            resourceAdapterModuleName = earContext.getModuleName();
-        } else {
-            AbstractName applicationName = earContext.getModuleName();
-            resourceAdapterModuleName = earContext.getNaming().createChildName(applicationName, module.getName(), NameFactory.RESOURCE_ADAPTER_MODULE);
-        }
-        /*
-        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 = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.RESOURCE_ADAPTER);
-
-        XmlObject specDD = module.getSpecDD();
-
-        GBeanData resourceAdapterModuleData;
-        try {
-            resourceAdapterModuleData = earContext.getGBeanInstance(resourceAdapterModuleName);
-        } catch (GBeanNotFoundException e) {
-            throw new DeploymentException("Internal consistency bug: Could not retrieve gbean data for module: " + resourceAdapterModuleName);
-        }
-        if (resourceAdapterModuleData == null) {
-            throw new DeploymentException("Internal consistency bug: gbean data for module is missing: " + resourceAdapterModuleName);
-        }
-        resourceAdapterModuleData.setReferencePattern("ResourceAdapter", resourceAdapterjsr77Name);
-
-        // add it
-        try {
-            earContext.addGBean(resourceAdapterModuleData);
-        } catch (GBeanAlreadyExistsException e) {
-            throw new DeploymentException("Could not add resource adapter module gbean to context", e);
-        }
-
         //construct the bogus resource adapter and jca resource placeholders
         GBeanData resourceAdapterData = new GBeanData(resourceAdapterjsr77Name, ResourceAdapterImplGBean.GBEAN_INFO);
-        AbstractName jcaResourcejsr77Name = earContext.getNaming().createChildName(resourceAdapterjsr77Name, module.getName(), NameFactory.JCA_RESOURCE);
         resourceAdapterData.setReferencePattern("JCAResource", jcaResourcejsr77Name);
         try {
             earContext.addGBean(resourceAdapterData);
@@ -441,7 +354,12 @@
         GbeanType[] gbeans = geronimoConnector.getGbeanArray();
         ServiceConfigBuilder.addGBeans(gbeans, cl, resourceAdapterModuleName, earContext);
 
-        addConnectorGBeans(earContext, jcaResourcejsr77Name, resourceAdapterModuleData, (ConnectorType) specDD, geronimoConnector, cl);
+        addConnectorGBeans(earContext, jcaResourcejsr77Name, resourceAdapterModuleData, connector, geronimoConnector, cl);
+
+    }
+
+    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Repository repository) throws DeploymentException {
+        //all our gbeans are added in  the initContext step
     }
 
     public String getSchemaNamespace() {
@@ -778,8 +696,10 @@
 
     private void addOutboundGBeans(EARContext earContext, AbstractName jcaResourceName, AbstractName resourceAdapterAbstractName, GBeanData managedConnectionFactoryPrototypeGBeanData, GerConnectiondefinitionInstanceType connectiondefinitionInstance, String transactionSupport, ClassLoader cl) throws DeploymentException {
         GBeanData managedConnectionFactoryInstanceGBeanData = new GBeanData(managedConnectionFactoryPrototypeGBeanData);
+        AbstractName connectionFactoryAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_CONNECTION_FACTORY);
+        AbstractName managedConnectionFactoryAbstractName = earContext.getNaming().createChildName(connectionFactoryAbstractName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         // ConnectionManager
-        AbstractName connectionManagerAbstractName = configureConnectionManager(earContext, jcaResourceName, transactionSupport, connectiondefinitionInstance, cl);
+        AbstractName connectionManagerAbstractName = configureConnectionManager(earContext, managedConnectionFactoryAbstractName, transactionSupport, connectiondefinitionInstance, cl);
 
         // ManagedConnectionFactory
         setDynamicGBeanDataAttributes(managedConnectionFactoryInstanceGBeanData, connectiondefinitionInstance.getConfigPropertySettingArray(), cl);
@@ -803,7 +723,6 @@
             throw new DeploymentException(e);
         }
 
-        AbstractName managedConnectionFactoryAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         managedConnectionFactoryInstanceGBeanData.setAbstractName(managedConnectionFactoryAbstractName);
         try {
             earContext.addGBean(managedConnectionFactoryInstanceGBeanData);
@@ -812,7 +731,6 @@
         }
 
         // ConnectionFactory
-        AbstractName connectionFactoryAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_CONNECTION_FACTORY);
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName, JCAConnectionFactoryImplGBean.GBEAN_INFO);
         connectionFactoryGBeanData.setReferencePattern("JCAManagedConnectionFactory", managedConnectionFactoryAbstractName);
 

Modified: geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_0/geronimo-ra.xml Thu Mar 16 18:21:37 2006
@@ -93,4 +93,16 @@
            class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean">
     </gbean>
 
+    <gbean name="TransactionContextManager"
+            class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
+ <!--
+         <reference name="TransactionManager">
+             <name>TransactionManager</name>
+         </reference>
+         <reference name="XidImporter">
+             <name>TransactionManager</name>
+         </reference>
+ -->
+     </gbean>
+
 </connector>

Modified: geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml Thu Mar 16 18:21:37 2006
@@ -124,30 +124,34 @@
         <attribute name="startMaximumPoolSize">10</attribute>
         <attribute name="scheduledMaximumPoolSize">10</attribute>
         <reference name="TransactionContextManager">
-            <gbean-name>*:name=TransactionContextManager,*</gbean-name>
+            <name>TransactionContextManager</name>
         </reference>
     </gbean>
 
+<!--
     <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">10</attribute>
         <references name="ResourceManagers">
             <pattern>
-                <gbean-name>*:j2eeType=JCAManagedConnectionFactory,*</gbean-name>
+                <name>JCAManagedConnectionFactory</name>
             </pattern>
             <pattern>
-                <gbean-name>*:j2eeType=MessageDrivenBean,*</gbean-name>
+                <name>MessageDrivenBean</name>
             </pattern>
         </references>
     </gbean>
+-->
 
     <gbean name="TransactionContextManager"
            class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
+<!--
         <reference name="TransactionManager">
-            <gbean-name>*:name=TransactionManager,*</gbean-name>
+            <name>TransactionManager</name>
         </reference>
         <reference name="XidImporter">
-            <gbean-name>*:name=TransactionManager,*</gbean-name>
+            <name>TransactionManager</name>
         </reference>
+-->
     </gbean>
 
 </connector>

Modified: geronimo/branches/1.1/modules/connector-builder/src/test-data/data/external-application-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test-data/data/external-application-plan.xml?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test-data/data/external-application-plan.xml (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test-data/data/external-application-plan.xml Thu Mar 16 18:21:37 2006
@@ -195,20 +195,20 @@
         <attribute name="syncMaximumPoolSize">10</attribute>
         <attribute name="startMaximumPoolSize">10</attribute>
         <attribute name="scheduledMaximumPoolSize">10</attribute>
-        <reference name="TransactionContextManager"><gbean-name>*:name=TransactionContextManager,*</gbean-name></reference>
+        <reference name="TransactionContextManager"><name>TransactionContextManager</name></reference>
     </gbean>
 
     <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">10</attribute>
         <references name="ResourceManagers">
-            <pattern><gbean-name>*:j2eeType=JCAManagedConnectionFactory,*</gbean-name></pattern>
-            <pattern><gbean-name>*:j2eeType=MessageDrivenBean,*</gbean-name></pattern>
+            <pattern><name>JCAManagedConnectionFactory</name></pattern>
+            <pattern><name>MessageDrivenBean</name></pattern>
         </references>
     </gbean>
 
     <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
-        <reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
-        <reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
+        <reference name="TransactionManager"><name>TransactionManager</name></reference>
+        <reference name="XidImporter"><name>TransactionManager</name></reference>
     </gbean>
 
 </application>

Modified: geronimo/branches/1.1/modules/connector-builder/src/test-data/data/old-schema-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test-data/data/old-schema-plan.xml?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test-data/data/old-schema-plan.xml (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test-data/data/old-schema-plan.xml Thu Mar 16 18:21:37 2006
@@ -114,20 +114,20 @@
         <attribute name="syncMaximumPoolSize">10</attribute>
         <attribute name="startMaximumPoolSize">10</attribute>
         <attribute name="scheduledMaximumPoolSize">10</attribute>
-        <reference name="TransactionContextManager"><gbean-name>*:name=TransactionContextManager,*</gbean-name></reference>
+        <reference name="TransactionContextManager"><name>TransactionContextManager</name></reference>
     </gbean>
 
     <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">10</attribute>
         <references name="ResourceManagers">
-            <pattern><gbean-name>*:j2eeType=JCAManagedConnectionFactory,*</gbean-name></pattern>
-            <pattern><gbean-name>*:j2eeType=MessageDrivenBean,*</gbean-name></pattern>
+            <pattern><name>JCAManagedConnectionFactory</name></pattern>
+            <pattern><name>MessageDrivenBean</name></pattern>
         </references>
     </gbean>
 
     <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
-        <reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
-        <reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
+        <reference name="TransactionManager"><name>TransactionManager</name></reference>
+        <reference name="XidImporter"><name>name=TransactionManager</name></reference>
     </gbean>
 
 </connector>

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -19,9 +19,9 @@
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -34,32 +34,28 @@
 import org.apache.geronimo.j2ee.deployment.RefContext;
 import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
-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.J2EEServerImpl;
+import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.KernelConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
+import org.apache.geronimo.kernel.config.EditableConfigurationManager;
+import org.apache.geronimo.kernel.config.EditableKernelConfigurationManager;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.repository.Dependency;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.tranql.sql.jdbc.JDBCUtil;
 
-import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.sql.DataSource;
 import javax.xml.namespace.QName;
@@ -93,7 +89,7 @@
     private int defaultBlockingTimeoutMilliseconds = 5000;
     private int defaultidleTimeoutMinutes = 15;
     private Environment defaultEnvironment;
-    private ConfigurationStore configurationStore = new MockConfigStore(null);
+    private ConfigurationStore configurationStore = new MockConfigStore();
     private Repository repository = new Repository() {
         public boolean contains(Artifact artifact) {
             return false;
@@ -111,7 +107,7 @@
     private EJBReferenceBuilder ejbReferenceBuilder = new EJBReferenceBuilder() {
 
 
-        public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) throws DeploymentException {
+        public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) {
             return null;
         }
 
@@ -119,11 +115,11 @@
             return null;
         }
 
-        public Reference createEJBRemoteRef(String requiredModule, String optionalModule, String name, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote, Configuration configuration) throws DeploymentException {
+        public Reference createEJBRemoteRef(String requiredModule, String optionalModule, String name, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote, Configuration configuration) {
             return null;
         }
 
-        public Reference createEJBLocalRef(String requiredModule, String optionalModule, String name, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local, Configuration configuration) throws DeploymentException {
+        public Reference createEJBLocalRef(String requiredModule, String optionalModule, String name, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local, Configuration configuration) {
             return null;
         }
 
@@ -139,53 +135,35 @@
             return null;
         }
 
-        public ObjectName locateResourceName(ObjectName query) {
-            return null;
-        }
-
         public GBeanData locateActivationSpecInfo(AbstractNameQuery nameQuery, String messageListenerInterface, Configuration configuration) {
             return null;
         }
-
-        public GBeanData locateResourceAdapterGBeanData(GBeanData resourceAdapterModuleData) {
-            return null;
-        }
-
-        public GBeanData locateAdminObjectInfo(GBeanData resourceAdapterModuleData, String adminObjectInterfaceName) {
-            return null;
-        }
-
-        public GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String connectionFactoryInterfaceName) {
-            return null;
-        }
     };
+
     private ServiceReferenceBuilder serviceReferenceBuilder = new ServiceReferenceBuilder() {
         //it could return a Service or a Reference, we don't care
         public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
             return null;
         }
     };
-    private ObjectName configurationManagerName;
+
+    private Kernel kernel;
+    private EditableConfigurationManager configurationManager;
+    private static final Naming naming = new Jsr77Naming();
+    private static final Artifact bootId = new Artifact("test", "test", "", "car");
+
+    private static final AbstractNameQuery connectionTrackerName = new AbstractNameQuery(null, Collections.singletonMap("name", "ConnectionTracker"));
+    private static final AbstractName serverName = naming.createRootName(bootId, "Server", "J2EEServer");
+    private static final AbstractNameQuery transactionContextManagerName = new AbstractNameQuery(null, Collections.singletonMap("name", "TransactionContextManager"));
 
 
     public void testBuildEar() throws Exception {
-        ObjectName connectionTrackerName = new ObjectName("geronimo.connector:service=ConnectionTracker");
         JarFile rarFile = null;
-        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
         try {
-            kernel.boot();
-
-            GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
-            kernel.loadGBean(store, this.getClass().getClassLoader());
-            kernel.startGBean(store.getName());
-
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
-            configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
-            kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
-            kernel.startGBean(configurationManagerName);
-
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
-            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, null, connectionTrackerName, null, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching), resourceReferenceBuilder, null, serviceReferenceBuilder);
+            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, transactionContextManagerName, connectionTrackerName, null, null, null, new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()), null, null, ejbReferenceBuilder, null,
+                    new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching),
+                    resourceReferenceBuilder, null, serviceReferenceBuilder, kernel);
             ConfigurationData configData = null;
             try {
                 File planFile = new File(basedir, "src/test-data/data/external-application-plan.xml");
@@ -197,7 +175,6 @@
                 }
             }
         } finally {
-            kernel.shutdown();
             DeploymentUtil.close(rarFile);
         }
     }
@@ -309,25 +286,9 @@
 
 
     private void executeTestBuildModule(InstallAction action, boolean is15) throws Exception {
-        J2eeContext j2eeContext = new J2eeContextImpl("geronimo.test", "geronimo", "null", "JCAResource", "geronimo/test-ear/1.0/car", null, null);
         String resourceAdapterName = "testRA";
-        //N.B. short version of getComponentName
-        ObjectName connectionTrackerName = NameFactory.getComponentName(null, null, null, null, "ConnectionTracker", ConnectionTrackingCoordinatorGBean.GBEAN_INFO.getJ2eeType(), j2eeContext);
-        //new ObjectName("test:J2EEServer=bar,J2EEModule=org/apache/geronimo/j2ee/deployment/test,service=ConnectionTracker");
 
-        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
         try {
-            kernel.boot();
-
-            GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
-            kernel.loadGBean(store, this.getClass().getClassLoader());
-            kernel.startGBean(store.getName());
-
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
-            configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
-            kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
-            kernel.startGBean(configurationManagerName);
-
             ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching);
             File rarFile = action.getRARFile();
 
@@ -337,11 +298,13 @@
             Thread.currentThread().setContextClassLoader(cl);
 
             JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
-            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null, null, earName, naming);
+            AbstractName earName = null;
+            String moduleName = "geronimo/test-ear/1.0/car";
+            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, moduleName, action.getSpecDD(), null, null, earName, naming);
             if (module == null) {
                 throw new DeploymentException("Was not a connector module");
             }
-            assertEquals(j2eeContext.getJ2eeModuleName(), module.getEnvironment().getConfigId().toString());
+            assertEquals(moduleName, module.getEnvironment().getConfigId().toString());
 
             File tempDir = null;
             try {
@@ -349,9 +312,12 @@
                 EARContext earContext = new EARContext(tempDir,
                         module.getEnvironment(),
                         module.getType(),
-                        serverName,
-                        j2eeContext.getJ2eeApplicationName(),
-                        null,
+                        naming,
+                        Collections.EMPTY_SET,
+                        Collections.singleton(configurationStore),
+                        new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()),
+                        module.getModuleName(), //hardcode standalone here.
+                        transactionContextManagerName,
                         connectionTrackerName,
                         null,
                         null,
@@ -362,9 +328,12 @@
                 earContext.getClassLoader();
                 moduleBuilder.initContext(earContext, module, cl);
                 moduleBuilder.addGBeans(earContext, module, cl, repository);
+
+                ConfigurationData configurationData = earContext.getConfigurationData();
+                AbstractName moduleAbstractName = earContext.getModuleName();
                 earContext.close();
 
-                verifyDeployment(earContext.getConfigurationData(), tempDir, oldCl, j2eeContext, resourceAdapterName, is15);
+                verifyDeployment(configurationData, oldCl, moduleAbstractName, resourceAdapterName, is15, moduleName);
             } finally {
                 module.close();
                 DeploymentUtil.recursiveDelete(tempDir);
@@ -374,78 +343,30 @@
         }
     }
 
-    private void verifyDeployment(ConfigurationData configurationData, File unpackedDir, ClassLoader cl, J2eeContext j2eeContext, String resourceAdapterName, boolean is15) throws Exception {
+    private void verifyDeployment(ConfigurationData configurationData, ClassLoader cl, AbstractName moduleAbstractName, String resourceAdapterName, boolean is15, String moduleName) throws Exception {
         DataSource ds = null;
-        Kernel kernel = null;
         try {
-            kernel = KernelFactory.newInstance().createKernel("bar");
-            kernel.boot();
-
-            GBeanData store = new GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), MockConfigStore.GBEAN_INFO);
-            kernel.loadGBean(store, this.getClass().getClassLoader());
-            kernel.startGBean(store.getName());
-
-            GBeanData artifactManager = new GBeanData(JMXUtil.getObjectName("foo:name=ArtifactManager"), DefaultArtifactManager.GBEAN_INFO);
-            kernel.loadGBean(artifactManager, this.getClass().getClassLoader());
-            kernel.startGBean(artifactManager.getName());
-
-            GBeanData artifactResolver = new GBeanData(JMXUtil.getObjectName("foo:name=ArtifactResolver"), DefaultArtifactResolver.GBEAN_INFO);
-            artifactResolver.setReferencePattern("ArtifactManager", artifactManager.getName());
-            kernel.loadGBean(artifactResolver, this.getClass().getClassLoader());
-            kernel.startGBean(artifactResolver.getName());
-
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
-            configurationManagerData.setReferencePattern("Stores", store.getName());
-            configurationManagerData.setReferencePattern("ArtifactManager", artifactManager.getName());
-            configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolver.getName());
-            kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
-            kernel.startGBean(configurationManagerName);
-            ConfigurationManager configurationManager = (ConfigurationManager) kernel.getProxyManager().createProxy(configurationManagerName, ConfigurationManager.class);
-
-            Artifact parentID = ((Dependency) defaultEnvironment.getDependencies().iterator().next()).getArtifact();
-            configurationManager.loadConfiguration(parentID);
-            configurationManager.startConfiguration(parentID);
-
-            ObjectName serverInfoObjectName = ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":name=ServerInfo");
-            GBeanData serverInfoGBean = new GBeanData(serverInfoObjectName, BasicServerInfo.GBEAN_INFO);
-            serverInfoGBean.setAttribute("baseDirectory", ".");
-            kernel.loadGBean(serverInfoGBean, cl);
-            kernel.startGBean(serverInfoObjectName);
-            assertRunning(kernel, serverInfoObjectName);
-
-            ObjectName j2eeServerObjectName = NameFactory.getServerName(null, null, j2eeContext);
-            GBeanData j2eeServerGBean = new GBeanData(j2eeServerObjectName, J2EEServerImpl.GBEAN_INFO);
-            j2eeServerGBean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfoObjectName));
-            kernel.loadGBean(j2eeServerGBean, cl);
-            kernel.startGBean(j2eeServerObjectName);
-            assertRunning(kernel, j2eeServerObjectName);
 
             // load the configuration
             Configuration configuration = configurationManager.loadConfiguration(configurationData);
             configurationManager.startConfiguration(configuration);
-            Set gb = kernel.listGBeans(JMXUtil.getObjectName("test:*"));
+            Set gb = configuration.getGBeans().keySet();
             for (Iterator iterator = gb.iterator(); iterator.hasNext();) {
-                ObjectName name = (ObjectName) iterator.next();
+                AbstractName name = (AbstractName) iterator.next();
                 if (State.RUNNING_INDEX != kernel.getGBeanState(name)) {
                     System.out.println("Not running: " + name);
                 }
             }
 
-            ObjectName applicationObjectName = NameFactory.getApplicationName(null, null, null, j2eeContext);
-            if (!j2eeContext.getJ2eeApplicationName().equals("null")) {
-                assertRunning(kernel, applicationObjectName);
-            } else {
-                Set applications = kernel.listGBeans(applicationObjectName);
-                assertTrue("No application object should be registered for a standalone module", applications.isEmpty());
-            }
-
-
-            ObjectName moduleName = NameFactory.getModuleName(null, null, null, NameFactory.RESOURCE_ADAPTER_MODULE, null, j2eeContext);
-            assertRunning(kernel, moduleName);
+            assertRunning(kernel, moduleAbstractName);
+            AbstractName resourceAdapterjsr77Name = naming.createChildName(moduleAbstractName, moduleName, NameFactory.RESOURCE_ADAPTER);
+            assertRunning(kernel, resourceAdapterjsr77Name);
+            AbstractName jcaResourcejsr77Name = naming.createChildName(resourceAdapterjsr77Name, moduleName, NameFactory.JCA_RESOURCE);
+            assertRunning(kernel, jcaResourcejsr77Name);
 
             //1.5 only
             if (is15) {
-                Map activationSpecInfoMap = (Map) kernel.getAttribute(moduleName, "activationSpecInfoMap");
+                Map activationSpecInfoMap = (Map) kernel.getAttribute(moduleAbstractName, "activationSpecInfoMap");
                 assertEquals(1, activationSpecInfoMap.size());
                 GBeanData activationSpecInfo = (GBeanData) activationSpecInfoMap.get("javax.jms.MessageListener");
                 assertNotNull(activationSpecInfo);
@@ -453,7 +374,7 @@
                 List attributes1 = activationSpecGBeanInfo.getPersistentAttributes();
                 assertEquals(2, attributes1.size());
 
-                Map adminObjectInfoMap = (Map) kernel.getAttribute(moduleName, "adminObjectInfoMap");
+                Map adminObjectInfoMap = (Map) kernel.getAttribute(moduleAbstractName, "adminObjectInfoMap");
                 assertEquals(1, adminObjectInfoMap.size());
                 GBeanData adminObjectInfo = (GBeanData) adminObjectInfoMap.get("org.apache.geronimo.connector.mock.MockAdminObject");
                 assertNotNull(adminObjectInfo);
@@ -462,13 +383,13 @@
                 assertEquals(3, attributes2.size());
 
                 // ResourceAdapter
-                ObjectName resourceAdapterObjectName = NameFactory.getComponentName(null, null, null, null, null, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext);
+                AbstractName resourceAdapterObjectName = naming.createChildName(jcaResourcejsr77Name, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
 
                 assertRunning(kernel, resourceAdapterObjectName);
                 assertAttributeValue(kernel, resourceAdapterObjectName, "RAStringProperty", "NewStringValue");
 
                 //both, except 1.0 has only one mcf type
-                Map managedConnectionFactoryInfoMap = (Map) kernel.getAttribute(moduleName, "managedConnectionFactoryInfoMap");
+                Map managedConnectionFactoryInfoMap = (Map) kernel.getAttribute(moduleAbstractName, "managedConnectionFactoryInfoMap");
                 assertEquals(2, managedConnectionFactoryInfoMap.size());
                 GBeanData managedConnectionFactoryInfo = (GBeanData) managedConnectionFactoryInfoMap.get("javax.resource.cci.ConnectionFactory");
                 assertNotNull(managedConnectionFactoryInfo);
@@ -478,53 +399,47 @@
             }
 
             // FirstTestOutboundConnectionFactory
-            ObjectName firstConnectionManagerFactory = NameFactory.getComponentName(null, null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-            assertRunning(kernel, firstConnectionManagerFactory);
-
-
-            ObjectName firstOutCF = NameFactory.getComponentName(null, null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
+            AbstractName firstOutCF = naming.createChildName(jcaResourcejsr77Name, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY);
             assertRunning(kernel, firstOutCF);
 
-//            ObjectName firstOutSecurity = new ObjectName("geronimo.security:service=Realm,type=PasswordCredential,name=FirstTestOutboundConnectionFactory");
-//            assertRunning(kernel, firstOutSecurity);
-
-            ObjectName firstOutMCF = NameFactory.getComponentName(null, null, null, null, null, "FirstTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+            AbstractName firstOutMCF = naming.createChildName(firstOutCF, "FirstTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
             assertRunning(kernel, firstOutMCF);
             assertAttributeValue(kernel, firstOutMCF, "OutboundStringProperty1", "newvalue1");
             assertAttributeValue(kernel, firstOutMCF, "OutboundStringProperty2", "originalvalue2");
             assertAttributeValue(kernel, firstOutMCF, "OutboundStringProperty3", "newvalue2");
 
-            // SecondTestOutboundConnectionFactory
-            ObjectName secondConnectionManagerFactory = NameFactory.getComponentName(null, null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-            assertRunning(kernel, secondConnectionManagerFactory);
-
+            AbstractName firstConnectionManagerFactory = naming.createChildName(firstOutMCF, "FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER);
+            assertRunning(kernel, firstConnectionManagerFactory);
 
-            ObjectName secondOutCF = NameFactory.getComponentName(null, null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
+            // SecondTestOutboundConnectionFactory
+            AbstractName secondOutCF = naming.createChildName(jcaResourcejsr77Name, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY);
             assertRunning(kernel, secondOutCF);
 
-            ObjectName secondOutMCF = NameFactory.getComponentName(null, null, null, null, null, "SecondTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+            AbstractName secondOutMCF = naming.createChildName(secondOutCF, "SecondTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
             assertRunning(kernel, secondOutMCF);
 
-            // ThirdTestOutboundConnectionFactory
-            ObjectName thirdConnectionManagerFactory = NameFactory.getComponentName(null, null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, j2eeContext);
-            assertRunning(kernel, thirdConnectionManagerFactory);
-
+            AbstractName secondConnectionManagerFactory = naming.createChildName(secondOutMCF, "SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER);
+            assertRunning(kernel, secondConnectionManagerFactory);
 
-            ObjectName thirdOutCF = NameFactory.getComponentName(null, null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY, j2eeContext);
+            // ThirdTestOutboundConnectionFactory
+            AbstractName thirdOutCF = naming.createChildName(jcaResourcejsr77Name, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_FACTORY);
             assertRunning(kernel, thirdOutCF);
 
-            ObjectName thirdOutMCF = NameFactory.getComponentName(null, null, null, null, null, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
+            AbstractName thirdOutMCF = naming.createChildName(thirdOutCF, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
             assertRunning(kernel, thirdOutMCF);
 
+            AbstractName thirdConnectionManagerFactory = naming.createChildName(thirdOutMCF, "ThirdTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER);
+            assertRunning(kernel, thirdConnectionManagerFactory);
+
             // 1.5 only
             //  Admin objects
             //
 
             if (is15) {
-                ObjectName tweedledeeAdminObject = NameFactory.getComponentName(null, null, null, null, null, "tweedledee", NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+                AbstractName tweedledeeAdminObject = naming.createChildName(jcaResourcejsr77Name, "tweedledee", NameFactory.JCA_ADMIN_OBJECT);
                 assertRunning(kernel, tweedledeeAdminObject);
 
-                ObjectName tweedledumAdminObject = NameFactory.getComponentName(null, null, null, null, null, "tweedledum", NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+                AbstractName tweedledumAdminObject = naming.createChildName(jcaResourcejsr77Name, "tweedledum", NameFactory.JCA_ADMIN_OBJECT);
                 assertRunning(kernel, tweedledumAdminObject);
             }
 
@@ -552,20 +467,46 @@
         }
     }
 
-    private void assertAttributeValue(Kernel kernel, ObjectName objectName, String attributeName, String attributeValue) throws Exception {
-        Object value = kernel.getAttribute(objectName, attributeName);
+    private void assertAttributeValue(Kernel kernel, AbstractName name, String attributeName, String attributeValue) throws Exception {
+        Object value = kernel.getAttribute(name, attributeName);
         assertEquals(attributeValue, value);
     }
 
-    private void assertRunning(Kernel kernel, ObjectName objectName) throws Exception {
-        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(objectName));
+    private void assertRunning(Kernel kernel, AbstractName name) throws Exception {
+        assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(name));
     }
 
     protected void setUp() throws Exception {
-        configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
+        super.setUp();
+        kernel = KernelFactory.newInstance().createKernel("test");
+        kernel.boot();
+
+        ConfigurationData bootstrap = new ConfigurationData(bootId, naming);
+
+        GBeanData artifactManagerData = bootstrap.addGBean("ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
+
+        GBeanData artifactResolverData = bootstrap.addGBean("ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
+        artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
+
+        GBeanData configurationManagerData = bootstrap.addGBean("ConfigurationManager", EditableKernelConfigurationManager.GBEAN_INFO);
+        configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
+        configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
+        bootstrap.addGBean(configurationManagerData);
+
+        GBeanData serverData = new GBeanData(serverName, J2EEServerImpl.GBEAN_INFO);
+        bootstrap.addGBean(serverData);
+
+        ConfigurationUtil.loadBootstrapConfiguration(kernel, bootstrap, getClass().getClassLoader());
+
+        configurationManager = ConfigurationUtil.getEditableConfigurationManager(kernel);
+        configurationManager.getConfiguration(bootstrap.getId());
         defaultEnvironment = new Environment();
-        defaultEnvironment.addDependency(Artifact.create("org/apache/geronimo/Server"), ImportType.ALL);
-        defaultEnvironment.getProperties().put(NameFactory.JSR77_BASE_NAME_PROPERTY, "geronimo.test:J2EEServer=geronimo");
+
+    }
+
+    protected void tearDown() throws Exception {
+        kernel.shutdown();
+        super.tearDown();
     }
 
     private abstract class InstallAction {
@@ -585,10 +526,8 @@
     }
 
     public static class MockConfigStore implements ConfigurationStore {
-        private final Kernel kernel;
 
-        public MockConfigStore(Kernel kernel) {
-            this.kernel = kernel;
+        public MockConfigStore() {
         }
 
         public void install(ConfigurationData configurationData) throws IOException, InvalidConfigException {
@@ -598,7 +537,7 @@
         }
 
         public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
-            ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
+            AbstractName configurationObjectName = Configuration.getConfigurationAbstractName(configId);
             GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
             Environment environment = new Environment();
             environment.setConfigId(configId);
@@ -641,8 +580,6 @@
         static {
             GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
             infoBuilder.addInterface(ConfigurationStore.class);
-            infoBuilder.addAttribute("kernel", Kernel.class, false);
-            infoBuilder.setConstructor(new String[]{"kernel"});
             GBEAN_INFO = infoBuilder.getBeanInfo();
 
             ByteArrayOutputStream baos = new ByteArrayOutputStream();

Modified: geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java Thu Mar 16 18:21:37 2006
@@ -1,6 +1,7 @@
 package org.apache.geronimo.connector.deployment;
 
 import java.io.File;
+import java.net.URL;
 
 import javax.xml.namespace.QName;
 
@@ -18,13 +19,14 @@
  */
 public class PlanParsingTest extends TestCase {
     private final static QName CONNECTOR_QNAME = GerConnectorDocument.type.getDocumentElementName();
+    private ClassLoader classLoader = this.getClass().getClassLoader();
 
     File basedir = new File(System.getProperty("basedir", System.getProperty("user.dir")));
 
     public void testLoadGeronimoDeploymentDescriptor10() throws Exception {
-        File geronimoDD = new File(basedir, "src/test-data/connector_1_0/geronimo-ra.xml");
-        assertTrue(geronimoDD.exists());
-        XmlObject plan = XmlBeansUtil.parse(geronimoDD.toURL());
+        URL srcXml = classLoader.getResource("connector_1_0/geronimo-ra.xml");
+//        File geronimoDD = new File(basedir, "src/test-data/connector_1_0/geronimo-ra.xml");
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, CONNECTOR_QNAME, GerConnectorType.type);
         SchemaConversionUtils.validateDD(connector);
@@ -32,28 +34,31 @@
     }
 
     public void testLoadJ2eeDeploymentDescriptor() throws Exception {
-        File j2eeDD = new File(basedir, "src/test-data/connector_1_5/ra.xml");
-        assertTrue(j2eeDD.exists());
-        XmlObject plan = XmlBeansUtil.parse(j2eeDD.toURL());
+        URL srcXml = classLoader.getResource("connector_1_5/ra.xml");
+//        File j2eeDD = new File(basedir, "src/test-data/connector_1_5/ra.xml");
+//        assertTrue(j2eeDD.exists());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         ConnectorDocument connectorDocument = (ConnectorDocument) plan.changeType(ConnectorDocument.type);
         assertNotNull(connectorDocument.getConnector().getResourceadapter());
         SchemaConversionUtils.validateDD(connectorDocument);
     }
 
     public void testLoadGeronimoDeploymentDescriptor15() throws Exception {
-        File geronimoDD = new File(basedir, "src/test-data/connector_1_5/geronimo-ra.xml");
-        assertTrue(geronimoDD.exists());
-        XmlObject plan = XmlBeansUtil.parse(geronimoDD.toURL());
+        URL srcXml = classLoader.getResource("connector_1_5/geronimo-ra.xml");
+//        File geronimoDD = new File(basedir, "src/test-data/connector_1_5/geronimo-ra.xml");
+//        assertTrue(geronimoDD.exists());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument connectorDocument = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         GerConnectorType connector = (GerConnectorType) SchemaConversionUtils.fixGeronimoSchema(connectorDocument, CONNECTOR_QNAME, GerConnectorType.type);
         assertEquals(1, connector.getResourceadapterArray().length);
     }
 
     public void testResourceAdapterNameUniqueness() throws Exception {
-        File resourcePlan = new File(basedir, "src/test-data/data/dup-resourceadapter-name.xml");
-        assertTrue(resourcePlan.exists());
+        URL srcXml = classLoader.getResource("data/dup-resourceadapter-name.xml");
+//        File resourcePlan = new File(basedir, "src/test-data/data/dup-resourceadapter-name.xml");
+//        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
@@ -67,10 +72,11 @@
     }
 
     public void testConnectionFactoryNameUniqueness() throws Exception {
-        File resourcePlan = new File(basedir, "src/test-data/data/dup-connectionfactoryinstance-name.xml");
-        assertTrue(resourcePlan.exists());
+        URL srcXml = classLoader.getResource("data/dup-connectionfactoryinstance-name.xml");
+//        File resourcePlan = new File(basedir, "src/test-data/data/dup-connectionfactoryinstance-name.xml");
+//        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
@@ -84,10 +90,11 @@
     }
 
     public void testAdminObjectNameUniqueness() throws Exception {
-        File resourcePlan = new File(basedir, "src/test-data/data/dup-admin-object-name.xml");
-        assertTrue(resourcePlan.exists());
+        URL srcXml = classLoader.getResource("data/dup-admin-object-name.xml");
+//        File resourcePlan = new File(basedir, "src/test-data/data/dup-admin-object-name.xml");
+//        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;
@@ -101,10 +108,11 @@
     }
 
     public void testRectifyPlan() throws Exception {
-        File resourcePlan = new File(basedir, "src/test-data/data/old-schema-plan.xml");
-        assertTrue(resourcePlan.exists());
+        URL srcXml = classLoader.getResource("data/old-schema-plan.xml");
+//        File resourcePlan = new File(basedir, "src/test-data/data/old-schema-plan.xml");
+//        assertTrue(resourcePlan.exists());
 
-        XmlObject plan = XmlBeansUtil.parse(resourcePlan.toURL());
+        XmlObject plan = XmlBeansUtil.parse(srcXml);
         GerConnectorDocument doc = (GerConnectorDocument) plan.changeType(GerConnectorDocument.type);
         if (doc == null) {
             doc = (GerConnectorDocument) plan;

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -40,31 +40,21 @@
     }
 
     public String[] getConnectionFactories() {
-        Collection copy;
-        synchronized(connectionFactories) {
-            copy = new ArrayList(connectionFactories);
-        }
-        String[] result = new String[copy.size()];
-        int i = 0;
-        for (Iterator iterator = copy.iterator(); iterator.hasNext();) {
+        ArrayList temp = new ArrayList();
+        for (Iterator iterator = connectionFactories.iterator(); iterator.hasNext();) {
             JCAConnectionFactoryImpl jcaConnectionFactory = (JCAConnectionFactoryImpl) iterator.next();
-            result[i++] = jcaConnectionFactory.getObjectName();
+            temp.add(jcaConnectionFactory.getObjectName());
         }
-        return result;
+        return (String[])temp.toArray(new String[temp.size()]);
     }
 
     public String[] getResourceAdapterInstances() {
-        Collection copy;
-        synchronized(resourceAdapters) {
-            copy = new ArrayList(resourceAdapters);
-        }
-        String[] result = new String[copy.size()];
-        int i = 0;
-        for (Iterator iterator = copy.iterator(); iterator.hasNext();) {
+        ArrayList temp = new ArrayList();
+        for (Iterator iterator = resourceAdapters.iterator(); iterator.hasNext();) {
             JCAResourceAdapter resourceAdapter = (JCAResourceAdapter) iterator.next();
-            result[i++] = resourceAdapter.getObjectName();
+            temp.add(resourceAdapter.getObjectName());
         }
-        return result;
+        return (String[])temp.toArray(new String[temp.size()]);
     }
 
     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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -23,6 +23,7 @@
 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.JCAConnectionFactory;
 
 public class JCAResourceImplGBean {
 
@@ -31,7 +32,7 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(JCAResourceImplGBean.class, JCAResourceImpl.class, NameFactory.JCA_RESOURCE);
         infoBuilder.addAttribute("objectName", String.class, false);
-        infoBuilder.addReference("ConnectionFactories", JCAConnectionFactoryImpl.class, NameFactory.JCA_CONNECTION_FACTORY);
+        infoBuilder.addReference("ConnectionFactories", JCAConnectionFactory.class, NameFactory.JCA_CONNECTION_FACTORY);
         infoBuilder.addReference("ResourceAdapters", JCAResourceAdapter.class, NameFactory.JCA_RESOURCE_ADAPTER);
         infoBuilder.addInterface(JCAResource.class);
 

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -17,15 +17,16 @@
 package org.apache.geronimo.connector;
 
 import org.apache.geronimo.management.ResourceAdapter;
+import org.apache.geronimo.management.geronimo.JCAResource;
 
 /**
  * @version $Rev$ $Date$
  */
 public class ResourceAdapterImpl implements ResourceAdapter {
     private final String objectName;
-    private final JCAResourceImpl jcaResource;
+    private final JCAResource jcaResource;
 
-    public ResourceAdapterImpl(String objectName, JCAResourceImpl jcaResource) {
+    public ResourceAdapterImpl(String objectName, JCAResource jcaResource) {
         this.objectName = objectName;
         this.jcaResource = jcaResource;
     }

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -21,6 +21,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.ResourceAdapter;
+import org.apache.geronimo.management.geronimo.JCAResource;
 
 public class ResourceAdapterImplGBean {
 
@@ -29,13 +30,13 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceAdapterImplGBean.class, ResourceAdapterImpl.class, NameFactory.RESOURCE_ADAPTER);
         infoBuilder.addAttribute("objectName", String.class, false);
-        infoBuilder.addReference("JCAResourceImpl", JCAResourceImpl.class, NameFactory.JCA_RESOURCE);
-        infoBuilder.addAttribute("JCAResource", String.class, false);
+        infoBuilder.addReference("JCAResource", JCAResource.class, NameFactory.JCA_RESOURCE);
+        infoBuilder.addAttribute("JCAResources", String[].class, false);
         infoBuilder.addInterface(ResourceAdapter.class);
 
         infoBuilder.setConstructor(new String[]{
             "objectName",
-            "JCAResourceImpl"
+            "JCAResource"
         });
 
         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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -24,6 +24,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 import org.apache.geronimo.j2ee.management.impl.InvalidObjectNameException;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
@@ -35,7 +36,7 @@
     private final J2EEServer server;
     private final J2EEApplication application;
     private final String deploymentDescriptor;
-    private final ResourceAdapterImpl resourceAdapter;
+    private final ResourceAdapter resourceAdapter;
 
     private final GBeanData resourceAdapterGBeanData;
     private final Map activationSpecInfoMap;
@@ -49,7 +50,7 @@
     private final String eisType;
 
     public ResourceAdapterModuleImpl(String objectName,
-                                     ResourceAdapterImpl resourceAdapter,
+                                     ResourceAdapter resourceAdapter,
                                      J2EEServer server,
                                      J2EEApplication application,
                                      String deploymentDescriptor,

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -25,6 +25,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.J2EEApplication;
 import org.apache.geronimo.management.J2EEServer;
+import org.apache.geronimo.management.ResourceAdapter;
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
@@ -41,7 +42,7 @@
 
         infoBuilder.addAttribute("deploymentDescriptor", String.class, true);
 
-        infoBuilder.addReference("ResourceAdapter", ResourceAdapterImpl.class, NameFactory.RESOURCE_ADAPTER);
+        infoBuilder.addReference("ResourceAdapter", ResourceAdapter.class, NameFactory.RESOURCE_ADAPTER);
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addAttribute("server", String.class, false);
         infoBuilder.addAttribute("application", String.class, false);

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=386505&r1=386504&r2=386505&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 Thu Mar 16 18:21:37 2006
@@ -38,7 +38,7 @@
         infoFactory.addReference("JCAManagedConnectionFactory", JCAManagedConnectionFactory.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         infoFactory.addInterface(JCAConnectionFactory.class);
 
-        infoFactory.setConstructor(new String[]{"objectName", "managedConnectionFactory"});
+        infoFactory.setConstructor(new String[]{"objectName", "JCAManagedConnectionFactory"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java (original)
+++ geronimo/branches/1.1/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java Thu Mar 16 18:21:37 2006
@@ -46,7 +46,7 @@
 
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(GeronimoWorkManagerGBean.class, NameFactory.JCA_WORK_MANAGER);
-        infoFactory.addInterface(WorkManager.class);
+        infoFactory.addInterface(GeronimoWorkManager.class);
 
         infoFactory.addAttribute("syncMaximumPoolSize", Integer.TYPE, true);
         infoFactory.addAttribute("startMaximumPoolSize", Integer.TYPE, true);

Modified: geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java (original)
+++ geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java Thu Mar 16 18:21:37 2006
@@ -23,7 +23,6 @@
 import java.io.ObjectOutputStream;
 import java.util.Map;
 import java.util.HashMap;
-import javax.management.ObjectName;
 import javax.management.MalformedObjectNameException;
 
 import junit.framework.TestCase;
@@ -129,7 +128,7 @@
     private AbstractName buildAbstractName(String key, String value, GBeanInfo info, String type, J2eeContext j2eeContext) throws MalformedObjectNameException {
         Map names = new HashMap();
         names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), NameFactory.getComponentName(null, null, null, type, null, null, value, j2eeContext));
+        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, NameFactory.getComponentName(null, null, null, type, null, null, value, j2eeContext));
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java (original)
+++ geronimo/branches/1.1/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java Thu Mar 16 18:21:37 2006
@@ -149,7 +149,7 @@
     private AbstractName buildAbstractName(String key, String value, GBeanInfo info, String type, J2eeContext j2eeContext) throws MalformedObjectNameException {
         Map names = new HashMap();
         names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), NameFactory.getComponentName(null, null, null, type, null, null, value, j2eeContext));
+        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, NameFactory.getComponentName(null, null, null, type, null, null, value, j2eeContext));
     }
 
 

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java?rev=386505&r1=386504&r2=386505&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/GBeanDataRegistry.java Thu Mar 16 18:21:37 2006
@@ -63,9 +63,10 @@
         Set result = new HashSet();
         for (Iterator i = registry.entrySet().iterator(); i.hasNext();) {
             Map.Entry entry = (Map.Entry) i.next();
-            AbstractName name = (AbstractName) entry.getKey();
-            if (query == null || query.matches(name)) {
-                result.add(name);
+            AbstractName abstractName = (AbstractName) entry.getKey();
+            GBeanData gbeanData = (GBeanData) entry.getValue();
+            if (query == null || query.matches(abstractName, gbeanData.getGBeanInfo().getInterfaces())) {
+                result.add(abstractName);
             }
         }
         return result;



Mime
View raw message