[jboss-svn-commits] JBL Code SVN: r14903 - in labs/jbosstm/workspace/baframework/trunk: resources and 6 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Sep 5 17:46:18 EDT 2007


Author: maciej.machulak
Date: 2007-09-05 17:46:18 -0400 (Wed, 05 Sep 2007)
New Revision: 14903

Added:
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/TransactionProcessingAspect.java
Removed:
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/JaxWSBAProcessingAspect.java
Modified:
   labs/jbosstm/workspace/baframework/trunk/build.xml
   labs/jbosstm/workspace/baframework/trunk/changelog.txt
   labs/jbosstm/workspace/baframework/trunk/resources/jboss-aop.xml
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompensatedBy.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompletedBy.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BAService.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/ExecutionMode.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/WSConfiguredDII.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/BAServiceVisitor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/Participant.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescription.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescriptionImpl.java
Log:


Modified: labs/jbosstm/workspace/baframework/trunk/build.xml
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/build.xml	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/build.xml	2007-09-05 21:46:18 UTC (rev 14903)
@@ -32,6 +32,7 @@
 	<property name="jboss.server" value="${jboss.home}/server/${jboss.profile}"/>
 	<property name="jboss.aop.dir" location="${jboss.server}/deploy/jboss-aop-jdk50.deployer"/>
 	<property name="javaee.dir" location="${jboss.server}/lib"/>
+	<property name="jaxrpc.dir" location="${jboss.server}/lib"/>
     <property name="src" location="src"/>
     <property name="doc" location="docs"/>
     <property name="lib" location="lib"/>
@@ -59,6 +60,9 @@
 			<include name="jboss-saaj.jar"/>
 			<include name="jboss-j2ee.jar"/>
         </fileset>
+		<fileset dir="${jaxrpc.dir}">
+		    <include name="jboss-jaxrpc.jar"/>
+	    </fileset>
 		<fileset dir="${jboss.aop.dir}">
 		    <include name="jboss-aop-jdk50.jar"/>
 	    </fileset>

Modified: labs/jbosstm/workspace/baframework/trunk/changelog.txt
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/changelog.txt	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/changelog.txt	2007-09-05 21:46:18 UTC (rev 14903)
@@ -1,3 +1,7 @@
+Thu Sep 05 22:44:00 GMT 2007
+
+Release of the Business Activity Framework version 0.2.1
++---+
 Thu Sep 01 19:11:00 GMT 2007
 
 - cleaned and restructured code

Modified: labs/jbosstm/workspace/baframework/trunk/resources/jboss-aop.xml
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/resources/jboss-aop.xml	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/resources/jboss-aop.xml	2007-09-05 21:46:18 UTC (rev 14903)
@@ -34,15 +34,15 @@
     <pointcut name="baCompensationManagement" expr="field(org.jboss.txbridge.ba.datamgmt.DataManager *->@org.jboss.txbridge.ba.annotation.BADataManagement)"/>
 
     <!-- BA Processing Aspect -->
-    <aspect class="org.jboss.txbridge.ba.aspect.JaxWSBAProcessingAspect" scope="PER_INSTANCE"/>
+    <aspect class="org.jboss.txbridge.ba.aspect.TransactionProcessingAspect" scope="PER_INSTANCE"/>
 
     <bind pointcut="baServiceAnnotation">
-        <advice name="process" aspect="org.jboss.txbridge.ba.aspect.JaxWSBAProcessingAspect"/>
+        <advice name="process" aspect="org.jboss.txbridge.ba.aspect.TransactionProcessingAspect"/>
     </bind>
 
 
     <bind pointcut="baCompensationManagement">
-        <advice name="access" aspect="org.jboss.txbridge.ba.aspect.JaxWSBAProcessingAspect"/>
+        <advice name="access" aspect="org.jboss.txbridge.ba.aspect.TransactionProcessingAspect"/>
     </bind>
 
 </aop>

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompensatedBy.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompensatedBy.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompensatedBy.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -49,7 +49,6 @@
     public String jndiName() default "";
     public String providerURL() default "";
     public String wsdl() default "";
