geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r233570 - in /geronimo/trunk: modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/connector/src/java/org/apache/geronimo/connector/ modules/connector/src/java/org/apache/geronimo/connector/work/ sandbox/spri...
Date Fri, 19 Aug 2005 23:01:52 GMT
Author: chirino
Date: Fri Aug 19 16:01:38 2005
New Revision: 233570

URL: http://svn.apache.org/viewcvs?rev=233570&view=rev
Log:
Did some futher decoupling of the connector module from geronimo kernel.  The connector module
can now run standalone without the geronimo kernel.

Modified:
    geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapper.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapperGBean.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
    geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
    geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml

Modified: geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/trunk/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Fri Aug 19 16:01:38 2005
@@ -292,7 +292,7 @@
         ResourceadapterType resourceadapter = ((ConnectorType) specDD).getResourceadapter();
         // Create the resource adapter gbean
         if (resourceadapter.isSetResourceadapterClass()) {
-            GBeanInfoBuilder resourceAdapterInfoBuilder = new GBeanInfoBuilder(ResourceAdapterWrapper.class,
ResourceAdapterWrapperGBean.GBEAN_INFO);
+            GBeanInfoBuilder resourceAdapterInfoBuilder = new GBeanInfoBuilder(ResourceAdapterWrapperGBean.class,
ResourceAdapterWrapperGBean.GBEAN_INFO);
             GBeanData resourceAdapterGBeanData = setUpDynamicGBean(resourceAdapterInfoBuilder,
resourceadapter.getConfigPropertyArray(), cl);
 
             resourceAdapterGBeanData.setAttribute("resourceAdapterClass", resourceadapter.getResourceadapterClass().getStringValue().trim());
@@ -518,7 +518,7 @@
             String messageListenerInterface = messagelistenerType.getMessagelistenerType().getStringValue().trim();
             ActivationspecType activationspec = messagelistenerType.getActivationspec();
             String activationSpecClassName = activationspec.getActivationspecClass().getStringValue().trim();
-            GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapper.class,
ActivationSpecWrapperGBean.GBEAN_INFO);
+            GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class,
ActivationSpecWrapperGBean.GBEAN_INFO);
 
             //add all javabean properties that have both getter and setter.  Ignore the "required"
flag from the dd.
             Map getters = new HashMap();

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapper.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapper.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapper.java
Fri Aug 19 16:01:38 2005
@@ -24,8 +24,6 @@
 import javax.transaction.SystemException;
 import javax.transaction.xa.XAResource;
 
-import org.apache.geronimo.gbean.DynamicGBean;
-import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.transaction.manager.NamedXAResource;
 import org.apache.geronimo.transaction.manager.ResourceManager;
 import org.apache.geronimo.transaction.manager.WrapperNamedXAResource;
@@ -37,10 +35,9 @@
  *
  * @version $Rev$ $Date$
  */
