geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r926678 - in /geronimo/server/trunk: framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/ framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/ plugins/active...
Date Tue, 23 Mar 2010 17:35:48 GMT
Author: djencks
Date: Tue Mar 23 17:35:47 2010
New Revision: 926678

URL: http://svn.apache.org/viewvc?rev=926678&view=rev
Log:
GERONIMO-434, GERONIMO-4360 runtime TransactionSupport support, which requires reversing the connection manager to mcf dependency.  This allows extracting the connection factor from the jsr-77 connection factory object

Removed:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBeanSerializationTest.java
Modified:
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
    geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/SQLLoginModule.java
    geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/helper/JMSMessageHelper.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperGBean.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/security/PasswordCredentialLoginModuleWrapper.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperTest.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java

Modified: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java Tue Mar 23 17:35:47 2010
@@ -21,5 +21,11 @@ package org.apache.geronimo.management.g
  * @version $Rev$ $Date$
  */
 public interface JCAConnectionFactory extends org.apache.geronimo.management.JCAConnectionFactory {
+
     JCAManagedConnectionFactory getManagedConnectionFactoryInstance();
+
+    Object getConnectionManager();
+
+    Object createConnectionFactory() throws Exception;
+
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-management/src/main/java/org/apache/geronimo/management/geronimo/JCAManagedConnectionFactory.java Tue Mar 23 17:35:47 2010
@@ -47,14 +47,4 @@ public interface JCAManagedConnectionFac
 
     public Object getConfigProperty(String property) throws Exception;
 
-    /**
-     * Gets the ConnectionManager associated with this managed
-     * connection factory.  This object should implement
-     * javax.resource.spi.ConnectionManager and
-     * org.apache.geronimo.connector.outbound.PoolingAttributes
-     * @return ConnectionManager and PoolingAttributes implementation
-     */
-    public Object getConnectionManagerContainer();
-    
-    public Object getConnectionFactory() throws Exception;
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/SQLLoginModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/SQLLoginModule.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/SQLLoginModule.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/realm/providers/SQLLoginModule.java Tue Mar 23 17:35:47 2010
@@ -28,6 +28,7 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -45,6 +46,7 @@ import javax.security.auth.login.LoginEx
 import javax.security.auth.spi.LoginModule;
 import javax.sql.DataSource;
 
+import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.gbean.AbstractName;
@@ -101,7 +103,7 @@ public class SQLLoginModule implements L
     private String connectionURL;
     private Properties properties;
     private Driver driver;
-    private JCAManagedConnectionFactory factory;
+    private DataSource dataSource;
     private String userSelect;
     private String groupSelect;
     private String digest;
@@ -155,21 +157,21 @@ public class SQLLoginModule implements L
             }
             String kernelName = (String) options.get(JaasLoginModuleUse.KERNEL_NAME_LM_OPTION);
             Kernel kernel = KernelRegistry.getKernel(kernelName);
