[jboss-svn-commits] JBL Code SVN: r15414 - in labs/jbosstm/workspace/baframework/trunk: demo and 10 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Sep 27 19:30:01 EDT 2007


Author: maciej.machulak
Date: 2007-09-27 19:30:01 -0400 (Thu, 27 Sep 2007)
New Revision: 15414

Modified:
   labs/jbosstm/workspace/baframework/trunk/build.xml
   labs/jbosstm/workspace/baframework/trunk/changelog.txt
   labs/jbosstm/workspace/baframework/trunk/demo/build.xml
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/about.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/author.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookcasino.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookfitness.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookroom.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelcasino.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelmeal.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelpackage.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelroom.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/decreaserating.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/getpackage.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/hotelinfo.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/increaserating.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/index.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/initialise.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/resources/web/ordermeal.jsp
   labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/client/HotelService.java
   labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/CustomerEntityImpl.java
   labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/Hotel.java
   labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/HotelImpl.java
   labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/OrderEntityImpl.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/BATransactionManager.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/SingleTransactionManager.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DataManagerProvider.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DummyDataManager.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/ExecutionDataProviderImpl.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodIncorrectlyAnnotatedException.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodNotAccessibleException.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ArgumentsProvider.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/EJBExecution.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalExecution.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/RemoteServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ServiceExecutor.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/DataManagement.java
   labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.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:
Debugged code - towards version 0.2.2

Modified: labs/jbosstm/workspace/baframework/trunk/build.xml
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/build.xml	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/build.xml	2007-09-27 23:30:01 UTC (rev 15414)
@@ -24,15 +24,15 @@
 <project name="BAFramework" default="dist" basedir=".">
 
     <!-- You should modify the next two lines -->
-    <property name="jboss.home" location="C:/RedHat/JBossAS/build/output/jboss-4.2.0.GA"/>
-    <property name="xts.home" location="C:/RedHat/JBossTSSP5/XTS/xts-install"/>
-	
-	<!-- You should not need to modify anything below this point -->
-	<property name="jboss.profile" value="all"/>
-	<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="jboss.home" location="/home/raistlin/Desktop/RedHat/jboss-4.2.1.GA"/>
+    <property name="xts.home" location="/home/raistlin/Desktop/RedHat/jbossts/xts/xts-install"/>
+
+    <!-- You should not need to modify anything below this point -->
+    <property name="jboss.profile" value="all"/>
+    <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"/>
@@ -45,9 +45,9 @@
         </fileset>
         <fileset  dir="${jboss.server}/deploy/jbossws.sar">
             <include name="jboss-jaxws.jar"/>
-			<include name="jbossws-core.jar"/>
+            <include name="jbossws-core.jar"/>
             <include name="saaj-api.jar"/>
-			<include name="stax-api.jar"/>
+            <include name="stax-api.jar"/>
         </fileset>
         <fileset dir="${xts.home}/lib">
             <include name="*.jar"/>
@@ -55,17 +55,17 @@
             <include name="ext/jbossts-common.jar"/>
         </fileset>
         <fileset dir="${javaee.dir}">
-			<include name="jboss-ejb3x.jar"/>
-			<include name="ejb3-persistence.jar"/>
-			<include name="jboss-saaj.jar"/>
-			<include name="jboss-j2ee.jar"/>
+            <include name="jboss-ejb3x.jar"/>
+            <include name="ejb3-persistence.jar"/>
+            <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>
+        <fileset dir="${jaxrpc.dir}">
+            <include name="jboss-jaxrpc.jar"/>
+        </fileset>
+        <fileset dir="${jboss.aop.dir}">
+            <include name="jboss-aop-jdk50.jar"/>
+        </fileset>
     </path>
 
     <target name="clean" description="clean up">
@@ -83,7 +83,7 @@
             <classpath refid="classpath"/>
         </javac>
     </target>
-    
+
     <target name="docs" depends="compile" description="create documentation">
         <javadoc destdir="${doc}/api" packagenames="*" private="true">
             <sourcepath>
@@ -93,7 +93,7 @@
                 <path refid="classpath"/>
             </classpath>
         </javadoc>
-    </target>    
+    </target>
 
     <target name="dist" depends="docs" description="generate the distribution">
         <jar jarfile="${build}/baframework.aop">

Modified: labs/jbosstm/workspace/baframework/trunk/changelog.txt
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/changelog.txt	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/changelog.txt	2007-09-27 23:30:01 UTC (rev 15414)
@@ -1,3 +1,8 @@
+Thu Sep 28 00:12:00 GMT 2007
+
+- support for compile time AOP
+- debugged code (preparing towards 0.2.2)
++---+
 Thu Sep 05 22:44:00 GMT 2007
 
 Release of the Business Activity Framework version 0.2.1

Modified: labs/jbosstm/workspace/baframework/trunk/demo/build.xml
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/build.xml	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/build.xml	2007-09-27 23:30:01 UTC (rev 15414)
@@ -24,14 +24,15 @@
 <project name="BADemo" default="ear" basedir=".">
 
     <!-- You should modify the next two lines -->
-    <property name="jboss.home" value="C:\RedHat\JBossAS\build\output\jboss-4.2.0.GA"/>    
-    <property name="xts.home" location="C:\RedHat\JBossTSSP5\XTS\xts-install"/>
+    <property name="jboss.home" value="/home/raistlin/Desktop/RedHat/jboss-4.2.1.GA"/>
+    <property name="xts.home" location="/home/raistlin/Desktop/RedHat/jbossts/xts/xts-install"/>
 
-	<!-- You should not need to modify anything below this point -->
-    <property name="jboss.profile" value="all"/>
-	<property name="jboss.server" value="${jboss.home}/server/${jboss.profile}"/>
+    <!-- You should not need to modify anything below this point -->
+    <property name="jboss.profile" value="default"/>
+    <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="baframework.dir" value="..\build"/>
-	<property name="build.dir" value="build"/>
+    <property name="build.dir" value="build"/>
     <property name="build.config" value="${build.dir}/config"/>
     <property name="src.dir" value="src"/>
     <property name="doc.dir" value="doc"/>
@@ -70,12 +71,22 @@
         </fileset>
         <fileset dir="${jboss.server}/deploy/jbossws.sar" includes="*.jar"/>
         <fileset dir="${baframework.dir}" includes="baframework-client.jar"/>
+        <fileset dir="${jboss.aop.dir}" includes="jboss-aop-jdk50.jar"/>
     </path>
 
     <path id="build.classpath">
         <pathelement location="${build.dir}/classes"/>
     </path>
 
+    <path id="run.classpath">
+        <path refid="classpath"/>
+        <path refid="build.classpath"/>
+    </path>
+
+    <path id="jboss.aop.classpath">
+        <fileset dir="${jboss.aop.dir}" includes="jboss-aop-jdk50.jar"/>
+    </path>
+
     <target name="compile" depends="init" description="compile the source">
         <mkdir dir="${build.dir}"/>
         <javac destdir="${build.dir}/classes" classpathref="classpath">
@@ -103,7 +114,7 @@
         <jar destfile="${build.dir}/config.jar" basedir="${build.config}"/>
     </target>
 
-    <target name="service" depends="compile, config" description="make the service distribution">
+    <target name="service" depends="aopc, config" description="make the service distribution">
         <copy file="${resources.dir}/jaxws-handlers-server.xml" todir="${build.dir}/classes/com/jboss/ba/demo/service/"/>
         <jar destfile="${build.dir}/webapps/hotel.jar">
             <metainf dir="${resources.dir}">
@@ -133,7 +144,7 @@
                 <include name="*.jsp"/>
                 <include name="*.css"/>
                 <include name="*.jpg"/>
-				<include name="*.png"/>
+                <include name="*.png"/>
             </fileset>
         </war>
     </target>
@@ -149,6 +160,16 @@
         </ear>
     </target>
 
+    <taskdef name="aopc" classname="org.jboss.aop.ant.AopC" classpathref="jboss.aop.classpath"/>
+
+    <target name="aopc" depends="compile">
+        <aopc compilerclasspathref="run.classpath" verbose="false">
+            <classpath path="${build.dir}"/>
+            <src path="${build.dir}"/>
+            <aoppath path="../resources/jboss-aop.xml"/>
+        </aopc>
+    </target>
+
     <target name="deploy" description="deploy the ear file">
         <copy file="${build.dir}/bademo.ear" todir="${jboss.server}/deploy"/>
     </target>
@@ -156,4 +177,4 @@
     <target name="undeploy" description="delete the ear file from deployment directory">
         <delete file="${jboss.server}/deploy/bademo.ear"/>
     </target>
-</project>
\ No newline at end of file
+</project>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/about.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/about.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/about.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -98,36 +98,26 @@
     <hr>
 </div>
 
-
-
-
-
-
-
-
-
-
-
 <div id="body" align=center>
 
 <p align="center">
 <h1>Business Activity Framework Demo Application</h1>
 <h2>Help page</h2>
 <p align="left">
-    <b>Concept</b><br>
-    This is a simple Web-based demo application for the novel Business Activity framework. It helps with
-    understanding the basic concepts of using framework's API - metadata and additional operations which
-    increase the frameworks flexibility. For more information about the design of the framework and a more
-    detailed description of its API please consider documents located on the framework's website at:
+    <b>Concept</b><br>
+    The Business Activity Framework Demo Application aims to help users with understanding the basic concepts
+    of extended transactions. It provides information about the Business Activity Framework, which supports 
+    development of transactional Web Services with accordance to the Business Activity extended transaction
+    model. Users may familiarise themselves with the framework's API - metadata and additional operations.<br> 
+    More information about the framework's design and a detailed description of the framework's API can be found
+    on the Business Activity Framework website available at:
     <br><a href="http://labs.jboss.com/jbosstm/baframework/index.html">http://labs.jboss.com/jbosstm/baframework/index.html</a>
-    .<br>This website also includes a link to a forum where all questions regarding framework's design or usage are welcome.
+    .<br>This website also includes a link to a forum where all questions regarding framework's design or usage
+    can be posted (and are highly appreciated).
     <br>
     <br>
-    If no previous experience with extended transactions or Transactional Web Services is possesed, it is
-    strongly adviced to familiarise with materials presented in the <b>References</b> section on this page.
-    Mostly [1] and [2] are recommended.<br>
-	<br>
-	Links to abstract state diagrams of Agreement Protocols that are used in Business Activities:<a href="HotelService?page=bawpc.jsp"><i>BusinessAgreementWithParticipantCompletion</i></a> and <a href="HotelService?page=bawcc.jsp"><i>BusinessAgreementWithCoordinatorCompletion</i></a>
+    Documents concerning extended transaction models and transactional Web Services are listed in the <b>References</b> section on this page.<br><br>
+Links to abstract state diagrams of Agreement Protocols that are used in Business Activities:<a href="HotelService?page=bawpc.jsp"><i>BusinessAgreementWithParticipantCompletion</i></a> and <a href="HotelService?page=bawcc.jsp"><i>BusinessAgreementWithCoordinatorCompletion</i></a>
 </p>
 <p align="left">
     <b>Usage</b><br>
@@ -141,20 +131,27 @@
     </ul>
 </p>
 <p align="left">
