[jboss-svn-commits] JBL Code SVN: r31384 - in labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework: participant and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Feb 3 10:51:31 EST 2010


Author: adinn
Date: 2010-02-03 10:51:30 -0500 (Wed, 03 Feb 2010)
New Revision: 31384

Added:
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/EJBServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/POJOServiceExecutor.java
Modified:
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/LocalServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/ServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/CoordinatorCompletionParticipant.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/Participant.java
Log:
tweaked the class structure to make it more OO

Added: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/EJBServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/EJBServiceExecutor.java	                        (rev 0)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/EJBServiceExecutor.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -0,0 +1,22 @@
+package org.jboss.jbossts.baframework.execute;
+
+import org.jboss.jbossts.baframework.data.TaskDescription;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Feb 3, 2010
+ * Time: 3:39:23 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class EJBServiceExecutor extends LocalServiceExecutor
+{
+    /**
+     * Constructor
+     *
+     * @param taskDesc is the task description.
+     */
+    public EJBServiceExecutor(TaskDescription taskDesc) {
+        super(taskDesc, new EJBExecution());
+    }
+}
\ No newline at end of file

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/LocalServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/LocalServiceExecutor.java	2010-02-03 15:23:17 UTC (rev 31383)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/LocalServiceExecutor.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -34,7 +34,7 @@
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
  */
-public class LocalServiceExecutor extends ServiceExecutor
+public abstract class LocalServiceExecutor extends ServiceExecutor
 {
 
     // Logger
@@ -45,10 +45,10 @@
      *
      * @param taskDesc is the task description.
      */
-    public LocalServiceExecutor(TaskDescription taskDesc)
+    protected LocalServiceExecutor(TaskDescription taskDesc, Executable execution)
     {
         super(taskDesc);
-        execution = new LocalExecution();
+        this.execution = execution;
         dataProvider = new ArgumentsProvider();
     }
 

Added: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/POJOServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/POJOServiceExecutor.java	                        (rev 0)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/POJOServiceExecutor.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -0,0 +1,22 @@
+package org.jboss.jbossts.baframework.execute;
+
+import org.jboss.jbossts.baframework.data.TaskDescription;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Feb 3, 2010
+ * Time: 3:39:23 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class POJOServiceExecutor extends LocalServiceExecutor
+{
+    /**
+     * Constructor
+     *
+     * @param taskDesc is the task description.
+     */
+    public POJOServiceExecutor(TaskDescription taskDesc) {
+        super(taskDesc, new LocalExecution());
+    }
+}

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/ServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/ServiceExecutor.java	2010-02-03 15:23:17 UTC (rev 31383)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/execute/ServiceExecutor.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -83,11 +83,11 @@
      *
      * @param execution is the execution type which should be set.
      */
-    public void setExecutionType(Executable execution)
-    {
-        log.info("setExecutionType()");
-        this.execution = execution;
-    }
+//    public void setExecutionType(Executable execution)
+//    {
+//        log.info("setExecutionType()");
+//        this.execution = execution;
+//    }
 
     /**
      * This method invokes the completion or compensation task which is specified in the service description.

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/CoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/CoordinatorCompletionParticipant.java	2010-02-03 15:23:17 UTC (rev 31383)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/CoordinatorCompletionParticipant.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -25,10 +25,7 @@
 import org.jboss.jbossts.baframework.SingleTransactionManager;
 import org.jboss.jbossts.baframework.datamgmt.ExecutionDataProviderImpl;
 import org.jboss.jbossts.baframework.data.TaskDescription;
-import org.jboss.jbossts.baframework.execute.ServiceExecutor;
-import org.jboss.jbossts.baframework.execute.RemoteServiceExecutor;
-import org.jboss.jbossts.baframework.execute.LocalServiceExecutor;
-import org.jboss.jbossts.baframework.execute.EJBExecution;
+import org.jboss.jbossts.baframework.execute.*;
 import org.jboss.jbossts.baframework.annotation.ExecutionMode;
 import org.jboss.jbossts.baframework.service.ServiceDescription;
 import org.jboss.jbossts.baframework.service.MethodDescription;
@@ -111,14 +108,13 @@
                 {
                     // Use the local executor.
                     log.info("Using local executor");
-                    se = new LocalServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
+                    se = new POJOServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
                 }
                 else if (executionMode == ExecutionMode.EJB)
                 {
                     // Use the local executor.
                     log.info("Using local executor");
-                    se = new LocalServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
-                    se.setExecutionType(new EJBExecution());
+                    se = new EJBServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
                 }
                 else
                 {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/Participant.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/Participant.java	2010-02-03 15:23:17 UTC (rev 31383)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/jbossts/baframework/participant/Participant.java	2010-02-03 15:51:30 UTC (rev 31384)
@@ -21,14 +21,11 @@
 package org.jboss.jbossts.baframework.participant;
 
 import org.jboss.jbossts.baframework.data.ManagedData;
+import org.jboss.jbossts.baframework.execute.*;
 import org.jboss.jbossts.baframework.service.ServiceDescription;
 import org.jboss.jbossts.baframework.data.TaskDescription;
 import org.jboss.jbossts.baframework.service.ServiceInformationManager;
 import org.jboss.jbossts.baframework.service.MethodDescription;
-import org.jboss.jbossts.baframework.execute.ServiceExecutor;
-import org.jboss.jbossts.baframework.execute.RemoteServiceExecutor;
-import org.jboss.jbossts.baframework.execute.LocalServiceExecutor;
-import org.jboss.jbossts.baframework.execute.EJBExecution;
 import org.jboss.jbossts.baframework.exception.ActionExecutionException;
 import org.jboss.jbossts.baframework.exception.TaskAssociationFailedException;
 import org.jboss.jbossts.baframework.BATransactionManager;
@@ -292,14 +289,13 @@
         {
             // Use the local executor.
             log.info("Using local executor");
-            se = new LocalServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
+            se = new POJOServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
         }
         else if (executionMode == ExecutionMode.EJB)
         {
             // Use the local executor.
             log.info("Using local executor");
-            se = new LocalServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
-            se.setExecutionType(new EJBExecution());
+            se = new EJBServiceExecutor(new TaskDescription(txId,taskId,serviceId,this));
         }
         else
         {



More information about the jboss-svn-commits mailing list