geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound ManagedConnectionFactoryWrapper.java
Date Wed, 07 Apr 2004 06:54:57 GMT
djencks     2004/04/06 23:54:57

  Modified:    specs/j2ee-connector/src/java/javax/resource/spi
                        ManagedConnectionFactory.java
               modules/connector/src/java/org/apache/geronimo/connector
                        ResourceAdapterWrapper.java
               modules/connector/src/java/org/apache/geronimo/connector/outbound
                        ManagedConnectionFactoryWrapper.java
  Log:
  Update ManagedConnectionFactory to fr spec
  
  Revision  Changes    Path
  1.5       +2 -6      incubator-geronimo/specs/j2ee-connector/src/java/javax/resource/spi/ManagedConnectionFactory.java
  
  Index: ManagedConnectionFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/specs/j2ee-connector/src/java/javax/resource/spi/ManagedConnectionFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ManagedConnectionFactory.java	10 Mar 2004 09:59:45 -0000	1.4
  +++ ManagedConnectionFactory.java	7 Apr 2004 06:54:57 -0000	1.5
  @@ -36,11 +36,7 @@
    * @version $Revision$ $Date$
    */
   public interface ManagedConnectionFactory extends Serializable {
  -    
  -    public void setResourceAdapter(ResourceAdapter resourceAdapter) throws ResourceException;
  -    
  -    public ResourceAdapter getResourceAdapter();
  -    
  +
       public Object createConnectionFactory(ConnectionManager cxManager) throws ResourceException;
   
       public Object createConnectionFactory() throws ResourceException;
  
  
  
  1.6       +4 -3      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
  
  Index: ResourceAdapterWrapper.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ResourceAdapterWrapper.java	10 Mar 2004 09:58:31 -0000	1.5
  +++ ResourceAdapterWrapper.java	7 Apr 2004 06:54:57 -0000	1.6
  @@ -21,6 +21,7 @@
   import javax.resource.spi.ActivationSpec;
   import javax.resource.spi.ManagedConnectionFactory;
   import javax.resource.spi.ResourceAdapter;
  +import javax.resource.spi.ResourceAdapterAssociation;
   import javax.resource.spi.endpoint.MessageEndpointFactory;
   
   import org.apache.geronimo.gbean.DynamicGBean;
  @@ -73,7 +74,7 @@
           return resourceAdapterClass;
       }
   
  -    public void registerManagedConnectionFactory(ManagedConnectionFactory managedConnectionFactory)
throws ResourceException {
  +    public void registerManagedConnectionFactory(ResourceAdapterAssociation managedConnectionFactory)
throws ResourceException {
           managedConnectionFactory.setResourceAdapter(resourceAdapter);
       }
   
  @@ -119,7 +120,7 @@
           infoFactory.addAttribute(new GAttributeInfo("ResourceAdapterClass", true));
           infoFactory.addReference(new GReferenceInfo("BootstrapContext", BootstrapContext.class.getName()));
   
  -        infoFactory.addOperation(new GOperationInfo("registerManagedConnectionFactory",
new String[]{ManagedConnectionFactory.class.getName()}));
  +        infoFactory.addOperation(new GOperationInfo("registerManagedConnectionFactory",
new String[]{ResourceAdapterAssociation.class.getName()}));
           infoFactory.addOperation(new GOperationInfo("endpointActivation", new String[]{MessageEndpointFactory.class.getName(),
ActivationSpec.class.getName()}));
           infoFactory.addOperation(new GOperationInfo("endpointDeactivation", new String[]{MessageEndpointFactory.class.getName(),
ActivationSpec.class.getName()}));
           infoFactory.setConstructor(new GConstructorInfo(
  
  
  
  1.8       +7 -3      incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java
  
  Index: ManagedConnectionFactoryWrapper.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ManagedConnectionFactoryWrapper.java	10 Mar 2004 09:58:32 -0000	1.7
  +++ ManagedConnectionFactoryWrapper.java	7 Apr 2004 06:54:57 -0000	1.8
  @@ -19,6 +19,7 @@
   
   import javax.naming.NamingException;
   import javax.resource.spi.ManagedConnectionFactory;
  +import javax.resource.spi.ResourceAdapterAssociation;
   import javax.management.ObjectName;
   
   import net.sf.cglib.proxy.Callback;
  @@ -164,8 +165,11 @@
   
       public void doStart() throws WaitingException, Exception {
           //register with resource adapter if not yet done
  -        if (!registered && resourceAdapterWrapper != null) {
  -            resourceAdapterWrapper.registerManagedConnectionFactory(managedConnectionFactory);
  +        if (!registered && (managedConnectionFactory instanceof ResourceAdapterAssociation))
{
  +            if (resourceAdapterWrapper == null) {
  +                throw new IllegalStateException("Managed connection factory expects to
be registered with a ResourceAdapter, but there is no ResourceAdapter");
  +            }
  +            resourceAdapterWrapper.registerManagedConnectionFactory((ResourceAdapterAssociation)managedConnectionFactory);
               registered = true;
               log.debug("Registered managedConnectionFactory with ResourceAdapter " + resourceAdapterWrapper.toString());
           }
  
  
  

Mime
View raw message