-    <b>BA-related code</b>
-    <br>
-    All services are implemented as methods of a stateless session bean (HotelImpl class) accessible through a remote interface (Hotel class)
-    and exposed as Web Services using the JSR-181 annotations. The HotelImpl class is annotated with the BAService annotation to provide
-    common information related to completion and compensation actions.
+    <b>Demo application - Transactional Web Services</b><br>
+    Business Activity Framework Demo Application consists of a set of Web Services that are exposed as Business
+    Activity tasks (Transactional Web Services). Those Web Services represent a common functionality of a Hotel
+    Service (booking a room, ordering meals, etc). Presented set of Web Services have been chosen to show most
+    of the framework's functionality and present its API. Users may easily gain necessary knowledge about all
+    designed annotations and operations.<br><br>
+    All services are implemented as methods of a stateless session bean (HotelImpl class) accessible through a remote
+    interface (Hotel class) and exposed as Web Services using the JSR-181 annotations (@WebService and @WebMethod). Those  
+    Web Services are exposed as Business Activity tasks using the <b>@BAMethod</b> annotation. 
+    Additionally, the HotelImpl class is annotated with the <b>@BAService</b> annotation to provide common information related to completion and compensation actions. For
+more information about the API (annotations and additional operations) related to the Business Activity Framework please
+refer to [3].
 </p>
 <p>
     <div id="code">
 <pre>
 //...<br>
 <span class="annotation">@BAService</span>(serviceClass=<span class="id">HotelImpl.class</span>,<br>
-&#09;ejbInterface=<span class="id">Hotel.class</span>,<br>
-&#09;jndiName="<span class="id">bademo/HotelImpl/remote</span>")<br>
-public class HotelBAImpl implements HotelBA<br>
+&#09;&#09;ejbInterface=<span class="id">Hotel.class</span>,<br>
+&#09;&#09;jndiName="<span class="id">bademo/HotelImpl/remote</span>")<br>
+public class HotelImpl implements Hotel<br>
 {
 &#09;//...<br>
 }
@@ -162,18 +159,18 @@
     </div>
 </p>
 <p align="left">
-    Some methods that are exposed as Web Services make use of the Data Manager component provided by the Business Activity framework as shown in the code below.
+    Some methods that are exposed as transactional Web Services make use of the Data Manager component, which is transparently provided by the Business Activity Framework. This DataManager is declared as shown in the code below.
 </p>
 <p>
     <div id="code">
 
 <pre>
 //...<br>
-public class HotelBAImpl implements HotelBA<br>
+public class HotelImpl implements Hotel<br>
 {
 &#09;//...<br>
-&#09;<span class="annotation">@BADataManager</span><br>
-&#09;<span class="id">DataManager</span> cm;<br>
+&#09;<span class="annotation">@BADataManagement</span><br>
+&#09;<span class="id">DataManager</span> dm;<br>
 &#09;//...<br>
 }
 </pre>
@@ -181,37 +178,36 @@
 
 </p>
 <p align="left">
-    Some services may be used only within a scope of a Business Activity (BA services). Others may be use outside the Business Activity (Normal services) - they are however defined as compensation actions of the BA services.. These
-    services may be used to test behaviour of compensation mechanisms in case Isolation of service execution is not preserved - i.e.
-    a order has been cancelled outside the scope of a transaction).
+    The Hotel Service has two types of Web Services that are exposed:
+<ul>
+<li>Normal Web Services</li>
+<li>Transactional Web Services</li>
+</ul>
+</p>
+<p align="left">
+    Transactional Web Services may be used only within a scope of a Business Activity (BA services). Normal Web Services may be used outside the Business Activity. Both Transactional and Normal Web Services can be defined as compensation actions of different Business Activity tasks.
 </p>
 
-<p align="left">
-    Although description of each single method has been provided it is strongly adviced that users examine the source
-    code of Web Services when performing tests. Moreover, annotations on method descriptions have most of their member values
-    explicitly specified for learning purposes only. Because designed annotations have intuitive and reasonable default values already specified,
-    the actual code is less complex.
+<p align="left">
+    Description of each single method exposed as Normal or Transactional Web Services has been provided and may be
+    used by the user to further understand the basic idea behing the framework's mechanisms. However, it is still
+    strongly advised that users examine the actual source code of Web Services (HotelImpl class) when performing their tests. Provided descriptions of single Web Services contain full information about annotations that have been used
+and their member values. In the actual code, those annotations do not have all of the required member values explicitly specified (the framework uses intuitive defaults).
 </p>
 
 <p align="left">
-    <b>Web Services</b><br>
-    Business Activity Framework Demo Application consists of a set of Web Services that represents common
-    usage of the framework's API so that it is possible to gain knowledge about all designed annotations
-    and operations.<br>
-
-</p>
-<p align="left">
     <b>References</b><br>
     Following is the list of references which is worth considering when learning about Transactional Web Services (to be updated shortly):
     <ul>
         <li>[1] Little, M., J. Maron, and G. Pavlik, Java Transaction Processing: Design and Implementation, Prentice Hall PTR, New Jersey, USA, 2004.
         <li>[2] WS-BusinessActivity Specification, version 1.0. August 2005.  http://www.arjuna.com/library/specs/ws-tx/WS-BusinessActivity.pdf.
-
+        <li>[3] Machulak M.P. Transactional Web Services Programmer's API. http://labs.jboss.com/jbosstm/baframework/download/BAFrameworkAPI.pdf
+        <li>[4] Machulak M.P. Business Activity Framework Maintenance Guide. http://labs.jboss.com/jbosstm/baframework/download/BAFrameworkMG.pdf
     </ul>
 </p>
 <p align="left">
     <b>Questions</b><br>
-    Any questions related to the test application or the framework can be directed to the author at
+    Any questions related to the demo application or the framework can be sent to the author at
     <a href="mailto:mmachulak-at-redhat.com">mmachulak-at-redhat.com</a>. All constructive remarks are highly appreciated.
 </p>
 
@@ -229,4 +225,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/author.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/author.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/author.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -114,8 +114,8 @@
             <br>
             Maciej Machulak<br>
             <a href="mailto:mmachulak-at-redhat.com">mmachulak-at-redhat.com</a><br>
-            JBoss, a division of Red Hat, UK (Intern)<br>
-            University of Newcastle upon Tyne, UK (MSc student)<br>
+            JBoss, a division of Red Hat, UK (Software Development Intern)<br>
+            University of Newcastle upon Tyne, UK (MSc graduate)<br>
             Politechnika Wroclawska, Poland (MSc graduate)<br>
         </p>
 
@@ -131,4 +131,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookcasino.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookcasino.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookcasino.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -131,11 +131,6 @@
 </p>
 
 <p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
-<p align="left">
     <b>Method's signature</b><br>
 
     <div id="code">
@@ -153,23 +148,6 @@
 
     </div>
 
-</p>
-<p align="left">
-    <b>BA-related code</b>
-    <br>
-
-    <div id="code">
-
-<pre>
-{
-&#09;//...<br>
-&#09;dm.<span class="annotation">put</span>("<span class="id">refund</span>",amount/2);<br>
-&#09;//...<br>
-}
-</pre>
-    </div>
-
-</p>
 <p>
 </p>
 
@@ -177,13 +155,14 @@
     <b>Service description</b>
     <br>
     This service exchanges a given amount of money for a casino token. This token is a unique number meaningless
-    for the client but meaningful for the service (represents the exchanged money). It must be executed within a
-    Business Activity.<br>
+    for the client but meaningful for the hotel (represents the exchanged money). The client may later exchange
+    this token when using the hotel.<br>
+    The service must be executed within a Business Activity.<br>
     This service takes following parameters:
     <ul align="left">
         <li>Username
         <li>Password
-        <li>Amount of money to exchange for a casino token
+        <li>Amount of money to be exchanged for the casino token
     </ul>
 </p>
 <p align="left">
