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/core/src/java/org/apache/geronimo/connector/deployment ResourceAdapterHelper.java ResourceAdapterHelperImpl.java
Date Tue, 25 Nov 2003 17:28:36 GMT
djencks     2003/11/25 09:28:36

  Modified:    modules/core/src/java/org/apache/geronimo/connector/deployment
                        ResourceAdapterHelper.java
                        ResourceAdapterHelperImpl.java
  Log:
  Have the ResourceAdapterHelper create ActivationSpecs using the ResourceAdapter's classloader,
for MDB deployment.  There might be a better way to do this
  
  Revision  Changes    Path
  1.4       +5 -1      incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ResourceAdapterHelper.java
  
  Index: ResourceAdapterHelper.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ResourceAdapterHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResourceAdapterHelper.java	19 Nov 2003 02:13:04 -0000	1.3
  +++ ResourceAdapterHelper.java	25 Nov 2003 17:28:36 -0000	1.4
  @@ -60,6 +60,8 @@
   import javax.resource.spi.ManagedConnectionFactory;
   import javax.resource.spi.ActivationSpec;
   
  +import org.apache.geronimo.kernel.deployment.DeploymentException;
  +
   /**
    * ResourceAdapterHelper
    *
  @@ -70,5 +72,7 @@
       void registerManagedConnectionFactory(ManagedConnectionFactory mcf) throws ResourceException;
   
       void registerActivationSpec(ActivationSpec activationSpec) throws ResourceException;
  +
  +    ActivationSpec createActivationSpec(String activationSpecClassName) throws DeploymentException;
   
   }
  
  
  
  1.4       +21 -1     incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ResourceAdapterHelperImpl.java
  
  Index: ResourceAdapterHelperImpl.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/connector/deployment/ResourceAdapterHelperImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ResourceAdapterHelperImpl.java	19 Nov 2003 02:13:04 -0000	1.3
  +++ ResourceAdapterHelperImpl.java	25 Nov 2003 17:28:36 -0000	1.4
  @@ -68,6 +68,7 @@
   import org.apache.geronimo.kernel.service.GeronimoMBeanEndpoint;
   import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
   import org.apache.geronimo.kernel.service.GeronimoMBeanTarget;
  +import org.apache.geronimo.kernel.deployment.DeploymentException;
   
   /**
    * ResourceAdapterHelperImpl
  @@ -140,6 +141,25 @@
   
       public void registerActivationSpec(ActivationSpec activationSpec) throws ResourceException
{
           activationSpec.setResourceAdapter(resourceAdapter);
  +    }
  +
  +    public ActivationSpec createActivationSpec(String activationSpecClassName) throws DeploymentException
{
  +        ClassLoader cl = resourceAdapter.getClass().getClassLoader();
  +        Class clazz = null;
  +        try {
  +            clazz = cl.loadClass(activationSpecClassName);
  +        } catch (ClassNotFoundException e) {
  +            throw new DeploymentException("Could not load ActivationSpec class : " + activationSpecClassName
+ " using classloader from ResourceAdapter: " + cl, e);
  +        }
  +        ActivationSpec activationSpec = null;
  +        try {
  +            activationSpec = (ActivationSpec)clazz.newInstance();
  +        } catch (InstantiationException e) {
  +            throw new DeploymentException("Could not create an ActivationSpec instance",
e);
  +        } catch (IllegalAccessException e) {
  +            throw new DeploymentException("Could not create an ActivationSpec instance",
e);         }
  +        return activationSpec;
  +
       }
   
       /**
  
  
  

Mime
View raw message