-            Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(JCAManagedConnectionFactory.class.getName()));
-            JCAManagedConnectionFactory factory;
+            Map<String, String> nameMap = new HashMap<String, String>();
+            nameMap.put("name", dataSourceName);
+            nameMap.put("J2EEApplication", dataSourceAppName);
+            nameMap.put("j2eeType", "JCAConnectionManager");
+            Set<AbstractName> set = kernel.listGBeans(new AbstractNameQuery(null, nameMap));
             for (AbstractName name : set) {
-                if (name.getName().get("J2EEApplication").equals(dataSourceAppName) &&
-                        name.getName().get("name").equals(dataSourceName)) {
-                    try {
-                        factory = (JCAManagedConnectionFactory) kernel.getGBean(name);
-                        String type = factory.getConnectionFactoryInterface();
-                        if (type.equals(DataSource.class.getName())) {
-                            this.factory = factory;
-                            break;
-                        }
-                    } catch (GBeanNotFoundException e) {
-                        // ignore... GBean was unregistered
-                    }
+                try {
+                    dataSource = (DataSource) kernel.invoke(name, "createConnectionFactory");
+                    break;
+                } catch (GBeanNotFoundException e) {
+                    // ignore... GBean was unregistered
+                } catch (NoSuchOperationException e) {
+
+                } catch (Exception e) {
+
                 }
             }
         } else {
@@ -224,9 +226,8 @@ public class SQLLoginModule implements L
 
         try {
             Connection conn;
-            if (factory != null) {
-                DataSource ds = (DataSource) factory.getConnectionFactory();
-                conn = ds.getConnection();
+            if (dataSource != null) {
+                conn = dataSource.getConnection();
             } else {
                 conn = driver.connect(connectionURL, properties);
             }

Modified: geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/helper/JMSMessageHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/helper/JMSMessageHelper.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/helper/JMSMessageHelper.java (original)
+++ geronimo/server/trunk/plugins/activemq/activemq-portlets/src/main/java/org/apache/geronimo/console/jmsmanager/helper/JMSMessageHelper.java Tue Mar 23 17:35:47 2010
@@ -46,9 +46,7 @@ import org.apache.geronimo.j2ee.j2eeobje
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
-import org.apache.geronimo.management.geronimo.JCAAdminObject;
-import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
-import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
+import org.apache.geronimo.management.geronimo.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -113,14 +111,26 @@ public abstract class JMSMessageHelper {
     }
 
     protected ConnectionFactory getConnectionFactory(PortletRequest portletRequest, JMSDestinationInfo destinationInfo) throws JMSException {
-        JCAManagedConnectionFactory[] jcaManagedConnectionFactories = PortletManager.getOutboundFactoriesForRA(portletRequest, destinationInfo.getResourceAdapterModuleAbName(), destinationInfo
-                .getType().getConnectionFactoryInterfaces());
-        if (jcaManagedConnectionFactories != null && jcaManagedConnectionFactories.length > 0) {
-            try {
-                return (ConnectionFactory) (jcaManagedConnectionFactories[0].getConnectionFactory());
-            } catch (Exception e) {
+        ResourceAdapterModule module = (ResourceAdapterModule) PortletManager.getManagedBean(portletRequest, destinationInfo.getResourceAdapterModuleAbName());
+        for (ResourceAdapter adapter: module.getResourceAdapterInstances()) {
+            for (JCAResource resource: adapter.getJCAResourceImplementations()) {
+                for (JCAConnectionFactory jcacf: resource.getConnectionFactoryInstances()) {
+                    try {
+                        return (ConnectionFactory) jcacf.createConnectionFactory();
+                    } catch (Exception e) {
+                        //try another
+                    }
+                }
             }
         }
+//        JCAManagedConnectionFactory[] jcaManagedConnectionFactories = PortletManager.getOutboundFactoriesForRA(portletRequest, destinationInfo.getResourceAdapterModuleAbName(), destinationInfo
+//                .getType().getConnectionFactoryInterfaces());
+//        if (jcaManagedConnectionFactories != null && jcaManagedConnectionFactories.length > 0) {
+//            try {
+//                return (ConnectionFactory) (jcaManagedConnectionFactories[0].getConnectionFactory());
+//            } catch (Exception e) {
+//            }
+//        }
         return null;
     }
 

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/GenericConnectionManagerGBean.java Tue Mar 23 17:35:47 2010
@@ -24,6 +24,7 @@ import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
 import java.io.Serializable;
 
+import javax.resource.ResourceException;
 import javax.resource.spi.ConnectionManager;
 import javax.security.auth.Subject;
 import org.apache.geronimo.connector.outbound.GenericConnectionManager;
@@ -46,6 +47,7 @@ import org.apache.geronimo.kernel.GBeanN
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
+import org.apache.geronimo.naming.ResourceSource;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
 
@@ -64,13 +66,15 @@ public class GenericConnectionManagerGBe
                                          @ParamAttribute(name="containerManagedSecurity")boolean containerManagedSecurity,
                                          @ParamReference(name="ConnectionTracker", namingType = NameFactory.JCA_CONNECTION_TRACKER)ConnectionTracker connectionTracker,
                                          @ParamReference(name="TransactionManager", namingType = NameFactory.JTA_RESOURCE)RecoverableTransactionManager transactionManager,
+                                         @ParamReference(name="ManagedConnectionFactory", namingType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY)ManagedConnectionFactoryWrapper managedConnectionFactoryWrapper,
                                          @ParamSpecial(type= SpecialAttributeType.objectName)String objectName,
                                          @ParamSpecial(type= SpecialAttributeType.abstractName)AbstractName abstractName,
                                          @ParamSpecial(type= SpecialAttributeType.classLoader)ClassLoader classLoader,
                                          @ParamSpecial(type= SpecialAttributeType.kernel)Kernel kernel) {
-        super(transactionSupport, pooling, getSubjectSource(containerManagedSecurity), connectionTracker, transactionManager, objectName, classLoader);
+        super(transactionSupport, pooling, getSubjectSource(containerManagedSecurity), connectionTracker, transactionManager, managedConnectionFactoryWrapper.getManagedConnectionFactory(), objectName, classLoader);
         this.kernel = kernel;
         this.abstractName = abstractName;
+        doRecovery();
     }
 
     public GenericConnectionManagerGBean() {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/JCAConnectionFactoryImpl.java Tue Mar 23 17:35:47 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.connector.wr
 import java.util.Hashtable;
 
 import javax.management.ObjectName;
+import javax.resource.ResourceException;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
@@ -28,48 +29,77 @@ import org.apache.geronimo.j2ee.manageme
 import org.apache.geronimo.kernel.ObjectNameUtil;
 import org.apache.geronimo.management.geronimo.JCAConnectionFactory;
 import org.apache.geronimo.management.geronimo.JCAManagedConnectionFactory;
+import org.apache.geronimo.naming.ResourceSource;
 
 /**
  * @version $Rev$ $Date$
  */
 @GBean(j2eeType = NameFactory.JCA_CONNECTION_FACTORY)
-public class JCAConnectionFactoryImpl implements JCAConnectionFactory {
+public class JCAConnectionFactoryImpl implements JCAConnectionFactory, ResourceSource<ResourceException> {
     private final String objectName;
-    private final JCAManagedConnectionFactory managedConnectionFactory;
+    private final GenericConnectionManagerGBean connectionManager;
 
     public JCAConnectionFactoryImpl(@ParamSpecial(type = SpecialAttributeType.objectName) String objectName,
-                                    @ParamReference(name = "JCAManagedConnectionFactory", namingType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY) JCAManagedConnectionFactory managedConnectionFactory) {
+                                    @ParamReference(name = "ConnectionManager", namingType = NameFactory.JCA_CONNECTION_MANAGER) GenericConnectionManagerGBean connectionManager) {
         ObjectName myObjectName = ObjectNameUtil.getObjectName(objectName);
         verifyObjectName(myObjectName);
 
         this.objectName = objectName;
-        this.managedConnectionFactory = managedConnectionFactory;
+        this.connectionManager = connectionManager;
     }
 
+    @Override
     public String getManagedConnectionFactory() {
-        return managedConnectionFactory.getObjectName();
+        return ((JCAManagedConnectionFactory)connectionManager.getManagedConnectionFactory()).getObjectName();
     }
 
+    @Override
     public JCAManagedConnectionFactory getManagedConnectionFactoryInstance() {
-        return managedConnectionFactory;
+        return ((JCAManagedConnectionFactory)connectionManager.getManagedConnectionFactory());
     }
 
+    @Override
     public String getObjectName() {
         return objectName;
     }
 
+    @Override
     public boolean isStateManageable() {
         return false;
     }
 
+    @Override
     public boolean isStatisticsProvider() {
         return false;
     }
 
+    @Override
     public boolean isEventProvider() {
         return false;
     }
 
+    @Override
+    public Object getConnectionManager() {
+        return connectionManager;
+    }
+
+    @Override
+    public Object createConnectionFactory() throws Exception {
+        return connectionManager.createConnectionFactory();
+    }
+
+    @Override
+    public Object $getResource() throws ResourceException {
+        try {
+            return createConnectionFactory();
+        } catch (ResourceException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new ResourceException("Should not happen", e);
+        }
+    }
+
+
     /**
      * ObjectName must match this pattern:
      * <p/>
@@ -96,4 +126,5 @@ public class JCAConnectionFactoryImpl im
 //            throw new InvalidObjectNameException("JCAConnectionFactory object name can only have j2eeType, name, JCAResource, and J2EEServer properties", objectName);
 //        }
     }
+
 }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java Tue Mar 23 17:35:47 2010
@@ -41,7 +41,7 @@ import org.apache.geronimo.management.ge
 /**
  * @version $Rev$ $Date$
  */
-public class ManagedConnectionFactoryWrapper implements GBeanLifecycle, DynamicGBean, JCAManagedConnectionFactory, ResourceSource<ResourceException> {
+public class ManagedConnectionFactoryWrapper implements GBeanLifecycle, DynamicGBean, JCAManagedConnectionFactory {
 
     private static final Logger log = LoggerFactory.getLogger(ManagedConnectionFactoryWrapper.class);
 
@@ -55,7 +55,6 @@ public class ManagedConnectionFactoryWra
     private final LinkedHashSet<Class> allImplementedInterfaces = new LinkedHashSet<Class>();
 
     private final ResourceAdapterWrapper resourceAdapterWrapper;
-    private final ConnectionManagerContainer connectionManagerContainer;
 
     private ManagedConnectionFactory managedConnectionFactory;
 
@@ -80,7 +79,6 @@ public class ManagedConnectionFactoryWra
         objectName = null;
         classLoader = null;
         resourceAdapterWrapper = null;
-        connectionManagerContainer = null;
     }
 
     public ManagedConnectionFactoryWrapper(String managedConnectionFactoryClass,
@@ -90,7 +88,6 @@ public class ManagedConnectionFactoryWra
                                            String connectionInterface,
                                            String connectionImplClass,
                                            ResourceAdapterWrapper resourceAdapterWrapper,
-                                           ConnectionManagerContainer connectionManagerContainer,
                                            Kernel kernel,
                                            AbstractName abstractName,
                                            String objectName,
@@ -108,7 +105,6 @@ public class ManagedConnectionFactoryWra
         }
 
         this.resourceAdapterWrapper = resourceAdapterWrapper;
-        this.connectionManagerContainer = connectionManagerContainer;
 
         //set up that must be done before start
         classLoader = cl;
@@ -149,10 +145,6 @@ public class ManagedConnectionFactoryWra
         return resourceAdapterWrapper;
     }
 
-    public Object getConnectionManagerContainer() {
-        return connectionManagerContainer;
-    }
-
     public void doStart() throws Exception {
         //register with resource adapter
         if (managedConnectionFactory instanceof ResourceAdapterAssociation) {
@@ -162,7 +154,10 @@ public class ManagedConnectionFactoryWra
             resourceAdapterWrapper.registerResourceAdapterAssociation((ResourceAdapterAssociation) managedConnectionFactory);
             log.debug("Registered managedConnectionFactory with ResourceAdapter " + resourceAdapterWrapper.toString());
         }
-        connectionManagerContainer.doRecovery(managedConnectionFactory);
+    }
+
+    public ManagedConnectionFactory getManagedConnectionFactory() {
+        return managedConnectionFactory;
     }
 
     public void doStop() {
@@ -200,28 +195,6 @@ public class ManagedConnectionFactoryWra
         return null;
     }
 
-    public Object getConnectionFactory() throws ResourceException {
-        return $getConnectionFactory();
-    }
-
-    public Object $getResource() throws ResourceException {
-        return $getConnectionFactory();
-    }
-
-    public Object $getConnectionFactory() throws ResourceException {
-        Object connectionFactory =  connectionManagerContainer.createConnectionFactory(managedConnectionFactory);
-        for (Class intf: allImplementedInterfaces) {
-            if (!intf.isAssignableFrom(connectionFactory.getClass())) {
-                throw new ResourceException("ConnectionFactory does not implement expected interface: " + intf.getName());
-            }
-        }
-        return connectionFactory;
-    }
-
-    public ManagedConnectionFactory $getManagedConnectionFactory() {
-        return managedConnectionFactory;
-    }
-
     /**
      * Gets the config properties in the form of a map where the key is the
      * property name and the value is property type (as a Class).

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperGBean.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperGBean.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperGBean.java Tue Mar 23 17:35:47 2010
@@ -47,7 +47,6 @@ public class ManagedConnectionFactoryWra
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
 
         infoFactory.addReference("ResourceAdapterWrapper", ResourceAdapterWrapper.class, NameFactory.RESOURCE_ADAPTER);
-        infoFactory.addReference("ConnectionManagerContainer", ConnectionManagerContainer.class, NameFactory.JCA_CONNECTION_MANAGER);
 
         infoFactory.setConstructor(new String[]{
             "managedConnectionFactoryClass",
@@ -57,7 +56,6 @@ public class ManagedConnectionFactoryWra
             "connectionInterface",
             "connectionImplClass",
             "ResourceAdapterWrapper",
-            "ConnectionManagerContainer",
             "kernel",
             "abstractName",
             "objectName",

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/security/PasswordCredentialLoginModuleWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/security/PasswordCredentialLoginModuleWrapper.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/security/PasswordCredentialLoginModuleWrapper.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/security/PasswordCredentialLoginModuleWrapper.java Tue Mar 23 17:35:47 2010
@@ -52,7 +52,7 @@ public class PasswordCredentialLoginModu
         if (options == null) {
             options = new HashMap<String, Object>();
         }
-        ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.$getManagedConnectionFactory();
+        ManagedConnectionFactory managedConnectionFactory = managedConnectionFactoryWrapper.getManagedConnectionFactory();
         options.put(MANAGED_CONNECTION_FACTORY_OPTION, managedConnectionFactory);
         return options;
     }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperTest.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperTest.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/test/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapperTest.java Tue Mar 23 17:35:47 2010
@@ -22,6 +22,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
 import javax.resource.cci.Connection;
@@ -34,6 +35,7 @@ import org.apache.geronimo.connector.moc
 import org.apache.geronimo.connector.mock.MockManagedConnectionFactory;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoPool;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.NoTransactions;
+import org.apache.geronimo.connector.outbound.connectionmanagerconfig.SinglePool;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
 import org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor;
 import org.apache.geronimo.connector.outbound.ConnectionInfo;
@@ -46,6 +48,7 @@ import org.apache.geronimo.gbean.GBeanIn
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.basic.BasicKernel;
 import org.apache.geronimo.kernel.osgi.MockBundleContext;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.osgi.framework.BundleContext;
@@ -59,9 +62,10 @@ public class ManagedConnectionFactoryWra
     private AbstractName managedConnectionFactoryName;
     private static final String KERNEL_NAME = "testKernel";
     private static final String TARGET_NAME = "testCFName";
+    private AbstractName connectionManagerName;
 
     public void testProxy() throws Exception {
-        Object proxy = kernel.invoke(managedConnectionFactoryName, "$getResource");
+        Object proxy = kernel.invoke(connectionManagerName, "createConnectionFactory");
         assertNotNull(proxy);
         assertTrue(proxy instanceof ConnectionFactory);
         Connection connection = ((ConnectionFactory) proxy).getConnection();
@@ -81,7 +85,7 @@ public class ManagedConnectionFactoryWra
     }
 
     public void XtestSerialization() throws Exception {
-        ConnectionFactory proxy = (ConnectionFactory) kernel.invoke(managedConnectionFactoryName, "$getResource");
+        ConnectionFactory proxy = (ConnectionFactory) kernel.invoke(connectionManagerName, "$getResource");
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
         oos.writeObject(proxy);
@@ -107,6 +111,20 @@ public class ManagedConnectionFactoryWra
 
     }
 
+    public void testConnectionManagerSerialization() throws Exception {
+        Object cm = kernel.getGBean(connectionManagerName);
+        assertTrue(cm instanceof GenericConnectionManagerGBean);
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream out = new ObjectOutputStream(baos);
+        out.writeObject(cm);
+        out.flush();
+        byte[] bytes = baos.toByteArray();
+        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+        ObjectInputStream in = new ObjectInputStream(bais);
+        Object cm2 = in.readObject();
+        assertSame(cm, cm2);
+    }
+
     protected void setUp() throws Exception {
         super.setUp();
         BundleContext bundleContext = new MockBundleContext(getClass().getClassLoader(), "", null, null);
@@ -118,12 +136,6 @@ public class ManagedConnectionFactoryWra
         AbstractName ctcName = ctc.getAbstractName();
         kernel.loadGBean(ctc, bundleContext);
 
-        GBeanData cmf = buildGBeanData("name", "ConnectionManagerContainer", GenericConnectionManagerGBean.class);
-        AbstractName cmfName = cmf.getAbstractName();
-        cmf.setAttribute("transactionSupport", NoTransactions.INSTANCE);
-        cmf.setAttribute("pooling", new NoPool());
-        cmf.setReferencePattern("ConnectionTracker", ctcName);
-        kernel.loadGBean(cmf, bundleContext);
 
 
         GBeanData mcfw = buildGBeanData("name", TARGET_NAME, ManagedConnectionFactoryWrapperGBean.class);
@@ -135,12 +147,20 @@ public class ManagedConnectionFactoryWra
         mcfw.setAttribute("connectionInterface", Connection.class.getName());
         mcfw.setAttribute("connectionImplClass", MockConnection.class.getName());
         //"ResourceAdapterWrapper",
-        mcfw.setReferencePattern("ConnectionManagerContainer", cmfName);
+//        mcfw.setReferencePattern("ConnectionManagerContainer", cmfName);
         //"ManagedConnectionFactoryListener",
         kernel.loadGBean(mcfw, bundleContext);
 
+        GBeanData cmf = buildGBeanData("name", "ConnectionManagerContainer", GenericConnectionManagerGBean.class);
+        connectionManagerName = cmf.getAbstractName();
+        cmf.setAttribute("transactionSupport", NoTransactions.INSTANCE);
+        cmf.setAttribute("pooling", new NoPool());
+        cmf.setReferencePattern("ConnectionTracker", ctcName);
+        cmf.setReferencePattern("ManagedConnectionFactory", managedConnectionFactoryName);
+        kernel.loadGBean(cmf, bundleContext);
+
         kernel.startGBean(ctcName);
-        kernel.startGBean(cmfName);
+        kernel.startGBean(connectionManagerName);
         kernel.startGBean(managedConnectionFactoryName);
     }
     private GBeanData buildGBeanData(String key, String value, Class info) {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Tue Mar 23 17:35:47 2010
@@ -69,6 +69,7 @@ import org.apache.geronimo.connector.wra
 import org.apache.geronimo.connector.wrapper.ResourceAdapterImplGBean;
 import org.apache.geronimo.connector.wrapper.ResourceAdapterModuleImplGBean;
 import org.apache.geronimo.connector.wrapper.ResourceAdapterWrapperGBean;
+import org.apache.geronimo.connector.wrapper.outbound.GenericConnectionManagerGBean;
 import org.apache.geronimo.connector.wrapper.outbound.JCAConnectionFactoryImpl;
 import org.apache.geronimo.connector.wrapper.outbound.ManagedConnectionFactoryWrapper;
 import org.apache.geronimo.connector.wrapper.outbound.ManagedConnectionFactoryWrapperGBean;
@@ -517,81 +518,86 @@ public class ConnectorModuleBuilder impl
                 }
             }      
         }
-        if (raClass != null/*and not metadata complete */) {
-            //TODO configproperties
-        }
-
-        //inbound
-        log.info("connector of type: " + connector);
-        InboundResource inboundResource = connector.getResourceAdapter().getInboundResourceAdapter();
-        if (inboundResource == null) {
-            inboundResource = new InboundResource();
-            inboundResource.setMessageAdapter(new MessageAdapter());
-        }
-        MessageAdapter messageAdapter = inboundResource.getMessageAdapter();
-        List<Class> activationSpecClasses = classFinder.findAnnotatedClasses(Activation.class);
-
-        for (Class<?> asClass: activationSpecClasses) {
-            Activation activation = asClass.getAnnotation(Activation.class);
-            for (Class messageListenerClass: activation.messageListeners()) {
-                MessageListener messageListener = new MessageListener();
-                messageListener.setMessageListenerType(messageListenerClass.getName());
-                ActivationSpec activationSpec = new ActivationSpec();
-                activationSpec.setActivationSpecClass(asClass.getName());
-                //TODO set required config properties from @NotNull annotations
-                messageListener.setActivationSpec(activationSpec);
-                messageAdapter.getMessageListener().add(messageListener);
+        if (connector.isMetadataComplete() != null && connector.isMetadataComplete()) {
+            log.info("Connector is metadata complete");
+        } else {
+            log.info("Reading connector annotations");
+            if (raClass != null/*and not metadata complete */) {
                 //TODO configproperties
             }
-        }
-        if (connector.getResourceAdapter().getInboundResourceAdapter() == null && inboundResource.getMessageAdapter().getMessageListener().size() > 0) {
-            connector.getResourceAdapter().setInboundResourceAdapter(inboundResource);
-        }
 
-        //admin objects
-        for (Class adminObjectClass: classFinder.findAnnotatedClasses(AdministeredObject.class)) {
-            AdministeredObject administeredObject = (AdministeredObject) adminObjectClass.getAnnotation(AdministeredObject.class);
-            Class[] interfaces = administeredObject.adminObjectInterfaces();
-            if (interfaces == null || interfaces.length == 0) {
-                List<Class> allInterfaces = new ArrayList<Class>(Arrays.asList(adminObjectClass.getInterfaces()));
-                allInterfaces.remove(Serializable.class);
-                allInterfaces.remove(Externalizable.class);
-                //TODO check if specified in ra.xml
-                if (allInterfaces.size() != 1) {
-                    throw new DeploymentException("Interface for admin object not specified properly: " + allInterfaces);
+            //inbound
+            log.info("connector of type: " + connector);
+            InboundResource inboundResource = connector.getResourceAdapter().getInboundResourceAdapter();
+            if (inboundResource == null) {
+                inboundResource = new InboundResource();
+                inboundResource.setMessageAdapter(new MessageAdapter());
+            }
+            MessageAdapter messageAdapter = inboundResource.getMessageAdapter();
+            List<Class> activationSpecClasses = classFinder.findAnnotatedClasses(Activation.class);
+
+            for (Class<?> asClass: activationSpecClasses) {
+                Activation activation = asClass.getAnnotation(Activation.class);
+                for (Class messageListenerClass: activation.messageListeners()) {
+                    MessageListener messageListener = new MessageListener();
+                    messageListener.setMessageListenerType(messageListenerClass.getName());
+                    ActivationSpec activationSpec = new ActivationSpec();
+                    activationSpec.setActivationSpecClass(asClass.getName());
+                    //TODO set required config properties from @NotNull annotations
+                    messageListener.setActivationSpec(activationSpec);
+                    messageAdapter.getMessageListener().add(messageListener);
+                    //TODO configproperties
                 }
-                interfaces = allInterfaces.toArray(new Class[1]);
             }
-            for (Class aoInterface: interfaces) {
-                AdminObject adminObject = new AdminObject();
-                adminObject.setAdminObjectInterface(aoInterface.getName());
-                adminObject.setAdminObjectClass(adminObjectClass.getName());
-                //TODO configproperties
-                adminObject.getConfigProperty();
-                connector.getResourceAdapter().getAdminObject().add(adminObject);
+            if (connector.getResourceAdapter().getInboundResourceAdapter() == null && inboundResource.getMessageAdapter().getMessageListener().size() > 0) {
+                connector.getResourceAdapter().setInboundResourceAdapter(inboundResource);
             }
-        }
 
-        OutboundResourceAdapter outboundResourceAdapter = connector.getResourceAdapter().getOutboundResourceAdapter();
-        if (outboundResourceAdapter == null) {
-            outboundResourceAdapter = new OutboundResourceAdapter();
-        }
+            //admin objects
+            for (Class adminObjectClass: classFinder.findAnnotatedClasses(AdministeredObject.class)) {
+                AdministeredObject administeredObject = (AdministeredObject) adminObjectClass.getAnnotation(AdministeredObject.class);
+                Class[] interfaces = administeredObject.adminObjectInterfaces();
+                if (interfaces == null || interfaces.length == 0) {
+                    List<Class> allInterfaces = new ArrayList<Class>(Arrays.asList(adminObjectClass.getInterfaces()));
+                    allInterfaces.remove(Serializable.class);
+                    allInterfaces.remove(Externalizable.class);
+                    //TODO check if specified in ra.xml
+                    if (allInterfaces.size() != 1) {
+                        throw new DeploymentException("Interface for admin object not specified properly: " + allInterfaces);
+                    }
+                    interfaces = allInterfaces.toArray(new Class[1]);
+                }
+                for (Class aoInterface: interfaces) {
+                    AdminObject adminObject = new AdminObject();
+                    adminObject.setAdminObjectInterface(aoInterface.getName());
+                    adminObject.setAdminObjectClass(adminObjectClass.getName());
+                    //TODO configproperties
+                    adminObject.getConfigProperty();
+                    connector.getResourceAdapter().getAdminObject().add(adminObject);
+                }
+            }
 
-        //outbound
-        for (Class<? extends ManagedConnectionFactory> mcfClass: classFinder.findAnnotatedClasses(javax.resource.spi.ConnectionDefinition.class)) {
-            javax.resource.spi.ConnectionDefinition connectionDefinitionAnnotation = mcfClass.getAnnotation(javax.resource.spi.ConnectionDefinition.class);
-            ConnectionDefinition connectionDefinition = buildConnectionDefinition(mcfClass, connectionDefinitionAnnotation);
-            outboundResourceAdapter.getConnectionDefinition().add(connectionDefinition);
-        }
-        for (Class<? extends ManagedConnectionFactory> mcfClass: classFinder.findAnnotatedClasses(ConnectionDefinitions.class)) {
-            ConnectionDefinitions connectionDefinitionAnnotations = mcfClass.getAnnotation(ConnectionDefinitions.class);
-            for (javax.resource.spi.ConnectionDefinition connectionDefinitionAnnotation: connectionDefinitionAnnotations.value()) {
+            OutboundResourceAdapter outboundResourceAdapter = connector.getResourceAdapter().getOutboundResourceAdapter();
+            if (outboundResourceAdapter == null) {
+                outboundResourceAdapter = new OutboundResourceAdapter();
+            }
+
+            //outbound
+            for (Class<? extends ManagedConnectionFactory> mcfClass: classFinder.findAnnotatedClasses(javax.resource.spi.ConnectionDefinition.class)) {
+                javax.resource.spi.ConnectionDefinition connectionDefinitionAnnotation = mcfClass.getAnnotation(javax.resource.spi.ConnectionDefinition.class);
                 ConnectionDefinition connectionDefinition = buildConnectionDefinition(mcfClass, connectionDefinitionAnnotation);
                 outboundResourceAdapter.getConnectionDefinition().add(connectionDefinition);
             }
-        }
-        if (outboundResourceAdapter.getConnectionDefinition().size() >0) {
-            connector.getResourceAdapter().setOutboundResourceAdapter(outboundResourceAdapter);
+            for (Class<? extends ManagedConnectionFactory> mcfClass: classFinder.findAnnotatedClasses(ConnectionDefinitions.class)) {
+                ConnectionDefinitions connectionDefinitionAnnotations = mcfClass.getAnnotation(ConnectionDefinitions.class);
+                for (javax.resource.spi.ConnectionDefinition connectionDefinitionAnnotation: connectionDefinitionAnnotations.value()) {
+                    ConnectionDefinition connectionDefinition = buildConnectionDefinition(mcfClass, connectionDefinitionAnnotation);
+                    outboundResourceAdapter.getConnectionDefinition().add(connectionDefinition);
+                }
+            }
+            if (outboundResourceAdapter.getConnectionDefinition().size() >0) {
+                connector.getResourceAdapter().setOutboundResourceAdapter(outboundResourceAdapter);
+            }
         }
 
 
@@ -1025,7 +1031,7 @@ public class ConnectorModuleBuilder impl
         return editor.getValue();
     }
 
-    private AbstractName configureConnectionManager(EARContext earContext, AbstractName jcaResourceName, String ddTransactionSupport, GerConnectiondefinitionInstanceType connectionfactoryInstance, Bundle bundle) throws DeploymentException {
+    private AbstractName configureConnectionManager(EARContext earContext, AbstractName managedConnectionFactoryName, String ddTransactionSupport, GerConnectiondefinitionInstanceType connectionfactoryInstance, Bundle bundle) throws DeploymentException {
 //        if (connectionfactoryInstance.getConnectionmanagerRef() != null) {
         //we don't configure anything, just use the supplied gbean
 //            try {
@@ -1036,16 +1042,10 @@ public class ConnectorModuleBuilder impl
 //        }
 
         // create the object name for our connection manager
-        AbstractName connectionManagerAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectionfactoryInstance.getName().trim(), NameFactory.JCA_CONNECTION_MANAGER);
+        AbstractName connectionManagerAbstractName = earContext.getNaming().createChildName(managedConnectionFactoryName, connectionfactoryInstance.getName().trim(), NameFactory.JCA_CONNECTION_MANAGER);
 
         // create the data holder for our connection manager
-        GBeanInfo gbeanInfo;
-        try {
-            gbeanInfo = GBeanInfo.getGBeanInfo("org.apache.geronimo.connector.wrapper.outbound.GenericConnectionManagerGBean", bundle);
-        } catch (InvalidConfigurationException e) {
-            throw new DeploymentException("Unable to create GMBean", e);
-        }
-        GBeanData connectionManagerGBean = new GBeanData(connectionManagerAbstractName, gbeanInfo);
+        GBeanData connectionManagerGBean = new GBeanData(connectionManagerAbstractName, GenericConnectionManagerGBean.class);
 
         //we configure our connection manager
         GerConnectionmanagerType connectionManager = connectionfactoryInstance.getConnectionmanager();
@@ -1114,6 +1114,7 @@ public class ConnectorModuleBuilder impl
             connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerName());
             connectionManagerGBean.setAttribute("containerManagedSecurity", connectionManager.isSetContainerManagedSecurity());
             connectionManagerGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
+            connectionManagerGBean.setReferencePattern("ManagedConnectionFactory", managedConnectionFactoryName);
         } catch (Exception e) {
             throw new DeploymentException("Problem setting up ConnectionManager named " + connectionfactoryInstance.getName().trim(), e);
         }
@@ -1130,8 +1131,6 @@ public class ConnectorModuleBuilder impl
         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, managedConnectionFactoryAbstractName, transactionSupport, connectiondefinitionInstance, bundle);
 
         // ManagedConnectionFactory
         setDynamicGBeanDataAttributes(managedConnectionFactoryInstanceGBeanData, connectiondefinitionInstance.getConfigPropertySettingArray(), bundle);
@@ -1152,7 +1151,6 @@ public class ConnectorModuleBuilder impl
             if (resourceAdapterAbstractName != null) {
                 managedConnectionFactoryInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper", resourceAdapterAbstractName);
             }
-            managedConnectionFactoryInstanceGBeanData.setReferencePattern("ConnectionManagerContainer", connectionManagerAbstractName);
             //additional interfaces implemented by connection factory
             String[] implementedInterfaces = connectiondefinitionInstance.getImplementedInterfaceArray();
             if (implementedInterfaces != null) {
@@ -1174,10 +1172,12 @@ public class ConnectorModuleBuilder impl
         } catch (GBeanAlreadyExistsException e) {
             throw new DeploymentException("Could not add managed connection factory gbean to context", e);
         }
+        // ConnectionManager
+        AbstractName connectionManagerName = configureConnectionManager(earContext, managedConnectionFactoryAbstractName, transactionSupport, connectiondefinitionInstance, bundle);
 
         // ConnectionFactory
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName, JCAConnectionFactoryImpl.class);
-        connectionFactoryGBeanData.setReferencePattern("JCAManagedConnectionFactory", managedConnectionFactoryAbstractName);
+        connectionFactoryGBeanData.setReferencePattern("ConnectionManager", connectionManagerName);
 
         try {
             earContext.addGBean(connectionFactoryGBeanData);

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Tue Mar 23 17:35:47 2010
@@ -178,7 +178,7 @@ public class ResourceRefBuilder extends 
                 } else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
                     j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
                 } else {
-                    j2eeType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY;
+                    j2eeType = NameFactory.JCA_CONNECTION_FACTORY;
                 }
                 try {
                     AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);

Modified: geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java?rev=926678&r1=926677&r2=926678&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java (original)
+++ geronimo/server/trunk/plugins/openjpa2/geronimo-persistence-jpa20/src/main/java/org/apache/geronimo/persistence/PersistenceUnitGBean.java Tue Mar 23 17:35:47 2010
@@ -406,8 +406,8 @@ public class PersistenceUnitGBean implem
         infoBuilder.addAttribute("validationMode", ValidationMode.class, true, true);
 
         infoBuilder.addReference("TransactionManager", TransactionManagerImpl.class, NameFactory.JTA_RESOURCE);
-        infoBuilder.addReference("JtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
-        infoBuilder.addReference("NonJtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoBuilder.addReference("JtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_CONNECTION_FACTORY);
+        infoBuilder.addReference("NonJtaDataSourceWrapper", ResourceSource.class, NameFactory.JCA_CONNECTION_FACTORY);
         infoBuilder.addReference("EntityManagerRegistry", ExtendedEntityManagerRegistry.class, GBeanInfoBuilder.DEFAULT_J2EE_TYPE);
 
         infoBuilder.setConstructor(new String[] {



Mime
View raw message