@@ -225,4 +204,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookfitness.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookfitness.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookfitness.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -147,7 +147,6 @@
 <span class="annotation">@BACompensatedBy</span>(value="<span class="id">cancelFitnessPass</span>",<br>
 &#09;type=DataMatch.<span class="enum">PARAMETERS_MATCH</span>,<br>
 &#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
- at TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)<br>
 public boolean bookFitnessPass(<span class="annotation">@BAParam</span>("<span
         class="id">username</span>")String username,<br>
 		<span class="annotation">@BAParam</span>("<span class="id">password</span>") String password,<br>
@@ -161,6 +160,23 @@
 
     </p>
 
+    <p align="left">
+    <b>BA-related code</b>
+    <br>
+
+    <div id="code">
+
+<pre>
+{
+&#09;//...<br>
+&#09;dm.<span class="annotation">put</span>("<span class="id">id</span>",uniqueId);<br>
+&#09;//...<br>
+}
+</pre>
+    </div>
+
+</p>
+
     <p>
     </p>
 
@@ -168,7 +184,11 @@
         <b>Service description</b>
         <br>
         This service books a given number of Fitness Passes for the given reservation number. It must be executed within
-        a Business Activity. All bookings for a given reservation are transient until the client decides to checkout.<br>
+        a Business Activity. All bookings for a given reservation are transient until the client decides to checkout. If
+        the client decides to checkout (requests the Business Activity to complete its work) then completion actions for
+        all invocations of this service will be executed. Each completion action will have access to a unique identifier,
+        which is stored during a normal invocation (therefore each completion action knows which invocation must be
+        completed.<br>
         This service takes following parameters:
         <ul align="left">
             <li>Username
@@ -202,7 +222,7 @@
     <p align="left">
         <b>Completion action</b>
         <br>
-        checkoutFitnessPass() <i>(executed implicitly when Business Activity completes)</i>
+        <a href="HotelService?page=checkout.jsp">checkoutFitnessPass()</a>
     </p>
 
     <p align="left">
@@ -223,4 +243,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookroom.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookroom.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/bookroom.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -142,10 +142,9 @@
 &#09;type=DataMatch.<span class="enum">CUSTOM</span>,<br>
 &#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
 <span class="annotation">@BAResult</span>("<span class="id">reservationNumber</span>")<br>
-public Integer bookRoom(<span class="annotation">@BAParam</span>("<span
-        class="id">username</span>")String username,<span class="annotation">@BAParam</span>("<span
-        class="id">password</span>")<br>
-String password, Integer roomNumber)<br>
+public Integer bookRoom(<span class="annotation">@BAParam</span>("<span class="id">username</span>")String username,<br>
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">password</span>")String password,<br>
+&#09;&#09;&#09;Integer roomNumber)<br>
 <br>
 throws HotelCustomException, RoomAlreadyOccupiedException
 </pre>
@@ -154,15 +153,33 @@
 
     </p>
 
+    </p>
+<p align="left">
+    <b>BA-related code</b>
+    <br>
+
+    <div id="code">
+
+<pre>
+{
+&#09;//...<br>
+&#09;dm.<span class="annotation">put</span>("<span class="id">refund</span>",refundValue);<br>
+&#09;//...<br>
+}
+</pre>
+    </div>
+
+</p>
+
     <p>
     </p>
 
     <p align="left">
         <b>Service description</b>
         <br>
-        This service books a single hotel room. It must be executed within a Business Activity. It also remembers a
-        refundValue so that if the booking is cancelled within a scope of a Business Activity then the customer does not
-        loose all the money.<br>
+        This service books a single hotel room. It must be executed within a Business Activity. It also uses
+        a DataManager object to store a refund value, which might be used if the Business Activity is requested
+        to compensate its work. The compensation task will simply use this refund value in its business logic.<br>
         This service takes following parameters:
         <ul align="left">
             <li>Username
@@ -213,4 +230,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelcasino.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelcasino.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelcasino.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -140,26 +140,6 @@
         </div>
 
     </p>
-    <p align="left">
-        <b>BA-related code</b>
-        <br>
-
-        <div id="code">
-
-<pre>
-{
-&#09;//...<br>
-&#09;Integer refund = (Integer) cm.<span class="annotation">get</span>("<span class="id">refund</span>")<br>
-&#09;if (refund != null)<br>
-&#09;{
-&#09;&#09;//...<br>
-&#09;}
-&#09;//...<br>
-}
-</pre>
-        </div>
-
-    </p>
     <p>
     </p>
 
@@ -169,7 +149,7 @@
         This service cancels a given casino token so that it becomes invalid. It does not support execution within a Business Activity.<br>
         This service takes following parameters:
         <ul align="left">
-            <li>Casino token to be cancelled
+            <li>Identifier of a casino token to be cancelled
         </ul>
     </p>
     <p align="left">
@@ -199,4 +179,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelmeal.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelmeal.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelmeal.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -140,8 +140,10 @@
 
 <pre>
 @WebMethod<br>
-public boolean cancelMeal(<span class="annotation">@BAParam</span>("<span class="id">user</span>")String username,<span class="annotation">@BAParam</span>("<span class="id">password</span>")<br>
-String password,<span class="annotation">@BAParam</span>("<span class="id">order</span>")Integer orderNumber)<br>
+public boolean cancelMeal(<span class="annotation">@BAParam</span>("<span class="id">user</span>")String username,<br>
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">password</span>")String password,<br>
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">reservation</span>")Integer reservationNumber,<br>
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">order</span>")Integer orderNumber)<br>
 <br>
 throws HotelCustomException;
 </pre>
@@ -155,12 +157,13 @@
     <p align="left">
         <b>Service description</b>
         <br>
-        This service books a given number of fitness passes for the given reservation. It does not support execution within a Business Activity.<br>
+        This service cancels a given meal order for the given reservation. It does not support execution within a Business Activity.<br>
         This service takes following parameters:
         <ul align="left">
             <li>Username
             <li>Password
-            <li>Reservation Number
+            <li>Reservation number
+            <li>Meal order number
         </ul>
     </p>
     <p align="left">
@@ -177,7 +180,7 @@
     </p>
     <p align="left">
         HotelCustomException is thrown if either the user cannot log in (username, password or both are incorrect)
-        or the reservation number is incorrect (reservation does not exist).
+        or the meal order number is incorrect (order does not exist).
     </p>
 
 
@@ -197,4 +200,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelpackage.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelpackage.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelpackage.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -1,196 +1,191 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
-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,
- at author JBoss Inc.
--->
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-    <title>Business Activity Framework Demo Application</title>
-    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
-    <meta http-equiv="content-language" content="en">
-    <meta name="author" content="Maciej Machulak">
-    <link rel="stylesheet" type="text/css" href="green.css"/>
-</head>
-<body>
-
-<div id="main">
-
-<div id="headerLeft">
-    <h1>Business Activity Framework Demo Application</h1>
-</div>
-
-<div id="headerRight">
-    <img src="jboss.jpg">
-</div>
-
-<div id="headerBottom">
-    Debug window (service return value):
-</div>
-
-<div id="headerDebug">
-    ${requestScope.DEBUG}
-</div>
-
-${requestScope.ACTIVE}
-
-<div id="menu">
-    <p>
-        <a href="HotelService?page=index.jsp">Home</a><br>
-        <a href="HotelService?page=about.jsp">About Demo Application</a><br>
-        <a href="HotelService?page=author.jsp">About Author</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?page=initialise.jsp" ${requestScope.INITIALISE}>Initialise data</a><br>
-        <a href="HotelService?method=dropHotelData&baRequest=false" ${requestScope.DROP}>Delete data</a><br>
-        <a href="HotelService?method=getHotelData&baRequest=false" ${requestScope.SHOW}>Show data</a><br>
-        <a href="HotelService?method=getHotelOrders&baRequest=true" ${requestScope.ORDER}>Show orders</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?method=startBA&baRequest=true" ${requestScope.BEGIN}>Begin Business Activity</a><br>
-    </p>
-    <hr>
-    <p>
-        <b>BA services:</b><br>
-        <a href="HotelService?page=hotelinfo.jsp" ${requestScope.BASERVICE}>Hotel Info</a><br>
-        <a href="HotelService?page=bookroom.jsp" ${requestScope.BASERVICE}>Book Room</a><br>
-        <a href="HotelService?page=getpackage.jsp" ${requestScope.BASERVICE}>Get Package</a><br>
-        <a href="HotelService?page=bookfitness.jsp" ${requestScope.BASERVICE}>Book Fitness</a><br>
-        <a href="HotelService?page=bookcasino.jsp" ${requestScope.BASERVICE}>Book Casino</a><br>
-        <a href="HotelService?page=ordermeal.jsp" ${requestScope.BASERVICE}>Order Meal</a><br>
-        <a href="HotelService?page=increaserating.jsp" ${requestScope.BASERVICE}>Increase Rating</a><br>
-        <a href="HotelService?page=decreaserating.jsp" ${requestScope.BASERVICE}>Decrease Rating</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?method=completeBA&baRequest=true" ${requestScope.COMPLETE}>Complete Business Activity</a><br>
-        <a href="HotelService?method=closeBA&baRequest=true" ${requestScope.CLOSE}>Close Business Activity</a><br>
-        <a href="HotelService?method=cancelBA&baRequest=true" ${requestScope.CANCEL}>Cancel Business Activity</a><br>
-    </p>
-    <hr>
-    <p>
-        <b>Normal services:</b><br>
-        <a href="HotelService?page=cancelroom.jsp" ${requestScope.SERVICE}>Cancel Room</a><br>
-        <a href="HotelService?page=cancelpackage.jsp" ${requestScope.SERVICE}>Cancel Package</a><br>
-        <a href="HotelService?page=cancelfitness.jsp" ${requestScope.SERVICE}>Cancel Fitness</a><br>
-        <a href="HotelService?page=cancelcasino.jsp" ${requestScope.SERVICE}>Cancel Casino</a><br>
-        <a href="HotelService?page=cancelmeal.jsp" ${requestScope.SERVICE}>Cancel Meal</a><br>
-    </p>
-    <hr>
-</div>
-
-<div id="body" align=center>
-
-    <p align="center">
-
-        <form action="HotelService?method=cancelComplimentaryPackageNumber&baRequest=false&continue=cancelpackage.jsp" method="post">
-            <fieldset class="medium">
-                <legend>cancelComplimentaryPackageNumber()</legend>
-
-                <p>
-                    <label for="username">Username</label>
-                    <input type="text" name="parameters" value="user1"/>
-                    <br>
-                    <label for="password">Password</label>
-                    <input type="text" name="parameters" value="pass1"/>
-                    <br>
-                    <label for="room">Reservation number</label>
-                    <input type="text" name="parameters"/>
-                </p>
-
-                <input type="submit" value="Invoke Web Service"/>
-
-            </fieldset>
-        </form>
-
-    </p>
-
-    <p align="left">
-        <b>Method's class</b><br>
-        com.jboss.ba.demo.service.HotelImpl
-    </p>
-
-    <p align="left">
-        <b>Method's signature</b><br>
-
-        <div id="code">
-
-<pre>
- at WebMethod<br>
-public boolean cancelComplimentaryPackageNumber(String username, String password,<br>
-Integer reservationNumber)<br>
-<br>
-throws HotelCustomException
-</pre>
-
-        </div>
-
-    </p>
-
-    <p>
-    </p>
-
-    <p align="left">
-        <b>Service description</b>
-        <br>
-        This service cancels a unique number of a complimentary package (which might be a bonus for booking a hotel room within a BA). It does not support execution within a Business Activity.<br>
-        This service takes following parameters:
-        <ul>
-            <li>Username
-            <li>Password
-            <li>Reservation Number
-        </ul>
-    </p>
-    <p align="left">
-        This service returns:
-        <ul align="left">
-            <li>Boolean value that specifies whether cancelling was successful or not
-        </ul>
-    </p>
-    <p align="left">
-        It throws following exceptions:
-        <ul align="left">
-            <li>HotelCustomException
-        </ul>
-    </p>
-    <p align="left">
-        HotelCustomException is thrown if either the user cannot log in (username, password or both are incorrect)
-        or the reservation number is incorrect (reservation does not exist).
-    </p>
-
-</div>
-
-
-
-
-
-
-<div id="footer">
-    <p align=right>
-        &copy; JBoss, a division of Red Hat
-    </p>
-</div>
-
-</div>
-
-</body>
-</html>
\ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<!--
+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,
+ at author JBoss Inc.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>Business Activity Framework Demo Application</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
+    <meta http-equiv="content-language" content="en">
+    <meta name="author" content="Maciej Machulak">
+    <link rel="stylesheet" type="text/css" href="green.css"/>
+</head>
+<body>
+
+<div id="main">
+
+<div id="headerLeft">
+    <h1>Business Activity Framework Demo Application</h1>
+</div>
+
+<div id="headerRight">
+    <img src="jboss.jpg">
+</div>
+
+<div id="headerBottom">
+    Debug window (service return value):
+</div>
+
+<div id="headerDebug">
+    ${requestScope.DEBUG}
+</div>
+
+${requestScope.ACTIVE}
+
+<div id="menu">
+    <p>
+        <a href="HotelService?page=index.jsp">Home</a><br>
+        <a href="HotelService?page=about.jsp">About Demo Application</a><br>
+        <a href="HotelService?page=author.jsp">About Author</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?page=initialise.jsp" ${requestScope.INITIALISE}>Initialise data</a><br>
+        <a href="HotelService?method=dropHotelData&baRequest=false" ${requestScope.DROP}>Delete data</a><br>
+        <a href="HotelService?method=getHotelData&baRequest=false" ${requestScope.SHOW}>Show data</a><br>
+        <a href="HotelService?method=getHotelOrders&baRequest=true" ${requestScope.ORDER}>Show orders</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?method=startBA&baRequest=true" ${requestScope.BEGIN}>Begin Business Activity</a><br>
+    </p>
+    <hr>
+    <p>
+        <b>BA services:</b><br>
+        <a href="HotelService?page=hotelinfo.jsp" ${requestScope.BASERVICE}>Hotel Info</a><br>
+        <a href="HotelService?page=bookroom.jsp" ${requestScope.BASERVICE}>Book Room</a><br>
+        <a href="HotelService?page=getpackage.jsp" ${requestScope.BASERVICE}>Get Package</a><br>
+        <a href="HotelService?page=bookfitness.jsp" ${requestScope.BASERVICE}>Book Fitness</a><br>
+        <a href="HotelService?page=bookcasino.jsp" ${requestScope.BASERVICE}>Book Casino</a><br>
+        <a href="HotelService?page=ordermeal.jsp" ${requestScope.BASERVICE}>Order Meal</a><br>
+        <a href="HotelService?page=increaserating.jsp" ${requestScope.BASERVICE}>Increase Rating</a><br>
+        <a href="HotelService?page=decreaserating.jsp" ${requestScope.BASERVICE}>Decrease Rating</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?method=completeBA&baRequest=true" ${requestScope.COMPLETE}>Complete Business Activity</a><br>
+        <a href="HotelService?method=closeBA&baRequest=true" ${requestScope.CLOSE}>Close Business Activity</a><br>
+        <a href="HotelService?method=cancelBA&baRequest=true" ${requestScope.CANCEL}>Cancel Business Activity</a><br>
+    </p>
+    <hr>
+    <p>
+        <b>Normal services:</b><br>
+        <a href="HotelService?page=cancelroom.jsp" ${requestScope.SERVICE}>Cancel Room</a><br>
+        <a href="HotelService?page=cancelpackage.jsp" ${requestScope.SERVICE}>Cancel Package</a><br>
+        <a href="HotelService?page=cancelfitness.jsp" ${requestScope.SERVICE}>Cancel Fitness</a><br>
+        <a href="HotelService?page=cancelcasino.jsp" ${requestScope.SERVICE}>Cancel Casino</a><br>
+        <a href="HotelService?page=cancelmeal.jsp" ${requestScope.SERVICE}>Cancel Meal</a><br>
+    </p>
+    <hr>
+</div>
+
+<div id="body" align=center>
+
+    <p align="center">
+
+        <form action="HotelService?method=cancelComplimentaryPackageNumber&baRequest=false&continue=cancelpackage.jsp" method="post">
+            <fieldset class="medium">
+                <legend>cancelComplimentaryPackageNumber()</legend>
+
+                <p>
+                    <label for="username">Username</label>
+                    <input type="text" name="parameters" value="user1"/>
+                    <br>
+                    <label for="password">Password</label>
+                    <input type="text" name="parameters" value="pass1"/>
+                </p>
+
+                <input type="submit" value="Invoke Web Service"/>
+
+            </fieldset>
+        </form>
+
+    </p>
+
+    <p align="left">
+        <b>Method's class</b><br>
+        com.jboss.ba.demo.service.HotelImpl
+    </p>
+
+    <p align="left">
+        <b>Method's signature</b><br>
+
+        <div id="code">
+
+<pre>
+ at WebMethod<br>
+public boolean cancelComplimentaryPackageNumber(String username, String password)<br>
+<br>
+throws HotelCustomException
+</pre>
+
+        </div>
+
+    </p>
+
+    <p>
+    </p>
+
+    <p align="left">
+        <b>Service description</b>
+        <br>
+        This service invalidates a unique number of a complimentary package. Each user is entitled to a single package so
+that this service (if executed as a compensation action) is invoked only once despite possible multiple invocations of the original action(<i>getComplimentaryPackageNumber()</i>). This service does not support execution within a Business Activity.<br>
+        This service takes following parameters:
+        <ul>
+            <li>Username
+            <li>Password
+        </ul>
+    </p>
+    <p align="left">
+        This service returns:
+        <ul align="left">
+            <li>Boolean value that specifies whether cancelling was successful or not
+        </ul>
+    </p>
+    <p align="left">
+        It throws following exceptions:
+        <ul align="left">
+            <li>HotelCustomException
+        </ul>
+    </p>
+    <p align="left">
+        HotelCustomException is thrown if the user cannot log in (username, password or both are incorrect).
+    </p>
+
+</div>
+
+
+
+
+
+
+<div id="footer">
+    <p align=right>
+        &copy; JBoss, a division of Red Hat
+    </p>
+</div>
+
+</div>
+
+</body>
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelroom.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelroom.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/cancelroom.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -144,7 +144,27 @@
 
         </div>
     </p>
+    <p align="left">
+        <b>BA-related code</b>
+        <br>
 
+        <div id="code">
+
+<pre>
+{
+&#09;//...<br>
+&#09;Integer refundValue = (Integer) dm.<span class="annotation">get</span>("<span class="id">refund</span>");<br>
+&#09;if (refundValue != null)<br>
+&#09;{<br>
+&#09;&#09;//... business logic<br>
+&#09;}<br>
+&#09;//...<br>
+}
+</pre>
+        </div>
+
+    </p>
+
     <p>
 
     </p>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/decreaserating.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/decreaserating.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/decreaserating.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -130,11 +130,6 @@
         com.jboss.ba.demo.service.HotelImpl
     </p>
 
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
     <p align="left">
         <b>Method's signature</b><br>
 
@@ -144,7 +139,8 @@
 @WebMethod<br>
 <span class="annotation">@BAMethod</span>(AgreementType.<span class="enum">PARTICIPANT_COMPLETION</span>,MethodType.<span class="enum">MODIFY</span>)<br>
 <span class="annotation">@BACompensatedBy</span>(value="<span class="id">increaseHotelRating</span>",<br>
-&#09;type=DataMatch..<span class="enum">PARAMETERS_MATCH</span>)<br>
+&#09;type=DataMatch.<span class="enum">PARAMETERS_MATCH</span>,<br>
+&#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
 public void decreaseHotelRating(String username,String password,Integer points)<br>
 <br>
 throws HotelCustomException
@@ -206,4 +202,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/getpackage.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/getpackage.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/getpackage.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -114,9 +114,6 @@
                     <br>
                     <label for="password">Password</label>
                     <input type="text" name="parameters" value="pass1"/>
-                    <br>
-                    <label for="reservation">Reservation number</label>
-                    <input type="text" name="parameters"/>
                 </p>
 
                 <input type="submit" value="Invoke Web Service"/>
@@ -131,11 +128,6 @@
         com.jboss.ba.demo.service.HotelImpl
     </p>
 
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
     <p align="left">
         <b>Method's signature</b><br>
 
@@ -148,8 +140,7 @@
 &#09;single=<span class="id">true</span>,<br>
 &#09;type=DataMatch..<span class="enum">PARAMETERS_MATCH</span>)<br>
 &#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
-public Integer getComplimentaryPackageNumber(String username, String password,<br>
-Integer reservationNumber)<br>
+public Integer getComplimentaryPackageNumber(String username, String password)<br>
 <br>
 throws HotelCustomException
 </pre>
@@ -164,18 +155,15 @@
     <p align="left">
         <b>Service description</b>
         <br>
-        This service asks for a unique number of a complimentary package (which might be a bonus for booking a hotel
-        room within a BA).
-        Only one bonus per business activity is available so that if this method is executed multiple times within the
-        same
-        business activity, exactly the same number of a complimentary package will be returned. Therefore - this method
-        is compensated only once (it does not matter how many times it has been executed within a transaction).
-        It must be executed within a Business Activity.<br>
+        This service asks for a unique number of a complimentary package. Each single user is only entitled to a single
+        complimentary package - even if the user requests the package number multiple times, exactly the same number of
+        a complimentary package will be returned. Therefore - this service is compensated only once (it is necessary
+        to cancel a package only once).
+        This service must be executed within a Business Activity.<br>
         This service takes following parameters:
         <ul align="left">
             <li>Username
             <li>Password
-            <li>Reservation Number
         </ul>
     </p>
     <p align="left">
@@ -191,8 +179,7 @@
         </ul>
     </p>
     <p align="left">
-        HotelCustomException is thrown if either the user cannot log in (username, password or both are incorrect)
-        or the reservation number is incorrect (reservation does not exist).
+        HotelCustomException is thrown if the user cannot log in (username, password or both are incorrect).
     </p>
 
 <p align="left">

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/hotelinfo.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/hotelinfo.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/hotelinfo.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -117,11 +117,6 @@
         com.jboss.ba.demo.service.HotelImpl
     </p>
 
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
     <p align="left">
         <b>Method's signature</b><br>
 
@@ -143,15 +138,15 @@
     <p align="left">
         <b>Service description</b>
         <br>
-        This method simply returns a String object that contains information about the hotel. It may be executed within
-        or outside a Business Activity. This method is read-only and does not require any compensation to be specified.<br>
-        This service does not require any parameters.<br>
+        This service simply returns a String object that contains information about the hotel. It must be executed within
+        a scope of a Business Activity. This method is read-only and does not require any compensation to be specified.<br>
+        This service does not require any arguments.<br>
         This service does not throw any exceptions.
     </p>
     <p align="left">
         This service returns:
         <ul align="left">
-            <li>Service description
+            <li>Service description (a String object)
         </ul>
     </p>
 
@@ -160,12 +155,6 @@
     <a href="HotelService?page=bawpc.jsp">Business Agreement With Participant Completion</a>
 </p>
 	
-	<p align="left">
-        <b>Compensation action</b>
-        <br>
-        None
-    </p>
-
 </div>
 
 
@@ -182,4 +171,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/increaserating.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/increaserating.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/increaserating.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -130,11 +130,6 @@
         com.jboss.ba.demo.service.HotelImpl
     </p>
 
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
     <p align="left">
         <b>Method's signature</b><br>
 
@@ -144,7 +139,8 @@
 @WebMethod<br>
 <span class="annotation">@BAMethod</span>(AgreementType.<span class="enum">PARTICIPANT_COMPLETION</span>,MethodType.<span class="enum">MODIFY</span>)<br>
 <span class="annotation">@BACompensatedBy</span>(value="<span class="id">decreaseHotelRating</span>",<br>
-&#09;type=DataMatch.<span class="enum">PARAMETERS_MATCH</span>)<br>
+&#09;type=DataMatch.<span class="enum">PARAMETERS_MATCH</span>,<br>
+&#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
 public void increaseHotelRating(String username,String password,Integer points)<br>
 <br>
 throws HotelCustomException
@@ -206,4 +202,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/index.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/index.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/index.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -150,6 +150,15 @@
         <a href="HotelService?page=cancelcasino.jsp" <%=serviceAttr%>>Cancel Casino</a><br>
         <a href="HotelService?page=cancelmeal.jsp" <%=serviceAttr%>>Cancel Meal</a><br>
     </p>
+    <hr>
+    <p>
+        <b>Normal services:</b><br>
+        <a href="HotelService?page=cancelroom.jsp" <%=serviceAttr%>>Cancel Room</a><br>
+        <a href="HotelService?page=cancelpackage.jsp" <%=serviceAttr%>>Cancel Package</a><br>
+        <a href="HotelService?page=cancelfitness.jsp" <%=serviceAttr%>>Cancel Fitness</a><br>
+        <a href="HotelService?page=cancelcasino.jsp" <%=serviceAttr%>>Cancel Casino</a><br>
+        <a href="HotelService?page=cancelmeal.jsp" <%=serviceAttr%>>Cancel Meal</a><br>
+    </p>
     <hr>
 </div>
 
@@ -157,22 +166,23 @@
 
     <h1>Business Activity Framework Demo Application</h1>
     <p align="left">
-        <b>Overview</b><br>
-        The Business Activity Framework is a fully novel comprehensive solution for building
-        transactional Web Services with accordance to the model defined in the WS-BusinessActivity
-        specification. It provides a lightweight API that consists of a set of easy to learn and
-        intuitive annotations and operations. It significantly facilitates development of transaction
-        aware Web Services and releases programmers from mixing transaction related code with business
-        logic of their applications.
+        <b>Framework's overview</b><br>
+        The Business Activity Framework is a fully novel comprehensive solution that facilitates development of
+        transactional Web Services with accordance to the extended transaction model defined in the WS-BusinessActivity
+        specification. The framework provides a lightweight API that consists of a set of easy to learn and
+        intuitive annotations and operations. The programmers may expose Web Services as Business Activity tasks
+        (Transactional Web Services) with only few declarative statements and may wire up units of work with
+        their completion or compensation actions.
         Web Services must be simply annotated with a set of defined annotations and the framework
-        transparently applies all necessary transactional mechanisms to enable participation in
-        long-running Business Activities.
+        transparently applies all necessary transactional mechanisms so that Web Services may participate
+        in Business Activity like transactions. The framework ensures that completion actions will be correctly
+        executed as and when necessary.
     </p>
     <p align="left">
         <b>Quick start</b><br>
         This is a simple Web-based demo application for the novel Business Activity Framework. It helps with
-        understanding the basic concepts of using framework's API. To quickly start using this application
-        simply:
+        understanding the basic concepts of extended transactions and using the framework's API.<br> 
+To quickly start using this application simply:
         <ul>
             <li>Initialise data on the server -> <a href="HotelService?page=initialise.jsp">click here</a>
             <li>Start the Business Activity -> <a href="HotelService?method=startBA&baRequest=true">click here</a>
@@ -186,8 +196,8 @@
 
     </p>
     <p align="left">
-        BA Framework version: 0.2.0<br>
-        BA Demo Application version: 0.2.0<br>
+        BA Framework version: 0.2.2<br>
+        BA Demo Application version: 0.2.2<br>
     </p>
     <p align="center">
         <a href="http://labs.jboss.com/jbosstm/baframework">http://labs.jboss.com/jbosstm/baframework</a><br>
@@ -195,7 +205,7 @@
         <br>
         Maciej Machulak<br>
         <a href="mailto:mmachulak-at-redhat.com">mmachulak-at-redhat.com</a><br>
-        August 13, 2007<br>
+        August 26, 2007<br>
         JBoss, a division of Red Hat.
     </p>
 
@@ -211,4 +221,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/initialise.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/initialise.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/initialise.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -104,7 +104,7 @@
 
         <form action="HotelService?method=initialiseData&baRequest=false&continue=initialise.jsp" method="post">
             <fieldset class="medium">
-                <legend>Initialise beans</legend>
+                <legend>Initialise data (Entity Beans)</legend>
 
                 <p>
                     <label for="username1">Username #1</label>
@@ -156,4 +156,4 @@
 </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/resources/web/ordermeal.jsp
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/resources/web/ordermeal.jsp	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/resources/web/ordermeal.jsp	2007-09-27 23:30:01 UTC (rev 15414)
@@ -1,232 +1,230 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<!--
-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,
- at author JBoss Inc.
--->
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-    <title>Business Activity Framework Demo Application</title>
-    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
-    <meta http-equiv="content-language" content="en">
-    <meta name="author" content="Maciej Machulak">
-    <link rel="stylesheet" type="text/css" href="green.css"/>
-</head>
-<body>
-
-<div id="main">
-
-<div id="headerLeft">
-    <h1>Business Activity Framework Demo Application</h1>
-</div>
-
-<div id="headerRight">
-    <img src="jboss.jpg">
-</div>
-
-<div id="headerBottom">
-    Debug window (service return value):
-</div>
-
-<div id="headerDebug">
-    ${requestScope.DEBUG}
-</div>
-
-${requestScope.ACTIVE}
-
-<div id="menu">
-    <p>
-        <a href="HotelService?page=index.jsp">Home</a><br>
-        <a href="HotelService?page=about.jsp">About Demo Application</a><br>
-        <a href="HotelService?page=author.jsp">About Author</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?page=initialise.jsp" ${requestScope.INITIALISE}>Initialise data</a><br>
-        <a href="HotelService?method=dropHotelData&baRequest=false" ${requestScope.DROP}>Delete data</a><br>
-        <a href="HotelService?method=getHotelData&baRequest=false" ${requestScope.SHOW}>Show data</a><br>
-        <a href="HotelService?method=getHotelOrders&baRequest=true" ${requestScope.ORDER}>Show orders</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?method=startBA&baRequest=true" ${requestScope.BEGIN}>Begin Business Activity</a><br>
-    </p>
-    <hr>
-    <p>
-        <b>BA services:</b><br>
-        <a href="HotelService?page=hotelinfo.jsp" ${requestScope.BASERVICE}>Hotel Info</a><br>
-        <a href="HotelService?page=bookroom.jsp" ${requestScope.BASERVICE}>Book Room</a><br>
-        <a href="HotelService?page=getpackage.jsp" ${requestScope.BASERVICE}>Get Package</a><br>
-        <a href="HotelService?page=bookfitness.jsp" ${requestScope.BASERVICE}>Book Fitness</a><br>
-        <a href="HotelService?page=bookcasino.jsp" ${requestScope.BASERVICE}>Book Casino</a><br>
-        <a href="HotelService?page=ordermeal.jsp" ${requestScope.BASERVICE}>Order Meal</a><br>
-        <a href="HotelService?page=increaserating.jsp" ${requestScope.BASERVICE}>Increase Rating</a><br>
-        <a href="HotelService?page=decreaserating.jsp" ${requestScope.BASERVICE}>Decrease Rating</a><br>
-    </p>
-    <hr>
-    <p>
-        <a href="HotelService?method=completeBA&baRequest=true" ${requestScope.COMPLETE}>Complete Business Activity</a><br>
-        <a href="HotelService?method=closeBA&baRequest=true" ${requestScope.CLOSE}>Close Business Activity</a><br>
-        <a href="HotelService?method=cancelBA&baRequest=true" ${requestScope.CANCEL}>Cancel Business Activity</a><br>
-    </p>
-    <hr>
-    <p>
-        <b>Normal services:</b><br>
-        <a href="HotelService?page=cancelroom.jsp" ${requestScope.SERVICE}>Cancel Room</a><br>
-        <a href="HotelService?page=cancelpackage.jsp" ${requestScope.SERVICE}>Cancel Package</a><br>
-        <a href="HotelService?page=cancelfitness.jsp" ${requestScope.SERVICE}>Cancel Fitness</a><br>
-        <a href="HotelService?page=cancelcasino.jsp" ${requestScope.SERVICE}>Cancel Casino</a><br>
-        <a href="HotelService?page=cancelmeal.jsp" ${requestScope.SERVICE}>Cancel Meal</a><br>
-    </p>
-    <hr>
-</div>
-
-
-<div id="body" align=center>
-
-<p align="center">
-
-    <form action="HotelService?method=orderMeal&baRequest=true&continue=ordermeal.jsp" method="post">
-        <fieldset class="medium">
-            <legend>orderMeal()</legend>
-
-            <p>
-                <label for="username">Username</label>
-                <input type="text" name="parameters" value="user1"/>
-                <br>
-                <label for="password">Password</label>
-                <input type="text" name="parameters" value="pass1"/>
-                <br>
-                <label for="reservation">Reservation number</label>
-                <input type="text" name="parameters"/>
-            </p>
-
-            <input type="submit" value="Invoke Web Service"/>
-
-        </fieldset>
-    </form>
-
-</p>
-
-<p align="left">
-    <b>Method's class</b><br>
-    com.jboss.ba.demo.service.HotelImpl
-</p>
-
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    Business Agreement With Participant Completion
-</p>
-
-<p align="left">
-    <b>Method's signature</b><br>
-
-    <div id="code">
-
-<pre>
- at WebMethod<br>
-<span class="annotation">@BAMethod</span>(AgreementType.<span class="enum">PARTICIPANT_COMPLETION</span>,MethodType.<span class="enum">MODIFY</span>)<br>
-<span class="annotation">@BACompensatedBy</span>(value="<span class="id">cancelMeal</span>",<br>
-&#09;type=DataMatch.<span class="enum">CUSTOM</span>,<br>
-&#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
-public MealOrder orderMeal(<span class="annotation">@BAParam</span>("<span class="id">user</span>")String username,<br>
-&#09;<span class="annotation">@BAParam</span>("<span class="id">password</span>")String password, Integer reservationNumber)<br>
-<br>
-throws HotelCustomException
-</pre>
-    </div>
-
-</p>
-
-<p align="left">
-    <b>BA-related code</b>
-    <br>
-
-    <div id="code">
-
-<pre>
-{
-&#09;//...<br>
-&#09;dm.<span class="annotation">put</span>("<span class="id">order</span>",orderId);<br>
-&#09;//...<br>
-}
-</pre>
-    </div>
-
-</p>
-
-
-<p>
-</p>
-
-<p align="left">
-    <b>Service description</b>
-    <br>
-    This service books a given number of Fitness Passes for the given reservation. It must be executed within a Business
-    Activity.<br>
-    This service requires following parameters:
-    <ul align="left">
-        <li>Username
-        <li>Password
-        <li>Reservation Number
-    </ul>
-</p>
-<p align="left">
-    It throws following exceptions:
-    <ul align="left">
-        <li>HotelCustomException
-    </ul>
-</p>
-<p align="left">
-    HotelCustomException is thrown if either the user cannot log in (username, password or both are incorrect)
-    or the reservation number is incorrect (reservation does not exist).
-</p>
-
-<p align="left">
-    This service returns:
-    <ul align="left">
-        <li>Complex object representing a meal order
-    </ul>
-</p>
-
-<p align="left">
-    <b>Agreement Protocol</b><br>
-    <a href="HotelService?page=bawpc.jsp">Business Agreement With Participant Completion</a>
-</p>
-
-<p align="left">
-    <b>Compensation action</b>
-    <br>
-    <a href="HotelService?page=cancelmeal.jsp">cancelMeal()</a>
-</p>
-
-</div>
-
-
-<div id="footer">
-    <p align=right>
-        &copy; JBoss, a division of Red Hat
-    </p>
-</div>
-
-</div>
-
-</body>
-</html>
\ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<!--
+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,
+ at author JBoss Inc.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <title>Business Activity Framework Demo Application</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-2">
+    <meta http-equiv="content-language" content="en">
+    <meta name="author" content="Maciej Machulak">
+    <link rel="stylesheet" type="text/css" href="green.css"/>
+</head>
+<body>
+
+<div id="main">
+
+<div id="headerLeft">
+    <h1>Business Activity Framework Demo Application</h1>
+</div>
+
+<div id="headerRight">
+    <img src="jboss.jpg">
+</div>
+
+<div id="headerBottom">
+    Debug window (service return value):
+</div>
+
+<div id="headerDebug">
+    ${requestScope.DEBUG}
+</div>
+
+${requestScope.ACTIVE}
+
+<div id="menu">
+    <p>
+        <a href="HotelService?page=index.jsp">Home</a><br>
+        <a href="HotelService?page=about.jsp">About Demo Application</a><br>
+        <a href="HotelService?page=author.jsp">About Author</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?page=initialise.jsp" ${requestScope.INITIALISE}>Initialise data</a><br>
+        <a href="HotelService?method=dropHotelData&baRequest=false" ${requestScope.DROP}>Delete data</a><br>
+        <a href="HotelService?method=getHotelData&baRequest=false" ${requestScope.SHOW}>Show data</a><br>
+        <a href="HotelService?method=getHotelOrders&baRequest=true" ${requestScope.ORDER}>Show orders</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?method=startBA&baRequest=true" ${requestScope.BEGIN}>Begin Business Activity</a><br>
+    </p>
+    <hr>
+    <p>
+        <b>BA services:</b><br>
+        <a href="HotelService?page=hotelinfo.jsp" ${requestScope.BASERVICE}>Hotel Info</a><br>
+        <a href="HotelService?page=bookroom.jsp" ${requestScope.BASERVICE}>Book Room</a><br>
+        <a href="HotelService?page=getpackage.jsp" ${requestScope.BASERVICE}>Get Package</a><br>
+        <a href="HotelService?page=bookfitness.jsp" ${requestScope.BASERVICE}>Book Fitness</a><br>
+        <a href="HotelService?page=bookcasino.jsp" ${requestScope.BASERVICE}>Book Casino</a><br>
+        <a href="HotelService?page=ordermeal.jsp" ${requestScope.BASERVICE}>Order Meal</a><br>
+        <a href="HotelService?page=increaserating.jsp" ${requestScope.BASERVICE}>Increase Rating</a><br>
+        <a href="HotelService?page=decreaserating.jsp" ${requestScope.BASERVICE}>Decrease Rating</a><br>
+    </p>
+    <hr>
+    <p>
+        <a href="HotelService?method=completeBA&baRequest=true" ${requestScope.COMPLETE}>Complete Business Activity</a><br>
+        <a href="HotelService?method=closeBA&baRequest=true" ${requestScope.CLOSE}>Close Business Activity</a><br>
+        <a href="HotelService?method=cancelBA&baRequest=true" ${requestScope.CANCEL}>Cancel Business Activity</a><br>
+    </p>
+    <hr>
+    <p>
+        <b>Normal services:</b><br>
+        <a href="HotelService?page=cancelroom.jsp" ${requestScope.SERVICE}>Cancel Room</a><br>
+        <a href="HotelService?page=cancelpackage.jsp" ${requestScope.SERVICE}>Cancel Package</a><br>
+        <a href="HotelService?page=cancelfitness.jsp" ${requestScope.SERVICE}>Cancel Fitness</a><br>
+        <a href="HotelService?page=cancelcasino.jsp" ${requestScope.SERVICE}>Cancel Casino</a><br>
+        <a href="HotelService?page=cancelmeal.jsp" ${requestScope.SERVICE}>Cancel Meal</a><br>
+    </p>
+    <hr>
+</div>
+
+
+<div id="body" align=center>
+
+<p align="center">
+
+    <form action="HotelService?method=orderMeal&baRequest=true&continue=ordermeal.jsp" method="post">
+        <fieldset class="medium">
+            <legend>orderMeal()</legend>
+
+            <p>
+                <label for="username">Username</label>
+                <input type="text" name="parameters" value="user1"/>
+                <br>
+                <label for="password">Password</label>
+                <input type="text" name="parameters" value="pass1"/>
+                <br>
+                <label for="reservation">Reservation number</label>
+                <input type="text" name="parameters"/>
+            </p>
+
+            <input type="submit" value="Invoke Web Service"/>
+
+        </fieldset>
+    </form>
+
+</p>
+
+<p align="left">
+    <b>Method's class</b><br>
+    com.jboss.ba.demo.service.HotelImpl
+</p>
+
+<p align="left">
+    <b>Method's signature</b><br>
+
+    <div id="code">
+
+<pre>
+ at WebMethod<br>
+<span class="annotation">@BAMethod</span>(AgreementType.<span class="enum">PARTICIPANT_COMPLETION</span>,MethodType.<span class="enum">MODIFY</span>)<br>
+<span class="annotation">@BACompensatedBy</span>(value="<span class="id">cancelMeal</span>",<br>
+&#09;type=DataMatch.<span class="enum">CUSTOM</span>,<br>
+&#09;mode=ExecutionMode.<span class="enum">EJB</span>)<br>
+public MealOrder orderMeal(<span class="annotation">@BAParam</span>("<span class="id">user</span>")String username,<br>
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">password</span>")String password,<br> 
+&#09;&#09;&#09;<span class="annotation">@BAParam</span>("<span class="id">reservation</span>")Integer reservationNumber)<br>
+<br>
+throws HotelCustomException
+</pre>
+    </div>
+
+</p>
+
+<p align="left">
+    <b>BA-related code</b>
+    <br>
+
+    <div id="code">
+
+<pre>
+{
+&#09;//...<br>
+&#09;dm.<span class="annotation">put</span>("<span class="id">order</span>",orderId);<br>
+&#09;//...<br>
+}
+</pre>
+    </div>
+
+</p>
+
+
+<p>
+</p>
+
+<p align="left">
+    <b>Service description</b>
+    <br>
+    This service orders a meal for a given reservation. It returns a complex object representing the meal. This
+    object includes the meal order unique identifier and a full meal description. The meal order identifier is additionally stored by the service and may be used if the Business Activity is requested to compensate its work.<br>
+    This service must be executed within a Business Activity.<br>
+    This service requires following parameters:
+    <ul align="left">
+        <li>Username
+        <li>Password
+        <li>Reservation Number
+    </ul>
+</p>
+
+<p align="left">
+    This service returns:
+    <ul align="left">
+        <li>Complex object representing a meal order
+    </ul>
+</p>
+
+<p align="left">
+    It throws following exceptions:
+    <ul align="left">
+        <li>HotelCustomException
+    </ul>
+</p>
+<p align="left">
+    HotelCustomException is thrown if either the user cannot log in (username, password or both are incorrect)
+    or the reservation number is incorrect (reservation does not exist).
+</p>
+
+<p align="left">
+    <b>Agreement Protocol</b><br>
+    <a href="HotelService?page=bawpc.jsp">Business Agreement With Participant Completion</a>
+</p>
+
+<p align="left">
+    <b>Compensation action</b>
+    <br>
+    <a href="HotelService?page=cancelmeal.jsp">cancelMeal()</a>
+</p>
+
+</div>
+
+
+<div id="footer">
+    <p align=right>
+        &copy; JBoss, a division of Red Hat
+    </p>
+</div>
+
+</div>
+
+</body>
+</html>

Modified: labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/client/HotelService.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/client/HotelService.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/client/HotelService.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -612,8 +612,7 @@
             throws HotelCustomException, NumberFormatException
     {
         log.info("getComplimentaryPackageNumber()");
-        Integer reservationNumber = new Integer(parameters[2]);
-        return hotel.getComplimentaryPackageNumber(parameters[0],parameters[1],reservationNumber);
+        return hotel.getComplimentaryPackageNumber(parameters[0],parameters[1]);
 
     }
 
@@ -621,8 +620,7 @@
             throws HotelCustomException, NumberFormatException
     {
         log.info("cancelComplimentaryPackageNumber()");
-        Integer reservationNumber = new Integer(parameters[2]);
-        return hotel.cancelComplimentaryPackageNumber(parameters[0],parameters[1],reservationNumber);
+        return hotel.cancelComplimentaryPackageNumber(parameters[0],parameters[1]);
     }
 
     private boolean bookFitnessPass(String[] parameters)

Modified: labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/CustomerEntityImpl.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/CustomerEntityImpl.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/CustomerEntityImpl.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -27,7 +27,7 @@
 
 /**
  * Entity bean that represents a customer object.
- * 
+ *
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
  */
@@ -38,6 +38,7 @@
     private int id;
     private String username;
     private String password;
+    private Integer freePack;
     private Collection<OrderEntityImpl> orders = new ArrayList<OrderEntityImpl>();
 
     public CustomerEntityImpl()
@@ -77,6 +78,16 @@
         this.password = password;
     }
 
+    public Integer getFreePack()
+    {
+        return freePack;
+    }
+
+    public void setFreePack(Integer freePack)
+    {
+        this.freePack = freePack;
+    }
+
     @Column(name="bookings")
     @OneToMany(mappedBy="customer",
             cascade={CascadeType.REMOVE})

Modified: labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/Hotel.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/Hotel.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/Hotel.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -39,8 +39,8 @@
     public boolean increaseHotelRating(String username,String password,Integer points);
     public boolean decreaseHotelRating(String username,String password,Integer points);
     // - MODIFY - SINGLETON
-    public Integer getComplimentaryPackageNumber(String username,String password,Integer reservationNumber) throws HotelCustomException;
-    public boolean cancelComplimentaryPackageNumber(String username,String password,Integer reservationNumber) throws HotelCustomException;
+    public Integer getComplimentaryPackageNumber(String username,String password) throws HotelCustomException;
+    public boolean cancelComplimentaryPackageNumber(String username,String password) throws HotelCustomException;
     // - MODIFY - NORMAL
     // * custom
     public Integer bookRoom(String username, String password, Integer roomNumber) throws HotelCustomException, RoomAlreadyOccupiedException;
@@ -48,7 +48,7 @@
     // * parameters match
     public boolean bookFitnessPass(String username, String password, Integer reservationNumber, Integer amount) throws HotelCustomException;
     public boolean cancelFitnessPass(String username, String password, Integer reservationNumber, Integer amount) throws HotelCustomException;
-    public boolean checkoutFitnessPass(String username, String password, Integer reservationNumber);
+    public boolean checkoutFitnessPass(String username, String password, Integer reservationNumber, Integer uniqueId);
     // * return value
     public Integer getCasinoToken(String username,String password, Integer amount) throws HotelCustomException;
     public boolean cancelCasinoToken(Integer token) throws HotelCustomException;

Modified: labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/HotelImpl.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/HotelImpl.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/HotelImpl.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -299,8 +299,12 @@
         OrderEntityImpl order = new OrderEntityImpl(customer,room);
         hotelView.addMessage("Persisting order");
         em.persist(order);
+        hotelView.addMessage(order.toString());
         Integer reservationNumber = order.getId();
-        hotelView.addMessage(order.toString());
+        hotelView.addMessage("Calculating refund for the user...");
+        Integer refundValue = order.getRoom().getRoomNumber();
+        hotelView.addMessage("Remembering refund value: " + refundValue);
+        dm.put("refund",refundValue);
         hotelView.addMessage("Returning: " + reservationNumber);
         log.info("Returning");
         hotelView.endMethod();
@@ -331,6 +335,13 @@
             hotelView.addMessage("Reservation incorrect - throwing exception");
             throw new HotelCustomException("Reservation incorrect");
         }
+        hotelView.addMessage("Checking if refund should be applied");
+        Integer refundValue = (Integer) dm.get("refund");
+        if (refundValue != null)
+        {
+            hotelView.addMessage("Refund value: " + refundValue);
+        }
+
         hotelView.addMessage("Removing reservation");
         em.remove(oe);
         hotelView.endMethod();
@@ -340,32 +351,25 @@
     @WebMethod
     @BAMethod
     @BACompensatedBy(value="cancelComplimentaryPackageNumber",single=true,type=DataMatch.PARAMETERS_MATCH)
-    public Integer getComplimentaryPackageNumber(String username, String password, Integer reservationNumber)
+    public Integer getComplimentaryPackageNumber(String username, String password)
             throws HotelCustomException
     {
         log.info("getComplimentaryPackageNumber()");
         hotelView.newMethod("getComplimentaryPackageNumber()");
         hotelView.addMessage("Username: " + username);
         hotelView.addMessage("Password: " + password);
-        hotelView.addMessage("Reservation no: " + reservationNumber);
         CustomerEntityImpl customer = getCustomer(username,password);
         if (customer == null)
         {
             hotelView.addMessage("Login incorrect - throwing exception");
             throw new HotelCustomException("Login incorrect");
         }
-        OrderEntityImpl order = getReservation(reservationNumber);
-        if (order == null)
-        {
-            hotelView.addMessage("Reservation incorrect - throwing exception");
-            throw new HotelCustomException("Reservation incorrect");
-        }
-        Integer freePack = order.getFreePack();
+        Integer freePack = customer.getFreePack();
         if (freePack == null)
         {
             freePack = Math.abs(randomGenerator.nextInt());
         }
-        em.merge(order);
+        em.merge(customer);
         hotelView.endMethod();
         compensationView.compensationMethod("cancelComplimentaryPackageNumber()");
         return freePack;
@@ -373,28 +377,21 @@
     }
 
     @WebMethod
-    public boolean cancelComplimentaryPackageNumber(String username, String password,Integer reservationNumber)
+    public boolean cancelComplimentaryPackageNumber(String username, String password)
             throws HotelCustomException
     {
         log.info("cancelComplimentaryPackageNumber()");
         hotelView.newMethod("cancelComplimentaryPackageNumber()");
         hotelView.addMessage("Username: " + username);
         hotelView.addMessage("Password: " + password);
-        hotelView.addMessage("Reservation no: " + reservationNumber);
         CustomerEntityImpl customer = getCustomer(username,password);
         if (customer == null)
         {
             hotelView.addMessage("Login incorrect - throwing exception");
             throw new HotelCustomException("Login incorrect");
         }
-        OrderEntityImpl order = getReservation(reservationNumber);
-        if (order == null)
-        {
-            hotelView.addMessage("Reservation incorrect - throwing exception");
-            throw new HotelCustomException("Reservation incorrect");
-        }
-        order.setFreePack(null);
-        em.merge(order);
+        customer.setFreePack(null);
+        em.merge(customer);
         hotelView.endMethod();
         return true;
     }
@@ -425,6 +422,11 @@
             hotelView.addMessage("Reservation incorrect - throwing exception");
             throw new HotelCustomException("Reservation incorrect");
         }
+
+        // TODO: Change implementation of this bit...
+        Integer uniqueId = Math.abs(randomGenerator.nextInt());
+        hotelView.addMessage("Unique ID: " + uniqueId);
+        dm.put("id",uniqueId);
         Integer fitnessPass = order.getFitnessPass();
         hotelView.addMessage("Current number of fitness passes: " + fitnessPass);
         fitnessPass = fitnessPass + amount;
@@ -437,13 +439,14 @@
     }
 
     @TransactionAttribute(TransactionAttributeType.MANDATORY)
-    public boolean checkoutFitnessPass(@BAParam("username") String username, @BAParam("password") String password, @BAParam("reservationNumber") Integer reservationNumber)
+    public boolean checkoutFitnessPass(@BAParam("username") String username, @BAParam("password") String password, @BAParam("reservationNumber") Integer reservationNumber, at BAParam("id") Integer uniqueId)
     {
         log.info("checkoutFitnessPass()");
         hotelView.newMethod("checkoutFitnessPass()");
         hotelView.addMessage("Username: " + username);
         hotelView.addMessage("Password: " + password);
         hotelView.addMessage("Reservation no: " + reservationNumber);
+        hotelView.addMessage("Unique ID: " + uniqueId);
         hotelView.addMessage("Validating fitness passes...");
         // TODO: Implement...
         hotelView.addMessage("Returning true");
@@ -668,16 +671,19 @@
         return true;
     }
 
+    @SuppressWarnings("unchecked")
     private List<CustomerEntityImpl> getCustomers()
     {
         return em.createQuery("select C from CustomerEntityImpl C").getResultList();
     }
 
+    @SuppressWarnings("unchecked")
     private List<RoomEntityImpl> getRooms()
     {
         return em.createQuery("select C from RoomEntityImpl C").getResultList();
     }
 
+    @SuppressWarnings("unchecked")
     private List<OrderEntityImpl> getOrders()
     {
         return em.createQuery("select C from OrderEntityImpl C").getResultList();

Modified: labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/OrderEntityImpl.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/OrderEntityImpl.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/demo/src/com/jboss/ba/demo/service/OrderEntityImpl.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -38,7 +38,6 @@
     private CustomerEntityImpl customer;
     private RoomEntityImpl room;
     private Integer fitnessPass = 0;
-    private Integer freePack;
     private List<Integer> casinoTokens;
     private boolean extraMiniBar = false;
     private Map<Integer,MealOrder> mealOrders;
@@ -102,16 +101,6 @@
         this.fitnessPass = fitnessPass;
     }
 
-    public Integer getFreePack()
-    {
-        return freePack;
-    }
-
-    public void setFreePack(Integer freePack)
-    {
-        this.freePack = freePack;
-    }
-
     public void addCasinoToken(Integer token)
     {
         casinoTokens.add(token);
@@ -152,7 +141,6 @@
         sb.append(" Customer: ").append(customer.getUsername());
         sb.append(" Room: ").append(room.getRoomName());
         sb.append(" Fitness: ").append(fitnessPass);
-        sb.append(" Free pack: ").append(freePack);
         sb.append(" Casino Tokens: ").append(casinoTokens);
         return sb.toString();
     }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/BATransactionManager.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/BATransactionManager.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/BATransactionManager.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -26,7 +26,7 @@
 import org.apache.log4j.Logger;
 import org.jboss.txbridge.ba.data.TaskDescription;
 import org.jboss.txbridge.ba.exception.TransactionProcessingException;
-import org.jboss.txbridge.ba.helper.BAServiceVisitor;
+import org.jboss.txbridge.ba.helper.BATaskVisitor;
 import org.jboss.txbridge.ba.id.IdentifierFactory;
 import org.jboss.txbridge.ba.id.UidIdentifierFactory;
 import org.jboss.txbridge.ba.participant.Participant;
@@ -155,7 +155,7 @@
                 // - MethodNotAccessibleException
                 // TODO: Processing services and checking should be done during deployment time
                 log.info("Service unknown - processing");
-                serviceManager.storeServiceDescription(BAServiceVisitor.processMethod(method));
+                serviceManager.storeServiceDescription(BATaskVisitor.processMethod(method));
             }
             else
             {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/SingleTransactionManager.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/SingleTransactionManager.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/SingleTransactionManager.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -325,7 +325,7 @@
 
                 // 2) Get the annotation values
                 log.info("Getting annotation values");
-                Object[] annotations = originalMethod.getParameterAnnotations();
+                Object[] annotations = originalMethod.getParameterIdentifiers();
 
                 // 3) Remember parameters
                 log.info("Remembering parameters");

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DataManagerProvider.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DataManagerProvider.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DataManagerProvider.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -37,13 +37,13 @@
 {
     private static Logger log = Logger.getLogger(DataManagerProvider.class);
 
-    private static volatile DataManagerProvider cmp = null;
+    private static volatile DataManagerProvider dmp = null;
 
-    private static ConcurrentMap<Long, DataManager> cmList;
+    private static ConcurrentMap<Long, DataManager> dataManagers;
 
     private DataManagerProvider()
     {
-        cmList = new ConcurrentHashMap<Long, DataManager>();
+        dataManagers = new ConcurrentHashMap<Long, DataManager>();
     }
 
     /**
@@ -54,18 +54,18 @@
     public static DataManagerProvider getSingletonInstance()
     {
         log.info("getSingletonInstance()");
-        if (cmp == null)
+        if (dmp == null)
         {
             synchronized (DataManagerProvider.class)
             {
-                if (cmp == null)
+                if (dmp == null)
                 {
                     log.info("Creating a new instance");
-                    cmp = new DataManagerProvider();
+                    dmp = new DataManagerProvider();
                 }
             }
         }
-        return cmp;
+        return dmp;
     }
 
     /**
@@ -77,7 +77,7 @@
     public void associateManager(Long thread, DataManager cmp)
     {
         log.info("associateManager()");
-        cmList.put(thread,cmp);
+        dataManagers.put(thread,cmp);
     }
 
     /**
@@ -92,7 +92,7 @@
     public DataManager getManager(Long thread)
     {
         log.info("getManager()");
-        DataManager cm = cmList.get(thread);
+        DataManager cm = dataManagers.get(thread);
         if (cm == null)
         {
             log.info("Returning a dummy data manager");
@@ -109,6 +109,6 @@
     public void removeManager(Long thread)
     {
         log.info("removeManager()");
-        cmList.remove(thread);
+        dataManagers.remove(thread);
     }
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DummyDataManager.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DummyDataManager.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/DummyDataManager.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -20,6 +20,8 @@
  */
 package org.jboss.txbridge.ba.datamgmt;
 
+import org.apache.log4j.Logger;
+
 /**
  * This class represents a dummy data manager. Such dummy data manager is used
  * if a Web Service is invoked outside the scope of the Business Activity. It provides same
@@ -30,6 +32,10 @@
  */
 public class DummyDataManager implements DataManager
 {
+
+        // Logger
+    private static Logger log = Logger.getLogger(DummyDataManager.class);
+    
     /**
      * This is a dummy method that... does nothing.
      *
@@ -37,7 +43,8 @@
      * @param object is the object itself.
      */
     public void put(Object objectId, Object object)
-    {       
+    {
+        log.info("put()");
     }
 
     /**
@@ -48,6 +55,7 @@
      */
     public Object get(Object objectId)
     {
+        log.info("get()");
         return null;
     }
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/ExecutionDataProviderImpl.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/ExecutionDataProviderImpl.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/datamgmt/ExecutionDataProviderImpl.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -30,7 +30,7 @@
 public class ExecutionDataProviderImpl extends DataManagerImpl implements ExecutionDataProvider
 {
     // Logger
-    private static Logger log = Logger.getLogger(DataManagerImpl.class);
+    private static Logger log = Logger.getLogger(ExecutionDataProviderImpl.class);
 
     /**
      * Constructor

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodIncorrectlyAnnotatedException.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodIncorrectlyAnnotatedException.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodIncorrectlyAnnotatedException.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -21,11 +21,11 @@
 package org.jboss.txbridge.ba.exception;
 
 /**
- * This exception is thrown when we want to process a method which does not contain
- * all necessary annotations related to Business Activity.
+ * This exception is thrown when we want to process a Web Service method which
+ * does not contain all necessary annotations related to Business Activity.
  *
  * @author Maciej P. Machulak (mmachulak at redhat.com)
- * @version 0.1
+ * @version 0.1.1
  */
 public class MethodIncorrectlyAnnotatedException extends Exception
 {
@@ -38,4 +38,9 @@
     {
         super(message);
     }
+
+    public MethodIncorrectlyAnnotatedException(Throwable cause)
+    {
+        super(cause);
+    }
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodNotAccessibleException.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodNotAccessibleException.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/exception/MethodNotAccessibleException.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -40,4 +40,10 @@
     {
         super(message);
     }
+
+
+    public MethodNotAccessibleException(Throwable cause)
+    {
+        super(cause);
+    }
 }

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ArgumentsProvider.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ArgumentsProvider.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ArgumentsProvider.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -29,7 +29,7 @@
 /**
  * Arguments Provider component provides methods to obtain necessary data, which has been
  * remembered during execution of the original method. This data will be used when invoking
- * an action (completion or compensation)
+ * an action (completion or compensation).
  *
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
@@ -39,14 +39,17 @@
     private static Logger log = Logger.getLogger(ArgumentsProvider.class);
 
     /**
-     * This method 
+     * This method takes a description of a method that needs to be invoked and a reference
+     * to an execution data provider. It then checks which data is required by the method
+     * and constructs an array of objects, which will be used as arguments to invoke this
+     * method.
      *
-     * @param md is the service description.
-     * @param cdp is the managed data provider.
+     * @param md is the method description.
+     * @param edp is the execution data provider.
      * @return array of objects.
-     * @throws ActionExecutionException
+     * @throws ActionExecutionException if it is not possible to obtain necessary data.
      */
-    public Object[] getArguments(MethodDescription md, ExecutionDataProvider cdp)
+    public Object[] getArguments(MethodDescription md, ExecutionDataProvider edp)
             throws ActionExecutionException
     {
         log.info("getArguments()");
@@ -56,13 +59,14 @@
         Object[] parameterObjects = null;
         Class[] parameterTypes = null;
 
-        log.info("Data Match type: " + md.getDataMatch());
+        DataMatch dataMatch = md.getDataMatch();
+        log.info("Data Match type: " + dataMatch);
 
-        if (md.getDataMatch() == DataMatch.PARAMETERS_MATCH)
+        if (dataMatch == DataMatch.PARAMETERS_MATCH)
         {
             // Get parameters
             log.info("Getting parameters");
-            parameterObjects = cdp.getArguments();
+            parameterObjects = edp.getArguments();
             if (parameterObjects != null)
             {
                 parameterTypes = new Class[parameterObjects.length];
@@ -79,11 +83,11 @@
             }
 
         }
-        else if (md.getDataMatch() == DataMatch.RETURN_VALUE)
+        else if (dataMatch == DataMatch.RETURN_VALUE)
         {
             // Get parameter
             log.info("Getting return value");
-            parameterObjects = cdp.getReturn();
+            parameterObjects = edp.getReturn();
             if (parameterObjects != null)
             {
                 parameterTypes = new Class[1];
@@ -95,27 +99,27 @@
                 throw new ActionExecutionException("Managed data incorrect.");
             }
         }
-        else if (md.getDataMatch() == DataMatch.CUSTOM)
+        else if (dataMatch == DataMatch.CUSTOM)
         {
 
             // Get parameter annotations
-            log.info("Getting parameter annotations");
-            Object[] parameterAnnotations = md.getParameterAnnotations();
-            if (parameterAnnotations != null)
+            log.info("Getting parameter identifiers");
+            Object[] parameterIdentifiers = md.getParameterIdentifiers();
+            if (parameterIdentifiers != null)
             {
-                parameterObjects = new Object[parameterAnnotations.length];
+                parameterObjects = new Object[parameterIdentifiers.length];
                 parameterTypes = new Class[parameterObjects.length];
 
                 // For parameter annotations get objects
-                log.info("Looping through annotations");
-                for (int i=0; i< parameterAnnotations.length; i++)
+                log.info("Looping through identifiers");
+                for (int i=0; i< parameterIdentifiers.length; i++)
                 {
                     log.info("### Parameter " + i);
-                    if (parameterAnnotations[i] != null)
+                    if (parameterIdentifiers[i] != null)
                     {
-                        log.info("Annotation found: " + parameterAnnotations[i]);
+                        log.info("Identifier found: " + parameterIdentifiers[i]);
                         // Get object for this identifier
-                        Object singleObject = cdp.get(parameterAnnotations[i]);
+                        Object singleObject = edp.get(parameterIdentifiers[i]);
                         if (singleObject != null)
                         {
                             log.info("Object found: " + singleObject);
@@ -136,7 +140,7 @@
             }
             else
             {
-                log.info("No annotations present - adding parameters by order.");
+                log.info("No identifiers present - adding parameters by order.");
                 parameterTypes = md.getParameterTypes();
                 if (parameterTypes != null)
                 {
@@ -144,7 +148,7 @@
                     parameterObjects = new Object[parameterTypes.length];
                     for (int i=0; i<parameterObjects.length; i++)
                     {
-                        Object singleArgument = cdp.get(i);
+                        Object singleArgument = edp.get(i);
                         parameterObjects[i] = singleArgument;
                         if (singleArgument == null)
                         {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/EJBExecution.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/EJBExecution.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/EJBExecution.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -50,8 +50,9 @@
      * @throws ActionExecutionException if invoking completion or compensation action was not successful.
      */
     public void invokeService(TaskDescription taskDesc, MethodDescription md, Object[] arguments, Class[] argumentTypes)
-            throws ActionExecutionException {
-        log.info("invoke()");
+            throws ActionExecutionException
+    {
+        log.info("invokeService()");
         try
         {
 

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalExecution.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalExecution.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalExecution.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -35,7 +35,8 @@
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
  */
-public class LocalExecution implements Executable {
+public class LocalExecution implements Executable
+{
     // Logger
     private static Logger log = Logger.getLogger(LocalExecution.class);
 
@@ -58,14 +59,14 @@
         {
             // 1) Get the class of the method
             Class clazz = md.getClazz();
-            log.info("Compensation class: " + clazz.getName());
+            log.info("Method class: " + clazz.getName());
             // 2) Get the name of the method
             String methodName = md.getMethodName();
-            log.info("Compensation method: " + methodName);
+            log.info("Method name: " + methodName);
             // 3) Get the method
             log.info("Getting reference to the method...");
-            Method compensationMethod = clazz.getMethod(methodName,argumentTypes);
-            if ( compensationMethod == null )
+            Method method = clazz.getMethod(methodName,argumentTypes);
+            if ( method == null )
             {
                 throw new ActionExecutionException("Could not get access to the method");
             }
@@ -74,8 +75,8 @@
             Constructor classConstructor = clazz.getConstructor();
             log.info("Constructor: " + classConstructor.toString());
             Object classObject = classConstructor.newInstance();
-            log.info("Invoking a service");
-            compensationMethod.invoke(classObject,arguments);
+            log.info("Invoking the method");
+            method.invoke(classObject,arguments);
         }
         catch (Exception e)
         {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalServiceExecutor.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/LocalServiceExecutor.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -40,6 +40,11 @@
     // Logger
     private static Logger log = Logger.getLogger(LocalServiceExecutor.class);
 
+    /**
+     * Constructor
+     *
+     * @param taskDesc is the task description.
+     */
     public LocalServiceExecutor(TaskDescription taskDesc)
     {
         super(taskDesc);

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/RemoteServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/RemoteServiceExecutor.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/RemoteServiceExecutor.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -40,6 +40,11 @@
     // Logger
     private static Logger log = Logger.getLogger(RemoteServiceExecutor.class);
 
+    /**
+     * Constructor
+     *
+     * @param taskDesc is the task description.
+     */
     public RemoteServiceExecutor(TaskDescription taskDesc)
     {
         super(taskDesc);
@@ -47,6 +52,12 @@
         dataProvider = new ArgumentsProvider();
     }
 
+    /**
+     * 
+     * @param md
+     * @param edp
+     * @throws ActionExecutionException
+     */
     public void invoke(MethodDescription md, ExecutionDataProvider edp)
             throws ActionExecutionException
     {

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ServiceExecutor.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ServiceExecutor.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/execute/ServiceExecutor.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -92,10 +92,10 @@
 
     /**
      * This method invokes the completion or compensation task which is specified in the service description.
-     * It uses managed data which are passed as a parameter.
+     * It uses managed data which is passed as a parameter.
      *
      * @param md represents the service description.
-     * @param edp represents the datamgmt data provider.
+     * @param edp represents the execution data provider.
      * @throws ActionExecutionException if it was not possible to execute datamgmt action.
      */
     public abstract void invoke(MethodDescription md, ExecutionDataProvider edp) throws ActionExecutionException;

Modified: labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/DataManagement.java
===================================================================
--- labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/DataManagement.java	2007-09-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/helper/DataManagement.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -29,9 +29,9 @@
 import java.lang.reflect.Field;
 
 /**
- * This component provides a method that can be used to inject a datamgmt manager to an object on
- * which a datamgmt action is to be executed. Such datamgmt manager can be used to retrieve
- * and additional data, which may be required by the datamgmt action.
+ * This component provides a method that can be used to inject a data manager to an object on
+ * which an action (e.g. completion/compensation) is executed. Such data manager can be used to
+ * retrieve any additional data, which may be required by the action.
  *
  * @author Maciej P. Machulak (mmachulak at redhat.com)
  * @version 0.1
@@ -41,15 +41,14 @@
     // Logger
     private static Logger log = Logger.getLogger(DataManagement.class);
 
-    public static synchronized Object injectCompensationManager(Object targetObject, TaskDescription taskDesc)
+    public static synchronized Object injectDataManager(Object targetObject, TaskDescription taskDesc)
     {
-        // Inject the transaction identifier
-        log.info("injectCompensationManager()");
+        log.info("injectDataManager()");
         log.info(taskDesc);
         try
         {
             Class clazz = targetObject.getClass();
-            log.info("Injecting datamgmt manager");
+            log.info("Injecting Data Manager");
             Field[] fields = clazz.getDeclaredFields();
             for (Field singleField : fields)
             {

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-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/participant/CoordinatorCompletionParticipant.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -52,7 +52,7 @@
     /**
      * Constructor.
      *
-     * @param txId      is the transaction identifier.
+     * @param txId is the transaction identifier.
      * @param serviceId is the service identifier.
      * @param stm is the single transaction manager.
      * @param cdf is the datamgmt data factory that should be used by the participant

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-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescription.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -40,17 +40,13 @@
 
     void setMethodName(String methodName);
 
-    String getWebMethodName();
-
-    void setWebMethodName(String webMethodName);
-
     Class[] getParameterTypes();
 
     void setParameterTypes(Class[] parameterTypes);
 
-    Object[] getParameterAnnotations();
+    Object[] getParameterIdentifiers();
 
-    void setParameterAnnotations(Object[] parameterAnnotations);
+    void setParameterIdentifiers(Object[] parameterIdentifiers);
 
     Object getReturnId();
 

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-27 22:29:13 UTC (rev 15413)
+++ labs/jbosstm/workspace/baframework/trunk/src/org/jboss/txbridge/ba/service/MethodDescriptionImpl.java	2007-09-27 23:30:01 UTC (rev 15414)
@@ -35,20 +35,22 @@
  */
 public class MethodDescriptionImpl implements MethodDescription
 {
-    private Class clazz;
-    private Class ejbInterface;
+
     private String methodName;
-    private String webMethodName;
     private Class[] parameterTypes;
-    private Object[] parameterAnnotations;
+    private Object[] parameterIdentifiers;
     private Object returnId;
     private Class returnType;
     private boolean isSingle;
     private DataMatch dataMatch;
     private ExecutionMode executionMode;
     private ParameterMatch parameterMatch;
+
+    private Class clazz;
+    private Class ejbInterface;
     private String jndiName;
     private String providerURL;
+
     private String endpointAddress;
     private String targetNamespace;
     private String serviceName;
@@ -73,16 +75,6 @@
         this.methodName = methodName;
     }
 
-    public String getWebMethodName()
-    {
-        return webMethodName;
-    }
-
-    public void setWebMethodName(String webMethodName)
-    {
-        this.webMethodName = webMethodName;
-    }
-
     public Class[] getParameterTypes()
     {
         return parameterTypes;
@@ -93,14 +85,14 @@
         this.parameterTypes = parameterTypes;
     }
 
-    public Object[] getParameterAnnotations()
+    public Object[] getParameterIdentifiers()
     {
-        return parameterAnnotations;
+        return parameterIdentifiers;
     }
 
-    public void setParameterAnnotations(Object[] parameterAnnotations)
+    public void setParameterIdentifiers(Object[] parameterIdentifiers)
     {
-        this.parameterAnnotations = parameterAnnotations;
+        this.parameterIdentifiers = parameterIdentifiers;
     }
 
     public Object getReturnId()
@@ -193,28 +185,33 @@
         this.ejbInterface = ejbInterface;
     }
 
-
-    public String getEndpointAddress() {
+    public String getEndpointAddress()
+    {
         return endpointAddress;
     }
 
-    public void setEndpointAddress(String endpointAddress) {
+    public void setEndpointAddress(String endpointAddress)
+    {
         this.endpointAddress = endpointAddress;
     }
 
-    public String getTargetNamespace() {
+    public String getTargetNamespace()
+    {
         return targetNamespace;
     }
 
-    public void setTargetNamespace(String targetNamespace) {
+    public void setTargetNamespace(String targetNamespace)
+    {
         this.targetNamespace = targetNamespace;
     }
 
-    public String getServiceName() {
+    public String getServiceName()
+    {
         return serviceName;
     }
 
-    public void setServiceName(String serviceName) {
+    public void setServiceName(String serviceName)
+    {
         this.serviceName = serviceName;
     }
 }




More information about the jboss-svn-commits mailing list