-    public String address() default "";
     public String namespace() default "";
     public String serviceName() default "";
     public boolean single() default false;

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompletedBy.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompletedBy.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BACompletedBy.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -49,7 +49,6 @@
     public String jndiName() default "";
     public String providerURL() default "";
     public String wsdl() default "";
-    public String address() default "";
     public String namespace() default "";
     public String serviceName() default "";
     public boolean single() default false;

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BAService.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BAService.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/BAService.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -33,13 +33,13 @@
 @Target(ElementType.TYPE)
 @Retention(RetentionPolicy.RUNTIME)
 @Documented
-public @interface BAService {
+public @interface BAService
+{
     public Class[] serviceClass() default {};
     public Class[] ejbInterface() default {};
     public String jndiName() default "";
     public String providerURL() default "";
     public String wsdl() default "";   
-    public String address() default "";
     public String namespace() default "";
     public String serviceName() default "";
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/ExecutionMode.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/ExecutionMode.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/annotation/ExecutionMode.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -32,8 +32,5 @@
 {
     POJO,
     EJB,
-    UDII,
-    CDII,
-    RMI,
-    CORBA
+    DII
 }

Deleted: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/JaxWSBAProcessingAspect.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/JaxWSBAProcessingAspect.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/JaxWSBAProcessingAspect.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -1,181 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a full listing
- * of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License, v. 2.0.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
- * You should have received a copy of the GNU General Public License,
- * v. 2.0 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2007,
- * @author JBoss Inc.
- */
-package org.jboss.txbridge.ba.aspect;
-
-import org.apache.log4j.Logger;
-import org.jboss.aop.joinpoint.FieldReadInvocation;
-import org.jboss.aop.joinpoint.FieldWriteInvocation;
-import org.jboss.aop.joinpoint.MethodInvocation;
-import org.jboss.txbridge.ba.BATransactionManager;
-import org.jboss.txbridge.ba.datamgmt.DataManagerImpl;
-import org.jboss.txbridge.ba.datamgmt.DataManagerProvider;
-import org.jboss.txbridge.ba.data.TaskDescription;
-
-import java.lang.reflect.Method;
-
-/**
- * This aspect provides three advices:
- * - process() - intercepts a call to a Business Activity service and applies necessary 
- * transaction-related mechanisms (handling a single invocation). 
- * - access() - used for transparently injecting the datamgmt manager associated
- * with the current thread of execution.
- * - access() - used to prevent from setting the datamgmt manager object.
- *
- * @author Maciej P. Machulak (mmachulak at redhat.com)
- * @version 0.1
- */
-public class JaxWSBAProcessingAspect
-{
-    // Logger
-    private static Logger log = Logger.getLogger(JaxWSBAProcessingAspect.class);
-
-    // BA Transaction Manager
-    private static BATransactionManager baTransactionManager = BATransactionManager.getSingletonInstance();
-
-    // Compensation Manager Provider
-    private static DataManagerProvider cmp = DataManagerProvider.getSingletonInstance();
-
-    /**
-     * Advice that processes methods execution according to the BA management.
-     *
-     * @param invocation is the method's invocation.
-     * @return the object returned by the method.
-     * @throws Throwable is any exception that should be propagated.
-     */
-    public Object process(MethodInvocation invocation) throws Throwable
-    {
-
-        log.info("process()");
-
-        // Check if this invocation is within the scope of a Business Activity
-        log.info("Checking if there is a BA");
-        if (!baTransactionManager.isBAPresent())
-        {
-            log.info("No Business Activity - proceeding with normal invocation");
-            return internalProcess(invocation);
-        }
-        else
-        {
-            log.info("Business Activity present - proceeding");
-            
-            // #### IMPLEMENTATION SPECIFIC PART - BEGIN
-            Method method = invocation.getMethod();
-            log.info("Method: " + method.getName());
-            Object[] arguments = invocation.getArguments();
-            if (arguments == null)
-            {
-                log.info("Method without any arguments.");
-            }
-            else
-            {
-                log.info("No of arguments: " + arguments.length);
-            }
-            // #### IMPLEMENTATION SPECIFIC PART - END
-
-
-
-            // Handle the invocation
-            log.info("Handling invocation");
-            TaskDescription taskDesc = baTransactionManager.handleInvocation(method);
-
-            // Associate datamgmt manager with thread of execution
-            Long threadId = Thread.currentThread().getId();
-            log.info("Associating datamgmt manager for thread: " + threadId);
-            cmp.associateManager(threadId,new DataManagerImpl(taskDesc.getTaskId(),taskDesc.getParticipant()));
-
-            try
-            {
-                // #### IMPLEMENTATION SPECIFIC PART - BEGIN
-                // Invoke the service
-                log.info("Invoking the service");
-                Object returnObject = invocation.invokeNext();
-                // #### IMPLEMENTATION SPECIFIC PART - END
-
-                // Dissassociate the thread
-                log.info("Disassociating datamgmt manager for thread: " + threadId);
-                cmp.removeManager(threadId);
-
-                log.info("No exception - proceeding");
-
-                // Complete the execution within this transaction
-                log.info("Complete the invocation");
-                baTransactionManager.completeInvocation(taskDesc,arguments,returnObject);
-
-                return returnObject;
-            }
-            catch (Exception e)
-            {
-                // Dissassociate the thread
-                log.info("Disassociating datamgmt manager for thread: " + threadId);
-                cmp.removeManager(threadId);
-
-                // Clean the transaction
-                log.info("Cleaning information about the transaction");
-                baTransactionManager.cleanInvocation(taskDesc);
-
-                // Pass the exception
-                throw new Exception(e);
-            }
-        }
-    }
-
-    /**
-     * Advice that processes methods execution without applying any transactional
-	 * mechanisms.
-     *
-     * @param invocation is the method's invocation.
-     * @return the object returned by the method.
-     * @throws Throwable is any exception that should be propagated.
-     */
-    private Object internalProcess(MethodInvocation invocation) throws Throwable
-    {
-        log.info("internalProcess()");
-        return invocation.invokeNext();
-    }
-
-    /**
-     * Advice that returns the required DataManager object for every read
-     * access to the DataManager object annotated by the @BADataManagement
-	 * annotation.
-     *
-     * @param invocation is the read access of the DataManager field.
-     * @return the object returned by the method.
-     * @throws Throwable is any exception that should be propagated.
-     */
-    public Object access(FieldReadInvocation invocation) throws Throwable
-    {
-        log.info("Returning datamgmt manager for thread: " + Thread.currentThread().getId());
-        return cmp.getManager(Thread.currentThread().getId());
-    }
-
-    /**
-     * Advice that prevents from setting the annotated DataManager object.
-     *
-     * @param invocation is the write access of the DataManager field.
-     * @return the object returned by the method.
-     * @throws Throwable is any exception that should be propagated.
-     */
-    public Object access(FieldWriteInvocation invocation) throws Throwable
-    {
-        throw new RuntimeException("Setting a @BADataManagement variable is illegal.");
-    }
-
-}

Added: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/TransactionProcessingAspect.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/TransactionProcessingAspect.java	                        (rev 0)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/aspect/TransactionProcessingAspect.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -0,0 +1,181 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package org.jboss.txbridge.ba.aspect;
+
+import org.apache.log4j.Logger;
+import org.jboss.aop.joinpoint.FieldReadInvocation;
+import org.jboss.aop.joinpoint.FieldWriteInvocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.txbridge.ba.BATransactionManager;
+import org.jboss.txbridge.ba.datamgmt.DataManagerImpl;
+import org.jboss.txbridge.ba.datamgmt.DataManagerProvider;
+import org.jboss.txbridge.ba.data.TaskDescription;
+
+import java.lang.reflect.Method;
+
+/**
+ * This aspect provides three advices:
+ * - process() - intercepts a call to a Business Activity service and applies necessary 
+ * transaction-related mechanisms (handling a single invocation). 
+ * - access() - used for transparently injecting the datamgmt manager associated
+ * with the current thread of execution.
+ * - access() - used to prevent from setting the datamgmt manager object.
+ *
+ * @author Maciej P. Machulak (mmachulak at redhat.com)
+ * @version 0.1
+ */
+public class TransactionProcessingAspect
+{
+    // Logger
+    private static Logger log = Logger.getLogger(TransactionProcessingAspect.class);
+
+    // BA Transaction Manager
+    private static BATransactionManager baTransactionManager = BATransactionManager.getSingletonInstance();
+
+    // Compensation Manager Provider
+    private static DataManagerProvider cmp = DataManagerProvider.getSingletonInstance();
+
+    /**
+     * Advice that processes methods execution according to the BA management.
+     *
+     * @param invocation is the method's invocation.
+     * @return the object returned by the method.
+     * @throws Throwable is any exception that should be propagated.
+     */
+    public Object process(MethodInvocation invocation) throws Throwable
+    {
+
+        log.info("process()");
+
+        // Check if this invocation is within the scope of a Business Activity
+        log.info("Checking if there is a BA");
+        if (!baTransactionManager.isBAPresent())
+        {
+            log.info("No Business Activity - proceeding with normal invocation");
+            return internalProcess(invocation);
+        }
+        else
+        {
+            log.info("Business Activity present - proceeding");
+            
+            // #### IMPLEMENTATION SPECIFIC PART - BEGIN
+            Method method = invocation.getMethod();
+            log.info("Method: " + method.getName());
+            Object[] arguments = invocation.getArguments();
+            if (arguments == null)
+            {
+                log.info("Method without any arguments.");
+            }
+            else
+            {
+                log.info("No of arguments: " + arguments.length);
+            }
+            // #### IMPLEMENTATION SPECIFIC PART - END
+
+
+
+            // Handle the invocation
+            log.info("Handling invocation");
+            TaskDescription taskDesc = baTransactionManager.handleInvocation(method);
+
+            // Associate datamgmt manager with thread of execution
+            Long threadId = Thread.currentThread().getId();
+            log.info("Associating datamgmt manager for thread: " + threadId);
+            cmp.associateManager(threadId,new DataManagerImpl(taskDesc.getTaskId(),taskDesc.getParticipant()));
+
+            try
+            {
+                // #### IMPLEMENTATION SPECIFIC PART - BEGIN
+                // Invoke the service
+                log.info("Invoking the service");
+                Object returnObject = invocation.invokeNext();
+                // #### IMPLEMENTATION SPECIFIC PART - END
+
+                // Dissassociate the thread
+                log.info("Disassociating datamgmt manager for thread: " + threadId);
+                cmp.removeManager(threadId);
+
+                log.info("No exception - proceeding");
+
+                // Complete the execution within this transaction
+                log.info("Complete the invocation");
+                baTransactionManager.completeInvocation(taskDesc,arguments,returnObject);
+
+                return returnObject;
+            }
+            catch (Exception e)
+            {
+                // Dissassociate the thread
+                log.info("Disassociating datamgmt manager for thread: " + threadId);
+                cmp.removeManager(threadId);
+
+                // Clean the transaction
+                log.info("Cleaning information about the transaction");
+                baTransactionManager.cleanInvocation(taskDesc);
+
+                // Pass the exception
+                throw new Exception(e);
+            }
+        }
+    }
+
+    /**
+     * Advice that processes methods execution without applying any transactional
+	 * mechanisms.
+     *
+     * @param invocation is the method's invocation.
+     * @return the object returned by the method.
+     * @throws Throwable is any exception that should be propagated.
+     */
+    private Object internalProcess(MethodInvocation invocation) throws Throwable
+    {
+        log.info("internalProcess()");
+        return invocation.invokeNext();
+    }
+
+    /**
+     * Advice that returns the required DataManager object for every read
+     * access to the DataManager object annotated by the @BADataManagement
+	 * annotation.
+     *
+     * @param invocation is the read access of the DataManager field.
+     * @return the object returned by the method.
+     * @throws Throwable is any exception that should be propagated.
+     */
+    public Object access(FieldReadInvocation invocation) throws Throwable
+    {
+        log.info("Returning datamgmt manager for thread: " + Thread.currentThread().getId());
+        return cmp.getManager(Thread.currentThread().getId());
+    }
+
+    /**
+     * Advice that prevents from setting the annotated DataManager object.
+     *
+     * @param invocation is the write access of the DataManager field.
+     * @return the object returned by the method.
+     * @throws Throwable is any exception that should be propagated.
+     */
+    public Object access(FieldWriteInvocation invocation) throws Throwable
+    {
+        throw new RuntimeException("Setting a @BADataManagement variable is illegal.");
+    }
+
+}

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/WSConfiguredDII.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/WSConfiguredDII.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/WSConfiguredDII.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -24,19 +24,51 @@
 import org.jboss.txbridge.ba.data.TaskDescription;
 import org.jboss.txbridge.ba.exception.ActionExecutionException;
 import org.jboss.txbridge.ba.service.MethodDescription;
+import org.jboss.ws.core.jaxrpc.client.ServiceImpl;
 
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceFactory;
+import javax.xml.rpc.Call;
+import java.net.URL;
+
 /**
  * This class provides implementation of the Web Services Configured DII execution.
  *
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
  */
-public class WSConfiguredDII implements Executable {
+public class WSConfiguredDII implements Executable
+{
     // Logger
     private static Logger log = Logger.getLogger(WSConfiguredDII.class);
 
-    public void invokeService(TaskDescription taskDesc, MethodDescription md, Object[] arguments, Class[] argumentTypes) throws ActionExecutionException {
-        log.info("invoke()");
-        
+    public void invokeService(TaskDescription taskDesc, MethodDescription md, Object[] arguments, Class[] argumentTypes)
+            throws ActionExecutionException
+    {
+        log.info("invokeService()");
+        try
+        {
+            // Get data
+            String endpointAddress = md.getEndpointAddress();
+            String targetNamespace = md.getTargetNamespace();
+            String serviceName = md.getServiceName();
+
+            // Construct a call
+            ServiceFactory factory = ServiceFactory.newInstance();
+            URL wsdlLocation = new URL(endpointAddress);
+            QName qName = new QName(targetNamespace,serviceName);
+            ServiceImpl service = (ServiceImpl)factory.createService(wsdlLocation,qName);
+            Call call = service.createCall();
+            QName operationName = new QName(targetNamespace,md.getMethodName());
+            call.setOperationName(operationName);
+
+            // Invoke the service
+            call.invoke(arguments);
+
+        }
+        catch (Exception e)
+        {
+            throw new ActionExecutionException(e);
+        }
     }
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/BAServiceVisitor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/BAServiceVisitor.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/BAServiceVisitor.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -82,6 +82,9 @@
         Class[] baInterface = null;
         String baJndiName = null;
         String baProviderURL = null;
+        String endpointAddress = null;
+        String targetNamespace = null;
+        String serviceName = null;
         BAService BAServiceAnnotation = (BAService) methodClass.getAnnotation(BAService.class);
         if (BAServiceAnnotation != null)
         {
@@ -94,7 +97,9 @@
             log.info("JNDI name: " + baJndiName);
             baProviderURL = BAServiceAnnotation.providerURL();
             log.info("Provider URL: " + baProviderURL);
-
+            endpointAddress = BAServiceAnnotation.wsdl();
+            targetNamespace = BAServiceAnnotation.namespace();
+            serviceName = BAServiceAnnotation.serviceName();
         }
 
         // Check if there is a WebMethod annotation
@@ -204,8 +209,8 @@
                 }
                 md.setClazz(compensationMethodClass);
 
-                // Checking if the datamgmt method exists
-                log.info("Checking if datamgmt method exists");
+                // Checking if the method exists
+                log.info("Checking if method exists");
                 Method[] methodList = compensationMethodClass.getMethods();
                 boolean methodFound = false;
                 for (Method singleMethod : methodList)
@@ -221,7 +226,7 @@
                         {
                             log.info("Compensation method has parameters");
 
-                            log.info("Setting datamgmt type");
+                            log.info("Setting parameter match type");
                             md.setParameterTypes(singleMethod.getParameterTypes());
 
                             // Remember annotations of the parameters of the datamgmt method
@@ -270,6 +275,12 @@
                 }
 
             }
+            else if (compensationMode == ExecutionMode.DII)
+            {
+                md.setEndpointAddress(baComp.wsdl());
+                md.setTargetNamespace(baComp.namespace());
+                md.setServiceName(baComp.serviceName());
+            }
             else if (compensationMode == ExecutionMode.EJB)
             {
 
@@ -563,12 +574,12 @@
             md.setSingle(baCompleted.single());
 
             // Get Completion mode
-            ExecutionMode CompletionMode = baCompleted.mode();
+            ExecutionMode completionMode = baCompleted.mode();
             md.setExecutionMode(baCompleted.mode());
-            log.info("Completion mode: " + CompletionMode);
+            log.info("Completion mode: " + completionMode);
 
             // Get information according to the required Completion
-            if (CompletionMode == ExecutionMode.POJO)
+            if (completionMode == ExecutionMode.POJO)
             {
                 // We need following information
                 // 1) Method name (already obtained)
@@ -662,8 +673,14 @@
                 }
 
             }
-            else if (CompletionMode == ExecutionMode.EJB)
+            else if (completionMode == ExecutionMode.DII)
             {
+                md.setEndpointAddress(baComp.wsdl());
+                md.setTargetNamespace(baComp.namespace());
+                md.setServiceName(baComp.serviceName());
+            }
+            else if (completionMode == ExecutionMode.EJB)
+            {
 
                 // We need following information
                 // 1) Method name (already obtained)
@@ -971,7 +988,7 @@
             if (returnType == null)
             {
                 throw new MethodIncorrectlyAnnotatedException("BAResult used on method with no return value!");
-            }           
+            }
             String returnName = baResult.value();
             if (!returnName.equals(""))
             {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -97,11 +97,11 @@
 
                 // If the execution is remote than use remote executor. Otherwise use the local one.
                 // TODO: Following "if" statement is bad - I should change that -> factory! :)
-                MethodDescription completeMethod = sd.getMethod("complete");
+                MethodDescription completeMethod = sd.getMethod("completeant d");
                 ExecutionMode executionMode = completeMethod.getExecutionMode();
                 log.info("Execution mode: " + executionMode);
                 ServiceExecutor se;
-                if (executionMode == ExecutionMode.UDII)
+                if (executionMode == ExecutionMode.DII)
                 {
                     // Use the remote executor.
                     log.info("Using remote executor");

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/Participant.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/Participant.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/Participant.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -283,7 +283,7 @@
         ExecutionMode executionMode = compensationMethod.getExecutionMode();
         log.info("Execution mode: " + executionMode);
         ServiceExecutor se;
-        if (executionMode == ExecutionMode.UDII)
+        if (executionMode == ExecutionMode.DII)
         {
             // Use the remote executor.
             log.info("Using remote executor");

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescription.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescription.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescription.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -80,12 +80,26 @@
 
     void setDataMatch(DataMatch compensationType);
 
-    public ExecutionMode getExecutionMode();
+    ExecutionMode getExecutionMode();
 
-    public void setExecutionMode(ExecutionMode compensationMode);
+    void setExecutionMode(ExecutionMode compensationMode);
 
-    public ParameterMatch getParameterMatch();
+    ParameterMatch getParameterMatch();
 
-    public void setParameterMatch(ParameterMatch parameterMatch);
+    void setParameterMatch(ParameterMatch parameterMatch);
 
+    String getEndpointAddress();
+
+    void setEndpointAddress(String endpointAddress);
+
+    String getTargetNamespace();
+
+    void setTargetNamespace(String targetNamespace);
+
+    String getServiceName();
+
+    void setServiceName(String serviceName);
+
+
+
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescriptionImpl.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescriptionImpl.java	2007-09-05 20:03:00 UTC (rev 14902)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescriptionImpl.java	2007-09-05 21:46:18 UTC (rev 14903)
@@ -49,6 +49,9 @@
     private ParameterMatch parameterMatch;
     private String jndiName;
     private String providerURL;
+    private String endpointAddress;
+    private String targetNamespace;
+    private String serviceName;
 
     public Class getClazz()
     {
@@ -189,4 +192,29 @@
     {
         this.ejbInterface = ejbInterface;
     }
+
+
+    public String getEndpointAddress() {
+        return endpointAddress;
+    }
+
+    public void setEndpointAddress(String endpointAddress) {
+        this.endpointAddress = endpointAddress;
+    }
+
+    public String getTargetNamespace() {
+        return targetNamespace;
+    }
+
+    public void setTargetNamespace(String targetNamespace) {
+        this.targetNamespace = targetNamespace;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
 }




More information about the jboss-svn-commits mailing list