-public class ActivationSpecWrapper implements ResourceManager, DynamicGBean {
+public class ActivationSpecWrapper implements ResourceManager {
 
-    private final DynamicGBeanDelegate delegate;
-    private final ActivationSpec activationSpec;
+    protected final ActivationSpec activationSpec;
 
     private final ResourceAdapterWrapper resourceAdapterWrapper;
     private final String containerId;
@@ -50,7 +47,6 @@
      */
     public ActivationSpecWrapper() {
         activationSpec = null;
-        delegate = null;
         containerId = null;
         resourceAdapterWrapper = null;
     }
@@ -67,9 +63,7 @@
                                  final ResourceAdapterWrapper resourceAdapterWrapper,
                                  final ClassLoader cl) throws IllegalAccessException, InstantiationException,
ClassNotFoundException {
         Class clazz = cl.loadClass(activationSpecClass);
-        activationSpec = (ActivationSpec) clazz.newInstance();
-        delegate = new DynamicGBeanDelegate();
-        delegate.addAll(activationSpec);
+        this.activationSpec = (ActivationSpec) clazz.newInstance();
         this.containerId = containerId;
         this.resourceAdapterWrapper = resourceAdapterWrapper;
     }
@@ -80,7 +74,6 @@
         this.activationSpec = activationSpec;
         this.resourceAdapterWrapper = resourceAdapterWrapper;
         this.containerId = null;
-        this.delegate=null;
     }
 
     /**
@@ -100,43 +93,6 @@
         return resourceAdapterWrapper;
     }
 
-    //DynamicGBean implementation
-
-    /**
-     * Delegating DynamicGBean getAttribute method.
-     *
-     * @param name of attribute.
-     * @return attribute value.
-     * @throws Exception
-     */
-    public Object getAttribute(final String name) throws Exception {
-        return delegate.getAttribute(name);
-    }
-
-    /**
-     * Delegating DynamicGBean setAttribute method.
-     *
-     * @param name  of attribute.
-     * @param value of attribute to be set.
-     * @throws Exception
-     */
-    public void setAttribute(final String name, final Object value) throws Exception {
-        delegate.setAttribute(name, value);
-    }
-
-    /**
-     * no-op DynamicGBean method
-     *
-     * @param name
-     * @param arguments
-     * @param types
-     * @return nothing, there are no operations.
-     * @throws Exception
-     */
-    public Object invoke(final String name, final Object[] arguments, final String[] types)
throws Exception {
-        //we have no dynamic operations.
-        return null;
-    }
 
     //GBeanLifecycle implementation
     public void activate(final MessageEndpointFactory messageEndpointFactory) throws ResourceException
{

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapperGBean.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapperGBean.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ActivationSpecWrapperGBean.java
Fri Aug 19 16:01:38 2005
@@ -21,6 +21,8 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.DynamicGBean;
+import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.manager.ResourceManager;
 
@@ -28,12 +30,62 @@
  * 
  * @version $Revision$
  */
-public class ActivationSpecWrapperGBean {
-    
+public class ActivationSpecWrapperGBean extends ActivationSpecWrapper implements DynamicGBean
{
+
+    private final DynamicGBeanDelegate delegate;
+
+    public ActivationSpecWrapperGBean() {
+        delegate = null;
+    }
+
+    public ActivationSpecWrapperGBean(final String activationSpecClass, final String containerId,
final ResourceAdapterWrapper resourceAdapterWrapper, final ClassLoader cl) throws IllegalAccessException,
InstantiationException, ClassNotFoundException {
+        super(activationSpecClass, containerId, resourceAdapterWrapper, cl);
+        delegate = new DynamicGBeanDelegate();
+        delegate.addAll(activationSpec);
+    }
+
+    //DynamicGBean implementation
+
+    /**
+     * Delegating DynamicGBean getAttribute method.
+     *
+     * @param name of attribute.
+     * @return attribute value.
+     * @throws Exception
+     */
+    public Object getAttribute(final String name) throws Exception {
+        return delegate.getAttribute(name);
+    }
+
+    /**
+     * Delegating DynamicGBean setAttribute method.
+     *
+     * @param name  of attribute.
+     * @param value of attribute to be set.
+     * @throws Exception
+     */
+    public void setAttribute(final String name, final Object value) throws Exception {
+        delegate.setAttribute(name, value);
+    }
+
+    /**
+     * no-op DynamicGBean method
+     *
+     * @param name
+     * @param arguments
+     * @param types
+     * @return nothing, there are no operations.
+     * @throws Exception
+     */
+    public Object invoke(final String name, final Object[] arguments, final String[] types)
throws Exception {
+        //we have no dynamic operations.
+        return null;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapper.class,
NameFactory.JCA_ACTIVATION_SPEC);
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ActivationSpecWrapperGBean.class,
NameFactory.JCA_ACTIVATION_SPEC);
         infoBuilder.addAttribute("activationSpecClass", String.class, true);
         infoBuilder.addAttribute("containerId", String.class, true);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
Fri Aug 19 16:01:38 2005
@@ -17,6 +17,8 @@
 
 package org.apache.geronimo.connector;
 
+import org.apache.geronimo.connector.work.GeronimoWorkManager;
+
 import javax.resource.ResourceException;
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.BootstrapContext;
@@ -26,26 +28,20 @@
 import javax.resource.spi.endpoint.MessageEndpointFactory;
 import javax.transaction.xa.XAResource;
 
-import org.apache.geronimo.connector.work.GeronimoWorkManager;
-import org.apache.geronimo.gbean.DynamicGBean;
-import org.apache.geronimo.gbean.DynamicGBeanDelegate;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-
 /**
  * Dynamic GBean wrapper around a ResourceAdapter object, exposing the config-properties
as
  * GBean attributes.
  *
  * @version $Rev$ $Date$
  */
-public class ResourceAdapterWrapper implements GBeanLifecycle, DynamicGBean, ResourceAdapter
{
+public class ResourceAdapterWrapper implements ResourceAdapter {
 
     private final String resourceAdapterClass;
 
     private final BootstrapContext bootstrapContext;
 
-    private final ResourceAdapter resourceAdapter;
+    protected final ResourceAdapter resourceAdapter;
 
-    private final DynamicGBeanDelegate delegate;
 
     /**
      *  default constructor for enhancement proxy endpoint
@@ -54,7 +50,6 @@
         this.resourceAdapterClass = null;
         this.bootstrapContext = null;
         this.resourceAdapter = null;
-        this.delegate = null;
     }
 
     public ResourceAdapterWrapper(final String resourceAdapterClass,
@@ -64,15 +59,12 @@
         this.bootstrapContext = new BootstrapContextImpl(workManager);
         Class clazz = cl.loadClass(resourceAdapterClass);
         resourceAdapter = (ResourceAdapter) clazz.newInstance();
-        delegate = new DynamicGBeanDelegate();
-        delegate.addAll(resourceAdapter);
     }
     
     public ResourceAdapterWrapper(ResourceAdapter resourceAdapter, final GeronimoWorkManager
workManager) {
         this.resourceAdapterClass = resourceAdapter.getClass().getName();
         this.bootstrapContext = new BootstrapContextImpl(workManager);
         this.resourceAdapter = resourceAdapter;
-        this.delegate=null;
     }
 
     public String getResourceAdapterClass() {
@@ -115,19 +107,5 @@
     public void doFail() {
         resourceAdapter.stop();
     }
-
-    public Object getAttribute(String name) throws Exception {
-        return delegate.getAttribute(name);
-    }
-
-    public void setAttribute(String name, Object value) throws Exception {
-        delegate.setAttribute(name, value);
-    }
-
-    public Object invoke(String name, Object[] arguments, String[] types) throws Exception
{
-        //we have no dynamic operations
-        return null;
-    }
-
 
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
Fri Aug 19 16:01:38 2005
@@ -21,20 +21,48 @@
 import javax.resource.spi.ResourceAdapterAssociation;
 
 import org.apache.geronimo.connector.work.GeronimoWorkManager;
+import org.apache.geronimo.gbean.DynamicGBean;
+import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * 
  * @version $Revision$
  */
-public class ResourceAdapterWrapperGBean {
-    
+public class ResourceAdapterWrapperGBean extends ResourceAdapterWrapper implements GBeanLifecycle,
DynamicGBean {
+
+    private final DynamicGBeanDelegate delegate;
+
+    public ResourceAdapterWrapperGBean() {
+        delegate=null;
+    }
+
+    public ResourceAdapterWrapperGBean(final String resourceAdapterClass, final GeronimoWorkManager
workManager, ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException
{
+        super(resourceAdapterClass, workManager, cl);
+        delegate = new DynamicGBeanDelegate();
+        delegate.addAll(resourceAdapter);
+    }
+
+    public Object getAttribute(String name) throws Exception {
+        return delegate.getAttribute(name);
+    }
+
+    public void setAttribute(String name, Object value) throws Exception {
+        delegate.setAttribute(name, value);
+    }
+
+    public Object invoke(String name, Object[] arguments, String[] types) throws Exception
{
+        //we have no dynamic operations
+        return null;
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ResourceAdapterWrapper.class,
NameFactory.RESOURCE_ADAPTER);
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(ResourceAdapterWrapperGBean.class,
NameFactory.RESOURCE_ADAPTER);
         infoBuilder.addAttribute("resourceAdapterClass", String.class, true);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
Fri Aug 19 16:01:38 2005
@@ -17,24 +17,22 @@
 
 package org.apache.geronimo.connector.work;
 
-import javax.resource.spi.XATerminator;
-import javax.resource.spi.work.ExecutionContext;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkCompletedException;
-import javax.resource.spi.work.WorkException;
-import javax.resource.spi.work.WorkListener;
-import javax.resource.spi.work.WorkManager;
-
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.pool.NullWorkExecutorPool;
 import org.apache.geronimo.connector.work.pool.ScheduleWorkExecutor;
 import org.apache.geronimo.connector.work.pool.StartWorkExecutor;
 import org.apache.geronimo.connector.work.pool.SyncWorkExecutor;
 import org.apache.geronimo.connector.work.pool.WorkExecutor;
 import org.apache.geronimo.connector.work.pool.WorkExecutorPool;
-import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 
-import EDU.oswego.cs.dl.util.concurrent.Executor;
+import javax.resource.spi.XATerminator;
+import javax.resource.spi.work.ExecutionContext;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkCompletedException;
+import javax.resource.spi.work.WorkException;
+import javax.resource.spi.work.WorkListener;
+import javax.resource.spi.work.WorkManager;
 
 /**
  * WorkManager implementation which uses under the cover three WorkExecutorPool
@@ -46,7 +44,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class GeronimoWorkManager implements WorkManager, GBeanLifecycle {
+public class GeronimoWorkManager implements WorkManager {
 
     private final static int DEFAULT_POOL_SIZE = 10;
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
(original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
Fri Aug 19 16:01:38 2005
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
 
@@ -28,12 +29,23 @@
  * 
  * @version $Revision$
  */
-public class GeronimoWorkManagerGBean {
-    
+public class GeronimoWorkManagerGBean extends GeronimoWorkManager implements GBeanLifecycle
{
+
+    public GeronimoWorkManagerGBean() {
+    }
+
+    public GeronimoWorkManagerGBean(int size, TransactionContextManager transactionContextManager)
{
+        super(size, transactionContextManager);
+    }
+
+    public GeronimoWorkManagerGBean(int syncSize, int startSize, int schedSize, TransactionContextManager
transactionContextManager) {
+        super(syncSize, startSize, schedSize, transactionContextManager);
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(GeronimoWorkManager.class, NameFactory.JCA_WORK_MANAGER);
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(GeronimoWorkManagerGBean.class,
NameFactory.JCA_WORK_MANAGER);
         infoFactory.addInterface(WorkManager.class);
 
         infoFactory.addAttribute("syncMaximumPoolSize", Integer.TYPE, true);
@@ -56,5 +68,7 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
-    
+
+
+
 }

Modified: geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml?rev=233570&r1=233569&r2=233570&view=diff
==============================================================================
--- geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml (original)
+++ geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml Fri Aug 19 16:01:38 2005
@@ -135,7 +135,7 @@
 
     <bean name="ConnectionTracker" class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"/>
 
-    <bean name="DefaultWorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManager">
+    <bean name="DefaultWorkManager" class="org.apache.geronimo.connector.work.GeronimoWorkManagerGBean">
         <property name="syncMaximumPoolSize"><value>10</value></property>
         <property name="startMaximumPoolSize"><value>10</value></property>
         <property name="scheduledMaximumPoolSize"><value>10</value></property>



Mime
View raw message