[jboss-svn-commits] JBL Code SVN: r37291 - in labs/jbosstm/workspace: txframework and 47 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 25 06:07:07 EDT 2011


Author: adinn
Date: 2011-07-25 06:07:06 -0400 (Mon, 25 Jul 2011)
New Revision: 37291

Added:
   labs/jbosstm/workspace/txframework/
   labs/jbosstm/workspace/txframework/bin/
   labs/jbosstm/workspace/txframework/bin/createdb.sh
   labs/jbosstm/workspace/txframework/bin/initdb.sh
   labs/jbosstm/workspace/txframework/build.xml
   labs/jbosstm/workspace/txframework/demo/
   labs/jbosstm/workspace/txframework/demo/build.sh
   labs/jbosstm/workspace/txframework/demo/build.xml
   labs/jbosstm/workspace/txframework/demo/dd/
   labs/jbosstm/workspace/txframework/demo/dd/jboss/
   labs/jbosstm/workspace/txframework/demo/dd/jboss/application.xml
   labs/jbosstm/workspace/txframework/demo/dd/jboss/client-web-app.xml
   labs/jbosstm/workspace/txframework/demo/dd/jboss/context-handlers.xml
   labs/jbosstm/workspace/txframework/demo/dd/jboss/persistence.xml
   labs/jbosstm/workspace/txframework/demo/dd/jboss/service-web-app.xml
   labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/
   labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/RestaurantService.wsdl
   labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TaxiService.wsdl
   labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TheatreService.wsdl
   labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/build.sh
   labs/jbosstm/workspace/txframework/demo/jboss.properties
   labs/jbosstm/workspace/txframework/demo/src/
   labs/jbosstm/workspace/txframework/demo/src/org/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/client/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/client/BasicClient.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantConstants.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManager.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManagerLocal.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantState.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantView.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManager.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManagerLocal.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiState.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiView.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreConstants.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManager.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManagerLocal.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreState.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreView.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/RestaurantServiceService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/restaurant/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/restaurant/RestaurantService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/taxi/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/taxi/TaxiService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/theatre/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/theatre/TheatreService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/ITaxiService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/TaxiServiceService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/ITheatreService.java
   labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/TheatreServiceService.java
   labs/jbosstm/workspace/txframework/demo/web/
   labs/jbosstm/workspace/txframework/demo/web/images/
   labs/jbosstm/workspace/txframework/demo/web/images/JBoss_DivOfRH_RGB.gif
   labs/jbosstm/workspace/txframework/demo/web/images/JBoss_byRH_logo_rgb.png
   labs/jbosstm/workspace/txframework/demo/web/images/a_nav_6699cc.gif
   labs/jbosstm/workspace/txframework/demo/web/images/bl_corner_10.gif
   labs/jbosstm/workspace/txframework/demo/web/images/bl_navcorner_20.gif
   labs/jbosstm/workspace/txframework/demo/web/images/br_corner_10.gif
   labs/jbosstm/workspace/txframework/demo/web/images/br_navcorner_20.gif
   labs/jbosstm/workspace/txframework/demo/web/images/tl_corner_10.gif
   labs/jbosstm/workspace/txframework/demo/web/images/tl_navcorner_20.gif
   labs/jbosstm/workspace/txframework/demo/web/images/tr_corner_10.gif
   labs/jbosstm/workspace/txframework/demo/web/images/tr_navcorner_20.gif
   labs/jbosstm/workspace/txframework/demo/web/index.jsp
   labs/jbosstm/workspace/txframework/demo/web/indexrpc.jsp
   labs/jbosstm/workspace/txframework/resources/
   labs/jbosstm/workspace/txframework/resources/jboss-aop.xml
   labs/jbosstm/workspace/txframework/src/
   labs/jbosstm/workspace/txframework/src/org/
   labs/jbosstm/workspace/txframework/src/org/jboss/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleHandler.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleManager.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/DataManagement.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/TxManagement.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Parameter.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ParticipantService.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Recover.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/RecoveryComplete.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Result.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ServiceRequest.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/AT.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/BA.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/JTA.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTAT.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTJDI.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSAT.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSBA.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/ATTrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/BATrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/JTATrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTATTrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTJDITrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/TriggerSet.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSATTrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSBATrigger.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/BridgeType.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/Default.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/RequestType.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/transaction/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/transaction/CompletionType.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ATLifecycleEvent.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/BALifecycleEvent.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/DataMatch.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ExecutionOrder.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ParameterMatch.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/exception/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/exception/UnknownServiceException.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/ATTxControl.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/BATxControl.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/DataControl.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/TxControl.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/WSBATxControl.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/aspect/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/aspect/TxAspect.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/RequestHandler.java
   labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/ServiceManager.java
Log:
partially complete variant of XTS demo modified to employ TX lifecycle annotations to automate bridging and TX management including compensate handling

Added: labs/jbosstm/workspace/txframework/bin/createdb.sh
===================================================================
--- labs/jbosstm/workspace/txframework/bin/createdb.sh	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/bin/createdb.sh	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,7 @@
+# script which must be run by MySQL admin to create the jboss database and login
+#!/bin/bash
+mysql << EOF
+drop database if exists jboss ;
+create database jboss ;
+GRANT ALL PRIVILEGES ON jboss.* TO jboss at localhost IDENTIFIED BY 'password';
+EOF


Property changes on: labs/jbosstm/workspace/txframework/bin/createdb.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: labs/jbosstm/workspace/txframework/bin/initdb.sh
===================================================================
--- labs/jbosstm/workspace/txframework/bin/initdb.sh	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/bin/initdb.sh	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,15 @@
+# script which must be run after createdb.sh to populate the jboss database for use by the tx framework demo
+#!/bin/bash
+mysql --user=jboss --password=password jboss << EOF
+drop table if exists restaurant ;
+drop table if exists theatre ;
+drop table if exists taxi ;
+create table restaurant ( name varchar(80), bookings int, max_bookings int ) ;
+create table theatre ( name varchar(80), area int, bookings int, max_bookings int, primary  key (name, area) ) ;
+create table taxi ( name varchar(80), bookings int ) ;
+insert into restaurant VALUES ( 'il pinguin', 0, 80)  ;
+insert into theatre VALUES ( 'theatre royal', 0, 0, 80)  ;
+insert into theatre VALUES ( 'theatre royal', 1, 0, 80)  ;
+insert into theatre VALUES ( 'theatre royal', 2, 0, 80)  ;
+insert into taxi VALUES ( 'abc cabs', 0)  ;
+EOF


Property changes on: labs/jbosstm/workspace/txframework/bin/initdb.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: labs/jbosstm/workspace/txframework/build.xml
===================================================================
--- labs/jbosstm/workspace/txframework/build.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/build.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2011, Red Hat 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+-->
+
+<project name="txframework" default="jar" basedir=".">
+    <property name="src.dir" value="src"/>
+    <property name="build.dir" value="build"/>
+    <property name="build.lib.dir" value="${build.dir}/lib"/>
+    <property name="build.classes.dir" value="${build.dir}/classes"/>
+
+    <target name="clean">
+        <delete dir="${build.dir}"/>
+    </target>
+
+    <target name="init" depends="clean">
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${build.classes.dir}"/>
+        <mkdir dir="${build.lib.dir}"/>
+    </target>
+
+    <target name="compile" depends="init">
+        <javac srcdir="${src.dir}" includes="**/*" debug="yes" destdir="${build.classes.dir}"/>
+    </target>
+
+    <target name="jar" depends="compile">
+        <jar jarfile="${build.lib.dir}/txframework.jar">
+            <fileset dir="${build.classes.dir}" includes="**/*"/>
+        </jar>
+    </target>
+</project>
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/demo/build.sh
===================================================================
--- labs/jbosstm/workspace/txframework/demo/build.sh	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/build.sh	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,39 @@
+#
+# JBoss, Home of Professional Open Source
+# Copyright 2006, 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 Lesser General Public License, v. 2.1.
+# 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 Lesser General Public License for more details.
+# You should have received a copy of the GNU Lesser General Public License,
+# v.2.1 along with this distribution; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301, USA.
+
+# 
+# (C) 2005-2006,
+# @author JBoss Inc.
+#
+#!/bin/sh
+###############################################################################
+# Wrapper script for building and deploying xts-demo                          #
+# Usage: build.sh [jboss] <target>                                            #
+###############################################################################
+
+if [ $# -ge 1 ]
+then
+  propertyfile=$1.properties
+  if [ -f "$propertyfile" ]
+  then
+    shift
+    exec ant -Dxmlpropertyfile $propertyfile "$@"
+  fi
+fi
+
+echo "Usage: `basename $0` [jboss] <target>"
+exit 1

Added: labs/jbosstm/workspace/txframework/demo/build.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/build.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/build.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,280 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2011, Red Hat 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+-->
+
+<!-- ====================================================================== -->
+<!--                                                                        -->
+<!--           Copyright (c) 2003, Arjuna Technologies Limited.             -->
+<!--                                                                        -->
+<!--                 WS-Transaction / XTS demo application                  -->
+<!--                                                                        -->
+<!-- ====================================================================== -->
+
+<project name="xts-entity-demo" default="build" basedir=".">
+
+    <!-- ================================================================== -->
+
+    <!-- n.b. run this via the build.sh script to ensure that the property  -->
+    <!-- settings in jboss.properties are set automatically                 -->
+
+    <!-- The properties to override are the following:                      -->
+    <!--    hostname (defaults to localhost)                                -->
+    <!--    port (defaults to 8080 for jboss)                               -->
+    <!--    urlstub (defaults to xtsdemowebservices for JBoss)              -->
+
+    <!-- the demo needs to be linked against the client libraries           -->
+    <!-- installed jboss directory                                          -->
+
+    <property environment="env"/>
+    <property name="jboss.home" value="${env.JBOSS_HOME}"/>
+
+    <!-- load properties if property file is defined -->
+    <xmlproperty file="${xmlpropertyfile}" keeproot="false"/>
+
+    <!--    deploy.dir The deployment directory for the ear                 -->
+
+    <property name="deploy.dir" location="${jboss.home}/server/default/deploy"/>
+
+    <!--  default target build will build an ear file for the demo app for  -->
+    <!--  use in a JBoss server with XTS deployed as a JBoss service        -->
+    <!--  archive. The demo client communicates with demo services deployed -->
+    <!--  as JaxWS endpoints. It employs the WS-COOR and WS-AT/BA 1.1       -->
+    <!--  protocol implementation of web services transactions              -->
+
+    <!--  target buildrpc will build an ear file for the demo app using     -->
+    <!--  JaxRPC to communicate between the demo client and services. It    -->
+    <!--  employs the WS-COOR and WS-AT/BA 1.1 protocol implementation of   -->
+    <!--  web services transactions                                         -->
+
+    <!-- ================================================================== -->
+
+    <property name="xts.home" value="/home/adinn/jboss/jbossts/trunk/XTS/xts-install/"/>
+
+    <property name="lib.dir" location="${xts.home}/lib"/>
+    <property name="jbossts.lib.dir" location="${jboss.home}/common/lib"/>
+    <property name="jboss.client.lib.dir" location="${jboss.home}/client"/>
+    <property name="jboss.common.lib.dir" location="${jboss.home}/common/lib"/>
+    <property name="bridge.lib.dir" location="../../../jbossts/trunk/txbridge/build/"/>
+    <property name="txframework.lib.dir" location="../build/lib"/>
+
+    <property name="lib.libs" value="jbossxts-api.jar"/>
+
+    <property name="ext.libs" value="jbossjta.jar jbossjts.jar"/>
+    <condition property="cxf.client.lib.jars" value="cxf-api.jar saaj-api.jar jaxrpc-api.jar jaxws-api.jar
+            geronimo-ws-metadata_2.0_spec.jar">
+        <isset property="cxf.build"/>
+    </condition>
+
+    <property name="entity.jars" value="jboss-ejb-api_3.1_spec.jar hibernate-jpa-2.0-api.jar"/>
+
+    <property name="jboss.client.lib.jars" value="jaxb-api.jar jboss-javaee.jar
+             jbossws-client.jar stax-api.jar 
+             jbossws-native-core.jar jbossws-common.jar jboss-logging-spi.jar
+             ${cxf.client.lib.jars} ${entity.jars}"/>
+    <property name="jboss.client.libs" value="${jboss.client.lib.jars}"/>
+
+    <property name="jboss.common.libs" value="jboss-servlet-api_3.0_spec.jar jaxrpc-api.jar"/>
+
+    <property name="bridge.libs" value="txbridge.jar"/>
+
+    <property name="txframework.libs" value="txframework.jar"/>
+
+    <!-- ================================================================== -->
+
+    <property name="build.dir" location="build"/>
+    <property name="src.dir" location="src"/>
+    <property name="dd.dir" location="dd"/>
+    <property name="jboss.dd.dir" location="${dd.dir}/jboss"/>
+    <property name="build.jboss.dd.dir" location="${build.dir}/dd/jboss"/>
+
+    <property name="web.dir" location="web"/>
+    <property name="build.web.dir" location="${build.dir}/web"/>
+
+    <property name="javac.debug"             value="on"/>
+    <property name="javac.optimize"          value="off"/>
+
+    <path id="lib.path">
+        <fileset dir="${lib.dir}" includes="${lib.libs}"/>
+    </path>
+    <path id="ext.path">
+        <fileset dir="${jbossts.lib.dir}" includes="${ext.libs}"/>
+    </path>
+
+    <path id="jboss.client.path">
+        <fileset dir="${jboss.client.lib.dir}" includes="${jboss.client.libs}"/>
+        <fileset dir="${jboss.common.lib.dir}" includes="${jboss.common.libs}"/>
+    </path>
+
+    <path id="bridge.path">
+        <fileset dir="${bridge.lib.dir}" includes="${bridge.libs}"/>
+    </path>
+
+    <path id="txframework.path">
+        <fileset dir="${txframework.lib.dir}" includes="${txframework.libs}"/>
+    </path>
+
+    <filterset id="webxml.filter">
+        <filter token="restaurantURL" value="${restaurantURL}"/>
+        <filter token="taxiURL" value="${taxiURL}"/>
+        <filter token="theatreURL" value="${theatreURL}"/>
+        <filter token="hostname" value="${hostname}"/>
+        <filter token="port" value="${port}"/>
+        <filter token="urlstub" value="${urlstub}"/>
+    </filterset>
+
+    <target name="clean">
+        <delete dir="${build.dir}"/>
+        <delete>
+            <fileset dir="." includes="**/*.bak" defaultexcludes="no"/>
+            <fileset dir="." includes="**/*~"    defaultexcludes="no"/>
+            <fileset dir="." includes="**/#*#"   defaultexcludes="no"/>
+            <fileset dir="." includes="**/.#*"   defaultexcludes="no"/>
+        </delete>
+    </target>
+
+    <target name="init-properties">
+        <property name="hostname" value="localhost"/>
+        <property name="port" value="8080"/>
+        <property name="urlstub" value="xtsdemowebservices"/>
+        <path id="compile.path">
+            <path refid="lib.path"/>
+            <path refid="jboss.client.path"/>
+            <path refid="ext.path"/>
+            <path refid="bridge.path"/>
+            <path refid="txframework.path"/>
+        </path>
+    </target>
+
+    <target name="init" depends="init-properties, clean">
+        <mkdir dir="${build.dir}"/>
+        <mkdir dir="${build.dir}/classes"/>
+        <mkdir dir="${build.jboss.dd.dir}"/>
+    </target>
+
+    <target name="compile" depends="init">
+        <javac destdir="${build.dir}/classes" debug="${javac.debug}"
+            optimize="${javac.optimize}" deprecation="${javac.deprecation}" >
+            <classpath>
+                <path refid="compile.path"/>
+            </classpath>
+            <src path="${src.dir}"/>
+            <patternset>
+	        <!-- client app -->
+                <include name="org/jboss/jbossts/txframework/demo/client/**/*"/>
+            <!-- server impl -->
+                <include name="org/jboss/jbossts/txframework/demo/services/**"/>
+            <!-- entity impl -->
+                <include name="org/jboss/jbossts/txframework/demo/entities/**"/>
+	        <!-- generated server interfaces and service classes -->
+                <include name="org/jboss/jbossts/txframework/demo/restaurant/**"/>
+                <include name="org/jboss/jbossts/txframework/demo/taxi/**"/>
+                <include name="org/jboss/jbossts/txframework/demo/theatre/**"/>
+            </patternset>
+        </javac>
+    </target>
+
+    <!-- the server side elements -->
+    <target name="jboss-webservices" depends="compile, jboss-entity-jar, jboss-webservice-war"/>
+
+    <target name="jboss-entity-jar">
+        <jar destfile="${build.dir}/xts-demo-entity.jar">
+            <!--
+            <fileset  dir="${build.dir}/classes/"
+                      includes="org/jboss/jbossts/txframework/demo/entities/**/*"/>
+            -->
+        </jar>
+    </target>
+
+    <target name="jboss-webservice-war">
+        <copy tofile="${build.dir}/classes/org/jboss/jbossts/txframework/demo/services/context-handlers.xml"
+	      file="${jboss.dd.dir}/context-handlers.xml"/>
+        <war destfile="${build.dir}/xts-demo-webservices.war" webxml="${jboss.dd.dir}/service-web-app.xml" >
+	    <!-- include app wsdl -->
+            <webinf dir="${jboss.dd.dir}" includes="wsdl/*.wsdl"/>
+	        <!-- server impl -->
+	    <classes dir="${build.dir}/classes">
+            <include name="org/jboss/jbossts/txframework/demo/services/**/*"/>
+	    </classes>
+	        <!-- generated server interfaces -->
+	    <classes dir="${build.dir}/classes/"
+		includes="org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="org/jboss/jbossts/txframework/demo/theatre/ITheatreService.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="org/jboss/jbossts/txframework/demo/taxi/ITaxiService.class"/>
+        </war>
+    </target>
+
+    <!-- the client side elements -->
+    <target name="jboss-webapp" depends="compile">
+        <copy tofile="${build.dir}/client-web-app.xml" file="${jboss.dd.dir}/client-web-app.xml">
+            <filterset refid="webxml.filter"/>
+        </copy>
+
+        <war warfile="${build.dir}/xts-demo-client.war" webxml="${build.dir}/client-web-app.xml">
+	    <!-- include app wsdl and wscoor wsdl -->
+            <webinf dir="${jboss.dd.dir}" includes="wsdl/*.wsdl"/>
+	    <!-- impl classes -->
+            <classes dir="${build.dir}/classes"
+                includes="org/jboss/jbossts/txframework/demo/client/**"/>
+	    <!-- generated interfaces -->
+            <classes dir="${build.dir}/classes"
+                includes="org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="org/jboss/jbossts/txframework/demo/theatre/ITheatreService.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="org/jboss/jbossts/txframework/demo/taxi/ITaxiService.class"/>
+	    <!-- jsp files -->
+            <fileset dir="${web.dir}"/>
+        </war>
+    </target>
+
+    <!-- the ear files -->
+    <target name="jboss-ear" depends="jboss-webservices, jboss-webapp">
+        <copy tofile="${build.jboss.dd.dir}/application.xml" file="${jboss.dd.dir}/application.xml">
+            <filterset refid="webxml.filter"/>
+        </copy>
+        <ear earfile="${build.dir}/xts-demo.ear"
+            appxml="${build.jboss.dd.dir}/application.xml">
+            <fileset dir="${build.dir}" includes="xts-demo-webservices.war xts-demo-client.war xts-demo-entity.jar"/>
+            <fileset  dir="${build.dir}/classes/"
+                      includes="org/jboss/jbossts/txframework/demo/entities/**/*"/>
+            <metainf dir="${jboss.dd.dir}" includes="persistence.xml"/>
+        </ear>
+    </target>
+
+    <target  name="docs">
+        <javadoc packagenames="com.jboss.jbosstm.xts.demo.*" destdir="docs">
+            <classpath>
+                <path refid="compile.path"/>
+            </classpath>
+            <sourcefiles>
+                <fileset dir="${src.dir}" includes="**/*.java"/>
+            </sourcefiles>
+        </javadoc>
+    </target>
+
+    <target name="build" depends="jboss-ear, docs"/>
+
+    <target name="deploy" depends="build, undeploy">
+        <copy file="${build.dir}/xts-demo.ear" tofile="${deploy.dir}/xts-demo.ear"/>
+    </target>
+
+    <target name="undeploy">
+        <delete file="${deploy.dir}/xts-demo.ear"/>
+    </target>
+</project>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/application.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/application.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/application.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,49 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!-- $Id: axis-application.xml,v 1.8.4.1 2005/11/22 10:42:05 kconner Exp $ -->
+
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+
+<application>
+    <display-name>XML Transaction Service Demo</display-name>
+
+    <description>XML Transaction Service Demo</description>
+
+    <module>
+        <ejb>xts-demo-entity.jar</ejb>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>xts-demo-webservices.war</web-uri>
+            <context-root>/@urlstub@</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>xts-demo-client.war</web-uri>
+            <context-root>/xts-demo-client</context-root>
+        </web>
+    </module>
+</application>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/client-web-app.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/client-web-app.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/client-web-app.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,52 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+	version="2.4">
+    <display-name>XML Transaction Service Demo Client</display-name>
+
+    <description>XML Transaction Service Demo Client</description>
+
+    <servlet>
+        <servlet-name>Basic Client Servlet</servlet-name>
+        <servlet-class>org.jboss.jbossts.txframework.demo.client.BasicClient</servlet-class>
+        <init-param>
+            <param-name>restaurantURL</param-name>
+            <param-value>@restaurantURL@</param-value>
+        </init-param>
+        <init-param>
+            <param-name>taxiURL</param-name>
+            <param-value>@taxiURL@</param-value>
+        </init-param>
+        <init-param>
+            <param-name>theatreURL</param-name>
+            <param-value>@theatreURL@</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>Basic Client Servlet</servlet-name>
+        <url-pattern>/basicclient</url-pattern>
+    </servlet-mapping>
+</web-app>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/context-handlers.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/context-handlers.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/context-handlers.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+-->
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee"
+                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+    <handler-chain>
+        <handler>
+            <handler-name>Inbound bridge handler</handler-name>
+            <handler-class>org.jboss.jbossts.txbridge.inbound.JaxWSTxInboundBridgeHandler</handler-class>
+        </handler>
+        <handler>
+            <handler-name>ContextHandler</handler-name>
+            <handler-class>com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor</handler-class>
+        </handler>
+    </handler-chain>
+</handler-chains>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/persistence.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/persistence.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/persistence.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0">
+    <persistence-unit name="entity">
+        <jta-data-source>java:/MySqlDS</jta-data-source>
+        <properties>
+         <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+<!--
+         <property name="jboss.entity.manager.jndi.name" value="java:/entityManager"/>
+         <property name="jboss.entity.manager.factory.jndi.name" value="java:/entityManagerFactory"/>
+-->
+        </properties>
+    </persistence-unit>
+</persistence>
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/service-web-app.xml
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/service-web-app.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/service-web-app.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,52 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+	version="2.4">
+
+    <servlet>
+		<servlet-name>RestaurantService</servlet-name>
+		<servlet-class>org.jboss.jbossts.txframework.demo.services.restaurant.RestaurantService</servlet-class>
+	</servlet>
+	<servlet>
+		<servlet-name>TheatreService</servlet-name>
+		<servlet-class>org.jboss.jbossts.txframework.demo.services.theatre.TheatreService</servlet-class>
+	</servlet>
+	<servlet>
+		<servlet-name>TaxiService</servlet-name>
+		<servlet-class>org.jboss.jbossts.txframework.demo.services.taxi.TaxiService</servlet-class>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>RestaurantService</servlet-name>
+		<url-pattern>/RestaurantService</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>TheatreService</servlet-name>
+		<url-pattern>/TheatreService</url-pattern>
+	</servlet-mapping>
+	<servlet-mapping>
+		<servlet-name>TaxiService</servlet-name>
+		<url-pattern>/TaxiService</url-pattern>
+	</servlet-mapping>
+</web-app>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/RestaurantService.wsdl
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/RestaurantService.wsdl	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/RestaurantService.wsdl	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,88 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  xmlns:intf="http://www.jboss.org/jbossts/txframework/demo/Restaurant"
+                  xmlns:impl="http://www.jboss.org/jbossts/txframework/demo/Restaurant"
+                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:apachesoap="http://xml.apache.org/xml-soap"
+                  xmlns="http://schemas.xmlsoap.org/wsdl/"
+                  targetNamespace="http://www.jboss.org/jbossts/txframework/demo/Restaurant">
+
+   <wsdl:message name="bookSeatsRequest">
+
+      <wsdl:part name="how_many" type="xsd:int"/>
+
+   </wsdl:message>
+
+   <wsdl:message name="bookSeatsResponse">
+       <wsdl:part name="bookSeatsResponse" type="xsd:boolean"/>
+   </wsdl:message>
+
+   <wsdl:portType name="IRestaurantService">
+
+      <wsdl:operation name="bookSeats" parameterOrder="how_many">
+
+         <wsdl:input name="bookSeatsRequest" message="intf:bookSeatsRequest"/>
+
+         <wsdl:output name="bookSeatsResponse" message="intf:bookSeatsResponse"/>
+
+      </wsdl:operation>
+
+   </wsdl:portType>
+
+   <wsdl:binding name="RestaurantServiceSoapBinding" type="intf:IRestaurantService">
+
+      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+      <wsdl:operation name="bookSeats">
+
+         <wsdlsoap:operation soapAction=""/>
+
+         <wsdl:input name="bookSeatsRequest">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Restaurant"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="bookSeatsResponse">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Restaurant"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+   </wsdl:binding>
+
+   <wsdl:service name="RestaurantServiceService">
+
+      <wsdl:port name="RestaurantService" binding="intf:RestaurantServiceSoapBinding">
+
+         <wsdlsoap:address location="http://localhost:8080/xtsdemowebservices/RestaurantService"/>
+
+      </wsdl:port>
+
+   </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TaxiService.wsdl
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TaxiService.wsdl	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TaxiService.wsdl	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,86 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  xmlns:intf="http://www.jboss.org/jbossts/txframework/demo/Taxi"
+                  xmlns:impl="http://www.jboss.org/jbossts/txframework/demo/Taxi"
+                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:apachesoap="http://xml.apache.org/xml-soap"
+                  xmlns="http://schemas.xmlsoap.org/wsdl/"
+                  targetNamespace="http://www.jboss.org/jbossts/txframework/demo/Taxi">
+
+   <wsdl:message name="bookTaxiRequest">
+
+   </wsdl:message>
+
+   <wsdl:message name="bookTaxiResponse">
+       <wsdl:part name="bookTaxiResponse" type="xsd:boolean"/>
+   </wsdl:message>
+
+   <wsdl:portType name="ITaxiService">
+
+      <wsdl:operation name="bookTaxi">
+
+         <wsdl:input name="bookTaxiRequest" message="intf:bookTaxiRequest"/>
+
+         <wsdl:output name="bookTaxiResponse" message="intf:bookTaxiResponse"/>
+
+      </wsdl:operation>
+
+   </wsdl:portType>
+
+   <wsdl:binding name="TaxiServiceSoapBinding" type="intf:ITaxiService">
+
+      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+      <wsdl:operation name="bookTaxi">
+
+         <wsdlsoap:operation soapAction=""/>
+
+         <wsdl:input name="bookTaxiRequest">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Taxi"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="bookTaxiResponse">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Taxi"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+   </wsdl:binding>
+
+   <wsdl:service name="TaxiServiceService">
+
+      <wsdl:port name="TaxiService" binding="intf:TaxiServiceSoapBinding">
+
+         <wsdlsoap:address location="http://localhost:8080/xtsdemowebservices/TaxiService"/>
+
+      </wsdl:port>
+
+   </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TheatreService.wsdl
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TheatreService.wsdl	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/TheatreService.wsdl	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,90 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+                  xmlns:intf="http://www.jboss.org/jbossts/txframework/demo/Theatre"
+                  xmlns:impl="http://www.jboss.org/jbossts/txframework/demo/Theatre"
+                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
+                  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+                  xmlns:apachesoap="http://xml.apache.org/xml-soap"
+                  xmlns="http://schemas.xmlsoap.org/wsdl/"
+                  targetNamespace="http://www.jboss.org/jbossts/txframework/demo/Theatre">
+
+   <wsdl:message name="bookSeatsResponse">
+       <wsdl:part name="bookSeatsResponse" type="xsd:boolean"/>
+   </wsdl:message>
+
+   <wsdl:message name="bookSeatsRequest">
+
+      <wsdl:part name="how_many" type="xsd:int"/>
+
+      <wsdl:part name="which_area" type="xsd:int"/>
+
+   </wsdl:message>
+
+   <wsdl:portType name="ITheatreService">
+
+      <wsdl:operation name="bookSeats" parameterOrder="how_many which_area">
+
+         <wsdl:input name="bookSeatsRequest" message="intf:bookSeatsRequest"/>
+
+         <wsdl:output name="bookSeatsResponse" message="intf:bookSeatsResponse"/>
+
+      </wsdl:operation>
+
+   </wsdl:portType>
+
+   <wsdl:binding name="TheatreServiceSoapBinding" type="intf:ITheatreService">
+
+      <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+      <wsdl:operation name="bookSeats">
+
+         <wsdlsoap:operation soapAction=""/>
+
+         <wsdl:input name="bookSeatsRequest">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Theatre"/>
+
+         </wsdl:input>
+
+         <wsdl:output name="bookSeatsResponse">
+
+            <wsdlsoap:body use="literal" namespace="http://www.jboss.org/jbossts/txframework/demo/Theatre"/>
+
+         </wsdl:output>
+
+      </wsdl:operation>
+
+   </wsdl:binding>
+
+   <wsdl:service name="TheatreServiceService">
+
+      <wsdl:port name="TheatreService" binding="intf:TheatreServiceSoapBinding">
+
+         <wsdlsoap:address location="http://localhost:8080/xtsdemowebservices/TheatreService"/>
+
+      </wsdl:port>
+
+   </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/build.sh
===================================================================
--- labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/build.sh	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/dd/jboss/wsdl/build.sh	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,27 @@
+#!/bin/bash
+# generate jaxws code from wsdl
+
+WSCONSUME=$JBOSS_HOME/bin/wsconsume.sh
+
+if [ -d tmp/src ] ; then
+  rm -rf tmp/src/*
+fi
+if [ -d tmp/classes ] ; then
+  rm -rf tmp/classes/*
+fi
+if [ ! -d tmp/src ]; then
+  mkdir -p tmp/src
+fi
+if [ ! -d tmp/classes ] ; then
+  mkdir -p tmp/classes
+fi
+
+if [ $# -eq 0 ]; then
+    files=`ls *.wsdl` 
+else
+    files="$*"
+fi
+for wsdlfile in $files
+do
+  $WSCONSUME -s tmp/src -o tmp/classes -k -t 2.1  -w /WEB-INF/wsdl/$wsdlfile $wsdlfile
+done

Added: labs/jbosstm/workspace/txframework/demo/jboss.properties
===================================================================
--- labs/jbosstm/workspace/txframework/demo/jboss.properties	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/jboss.properties	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,40 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006-2011, Red Hat 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 Lesser General Public License, v. 2.1.
+  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 Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+  MA  02110-1301, USA.
+
+  (C) 2005-2011,
+  @author JBoss Inc.
+-->
+<!-- JBoss property file
+  The following tokens should be replaced for JBoss deployment
+
+  JBOSS_HOSTNAME - the hostname of the JBoss installation (localhost)
+  JBOSS_PORT - the port of the JBoss web server (8080)
+  JBOSS_URLSTUB - the url stub for the demo webservices (xtsdemowebservices)
+
+  You can choose any combination of the URL entries provided that there is an entry for each service.
+  The default services are the ones running within JBoss.
+-->
+<arjuna>
+  <hostname>localhost</hostname>
+  <port>8080</port>
+  <urlstub>xtsdemowebservices</urlstub>
+
+  <!-- JBoss services -->
+  <restaurantURL>http://localhost:8080/xtsdemowebservices/RestaurantService</restaurantURL>
+  <taxiURL>http://localhost:8080/xtsdemowebservices/TaxiService</taxiURL>
+  <theatreURL>http://localhost:8080/xtsdemowebservices/TheatreService</theatreURL>
+</arjuna>

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/client/BasicClient.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/client/BasicClient.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/client/BasicClient.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,522 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * BasicClient.java
+ *
+ * Copyright (c) 2003, 2004 Arjuna Technologies Ltd.
+ *
+ * $Id: BasicClient.java,v 1.10 2004/12/02 16:52:58 kconner Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.client;
+
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.mw.wst11.UserBusinessActivityFactory;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
+import com.arjuna.mw.wst11.client.JaxWSHeaderContextProcessor;
+import com.arjuna.wst.TransactionRolledBackException;
+
+import org.jboss.jbossts.txframework.demo.restaurant.IRestaurantService;
+import org.jboss.jbossts.txframework.demo.taxi.ITaxiService;
+import org.jboss.jbossts.txframework.demo.theatre.ITheatreService;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import javax.xml.ws.handler.Handler;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * A very basic client application that drives the
+ * (transactional) Web Services to arrange a night out.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Id: BasicClient.java,v 1.10 2004/12/02 16:52:58 kconner Exp $
+ */
+public class BasicClient extends HttpServlet
+{
+    /**
+     * The client serial version UID.
+     */
+    private static final long serialVersionUID = 7728495576623420083L ;
+
+    /**
+     * The servlet context.
+     */
+    private ServletContext context ;
+
+    /***** RESTAURANT SERVICE *****/
+
+    /**
+     * The namespace for the Restaurant webservice.
+     */
+    private static final String RESTAURANT_NS = "http://www.jboss.org/jbossts/txframework/demo/Restaurant" ;
+    /**
+     * The prefix for the Restaurant webservice.
+     */
+    private static final String RESTAURANT_PREFIX = "restaurant";
+    /**
+     * The local name for the AT Restaurant webservice.
+     */
+    private static final String RESTAURANT_SERVICE = "RestaurantServiceService";
+    /**
+     * The QName for the AT Restaurant webservice.
+     */
+    private static final QName RESTAURANT_SERVICE_QNAME
+            = new QName(RESTAURANT_NS, RESTAURANT_SERVICE, RESTAURANT_PREFIX);
+    /**
+     * The local name for the Restaurant webservice.
+     */
+    private static final String RESTAURANT_ENDPOINT = "RestaurantService";
+    /**
+     * The QName for the Restaurant endpoint.
+     */
+    private static final QName RESTAURANT_ENDPOINT_QNAME
+            = new QName(RESTAURANT_NS, RESTAURANT_ENDPOINT, RESTAURANT_PREFIX);
+
+    /***** THEATRE SERVICE *****/
+
+    /**
+     * The namespace for the Theatre webservice.
+     */
+    private static final String THEATRE_NS = "http://www.jboss.org/jbossts/txframework/demo/Theatre" ;
+    /**
+     * The prefix for the Theatre webservice.
+     */
+    private static final String THEATRE_PREFIX = "theatre";
+    /**
+     * The local name for the Theatre webservice.
+     */
+    private static final String THEATRE_SERVICE = "TheatreServiceService";
+    /**
+     * The QName for the Theatre webservice.
+     */
+    private static final QName THEATRE_SERVICE_QNAME
+            = new QName(THEATRE_NS, THEATRE_SERVICE, THEATRE_PREFIX);
+    /**
+     * The local name for the Theatre endpoint.
+     */
+    private static final String THEATRE_ENDPOINT = "TheatreService";
+    /**
+     * The QName for the Theatre endpoint.
+     */
+    private static final QName THEATRE_ENDPOINT_QNAME
+            = new QName(THEATRE_NS, THEATRE_ENDPOINT, THEATRE_PREFIX);
+
+    /***** TAXI SERVICE *****/
+
+    /**
+     * The namespace for the Taxi webservice.
+     */
+    private static final String TAXI_NS = "http://www.jboss.org/jbossts/txframework/demo/Taxi" ;
+    /**
+     * The prefix for the Taxi webservice.
+     */
+    private static final String TAXI_PREFIX = "taxi";
+    /**
+     * The local name for the Taxi webservice.
+     */                                       
+    private static final String TAXI_SERVICE = "TaxiServiceService";
+    /**
+     * The QName for the Taxi webservice.
+     */
+    private static final QName TAXI_SERVICE_QNAME
+            = new QName(TAXI_NS, TAXI_SERVICE, TAXI_PREFIX);
+    /**
+     * The local name for the Taxi endpoint.
+     */
+    private static final String TAXI_ENDPOINT = "TaxiService";
+    /**
+     * The QName for the Taxi endpoint.
+     */
+    private static final QName TAXI_ENDPOINT_QNAME
+            = new QName(TAXI_NS, TAXI_ENDPOINT, TAXI_PREFIX);
+
+    /***** Client Handles for Service Endpoint Ports *****/
+
+    /**
+     * The restaurant stub.
+     */
+    private IRestaurantService restaurant;
+    /**
+     * The theatre stub.
+     */
+    private ITheatreService theatre;
+    /**
+     * The taxi stub.
+     */
+    private ITaxiService taxi;
+    /***** Endpoint Addresses *****/
+
+    /**
+     * URL of restaurant
+     */
+    private String restaurantURL;
+    /**
+     * URL of taxi
+     */
+    private String taxiURL;
+    /**
+     * URL of theatre
+     */
+    private String theatreURL;
+
+    /***** WSDL file locations *****/
+
+    /**
+     * URL of restaurant
+     */
+    private final String restaurantWSDL = "wsdl/RestaurantService.wsdl";
+    /**
+     * URL of taxi
+     */
+    private final String taxiWSDL = "wsdl/TaxiService.wsdl";
+    /**
+     * URL of theatre
+     */
+    private final String theatreWSDL = "wsdl/TheatreService.wsdl";
+
+    /**
+     * The initialised flag.
+     */
+    private boolean initialised ;
+    
+    /**
+     * Initialise the servlet.
+     * @param config The servlet configuration.
+     */
+    public void init(final ServletConfig config)
+        throws ServletException
+    {
+        final String baseURL = "http://localhost:8080/xtsdemowebservices/" ;
+
+        restaurantURL = getURL(config, "restaurantURL", baseURL + RESTAURANT_SERVICE);
+        taxiURL = getURL(config, "taxiURL", baseURL + TAXI_SERVICE);
+        theatreURL = getURL(config, "theatreURL", baseURL + THEATRE_SERVICE);
+
+        context = config.getServletContext();
+    }
+
+    /**
+     * configure the XTS client handler which manages transaction flow for invocations of the services
+     *
+     * @param bindingProvider
+     */
+    private void configureClientHandler(BindingProvider bindingProvider)
+    {
+        Handler handler = new JaxWSHeaderContextProcessor();
+        List<Handler> handlers = Collections.singletonList(handler);
+        bindingProvider.getBinding().setHandlerChain(handlers);
+    }
+
+    /**
+     * Initialise if necessary
+     */
+    private synchronized void initialise()
+    throws ServletException
+    {
+        if (!initialised)
+        {
+            try
+            {
+                restaurant = getService(RESTAURANT_SERVICE_QNAME, RESTAURANT_ENDPOINT_QNAME,
+                        restaurantURL, restaurantWSDL, IRestaurantService.class);
+                configureClientHandler((BindingProvider) restaurant);
+
+                theatre = getService(THEATRE_SERVICE_QNAME, THEATRE_ENDPOINT_QNAME,
+                        theatreURL, theatreWSDL, ITheatreService.class);
+                configureClientHandler((BindingProvider) theatre);
+
+                taxi = getService(TAXI_SERVICE_QNAME, TAXI_ENDPOINT_QNAME,
+                        taxiURL, taxiWSDL, ITaxiService.class);
+                configureClientHandler((BindingProvider) taxi);
+            }
+            catch (final Exception ex)
+            {
+                ex.printStackTrace();
+                throw new ServletException(ex);
+            }
+            initialised = true ;
+        }
+    }
+
+    /**
+     * Simple wrapper to allow our test method to be invoked when
+     * running in a servlet container, taking parameters from the
+     * request URL and displaying the outcome on the resulting html page.
+     *
+     * @param request
+     * @param response
+     * @throws ServletException
+     * @throws java.io.IOException
+     */
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
+    {
+        initialise() ;
+
+        // get business logic params from the form submission.
+        int restaurantSeats = Integer.parseInt(request.getParameter("restaurant"));
+        int theatreCircleSeats = Integer.parseInt(request.getParameter("theatrecirclecount"));
+        int theatreStallsSeats = Integer.parseInt(request.getParameter("theatrestallscount"));
+        int theatreBalconySeats = Integer.parseInt(request.getParameter("theatrebalconycount"));
+        int taxiCount = Integer.parseInt(request.getParameter("taxi"));
+        boolean bookTaxi = (taxiCount >= 1 ? true : false);
+
+        String result = "Transaction finished OK.";
+        String txType = request.getParameter("txType");
+
+        try
+        {
+            if ("AtomicTransaction".equals(txType))
+            {
+                if (!testAtomicTransaction(restaurantSeats, theatreCircleSeats, theatreStallsSeats, theatreBalconySeats, bookTaxi)) {
+                    result = "Transaction rolled back.";
+                }
+            }
+            else if ("BusinessActivity".equals(txType))
+            {
+                if (!testBusinessActivity(restaurantSeats, theatreCircleSeats, theatreStallsSeats, theatreBalconySeats, bookTaxi))
+                {
+                    result = "Transaction cancelled/compensated.";
+                }
+            }
+            else
+            {
+                result = "Unknown transaction type " + txType;
+            }
+        }
+        catch (final TransactionRolledBackException tre)
+        {
+            result = "Transaction rolled back." ;
+            System.out.println("Transaction rolled back") ;
+        }
+        catch (Exception e)
+        {
+            result = "Transaction failed! Cause: " + e.toString();
+            System.out.println("CLIENT: problem: ");
+            e.printStackTrace(System.out);
+        }
+
+        request.setAttribute("result", result);
+        context.getRequestDispatcher("/index.jsp").forward(request, response);
+    }
+
+    /**
+     * Run a simple transaction involving three Web Services.
+     * Use the Atomic Transaction type.
+     * <p/>
+     * Note: due to the implementation of the transaction infrastructure,
+     * this method must be invoked with a web application container. It will
+     * not run correctly in a standalone java application.
+     *
+     * @throws Exception for any unexpected errors, such as a failure to commit.
+     */
+    private boolean testAtomicTransaction(int restaurantSeats, int theatreCircleSeats, int theatreStallsSeats, int theatreBalconySeats, boolean bookTaxi) throws Exception
+    {
+        System.out.println("CLIENT: obtaining userTransaction...");
+
+        UserTransaction ut = UserTransactionFactory.userTransaction();
+
+        System.out.println("CLIENT: starting the transaction...");
+
+        ut.begin();
+
+        System.out.println("CLIENT: transaction ID= " + ut.toString());
+
+        System.out.println("CLIENT: calling business Web Services...");
+
+        boolean isOK;
+        try
+        {
+            isOK = restaurant.bookSeats(restaurantSeats);
+            if (isOK && theatreCircleSeats != 0) {
+                isOK = theatre.bookSeats(theatreCircleSeats, 0);
+            }
+            if (isOK && theatreStallsSeats != 0) {
+                isOK = theatre.bookSeats(theatreStallsSeats, 1);
+            }
+            if (isOK &&theatreBalconySeats != 0) {
+                isOK = theatre.bookSeats(theatreBalconySeats, 2);
+            }
+            if (isOK &&bookTaxi)
+            {
+                isOK = taxi.bookTaxi();
+            }
+        }
+        catch (final Throwable th)
+        {
+            System.out.println("CLIENT: caught exception processing bookings, rolling back (" + th + ")") ;
+            try {
+                ut.rollback();
+            } catch (Throwable th2) {
+                System.out.println("CLIENT: caught exception rolling back transaction (" + th2 + ")") ;
+            }
+            return false;
+        }
+
+        if (isOK) {
+            try {
+                ut.commit();
+                System.out.println("CLIENT: calling commit on the transaction...");
+            } catch (Throwable th) {
+                System.out.println("CLIENT: caught exception committing transaction (" + th + ")") ;
+            }
+        } else {
+            try{
+                ut.rollback();
+                System.out.println("CLIENT: calling rollback on the transaction...");
+            } catch (Throwable th) {
+                System.out.println("CLIENT: caught exception rolling back transaction (" + th + ")") ;
+            }
+        }
+
+        System.out.println("done.");
+        System.out.flush();
+
+        return isOK;
+    }
+
+    /**
+     * Run a simple transaction involving three Web Services.
+     * Use the Business Activity type.
+     * <p/>
+     * Note: due to the implementation of the transaction infrastructure,
+     * this method must be invoked with a web application container. It will
+     * not run correctly in a standalone java application.
+     *
+     * @throws Exception for any unexpected errors, such as a failure to commit.
+     */
+    private boolean testBusinessActivity(int restaurantSeats, int theatreCircleSeats, int theatreStallsSeats, int theatreBalconySeats, boolean bookTaxi) throws Exception
+    {
+        System.out.println("CLIENT: obtaining userBusinessActivity...");
+
+        UserBusinessActivity uba = UserBusinessActivityFactory.userBusinessActivity();
+
+        System.out.println("CLIENT: starting the transaction...");
+
+        uba.begin();
+
+        System.out.println("CLIENT: transaction ID= " + uba.toString());
+
+        System.out.println("CLIENT: calling business Web Services...");
+
+        boolean isOK = true ;
+        try
+        {
+            isOK = restaurant.bookSeats(restaurantSeats);
+
+            if (isOK && theatreCircleSeats != 0)
+            {
+                isOK = theatre.bookSeats(theatreCircleSeats, 0);
+            }
+            if (isOK && theatreStallsSeats != 0)
+            {
+                isOK = theatre.bookSeats(theatreStallsSeats, 1);
+            }
+            if (isOK && theatreBalconySeats != 0)
+            {
+                isOK = theatre.bookSeats(theatreBalconySeats, 2);
+            }
+            if (isOK && bookTaxi)
+            {
+                isOK = taxi.bookTaxi();
+            }
+        }
+        catch (final Throwable th)
+        {
+            System.out.println("CLIENT: caught exception processing bookings, cancelling (" + th + ")") ;
+            try {
+                uba.cancel();
+            } catch (Throwable th2) {
+                System.out.println("CLIENT: caught exception cancelling transaction (" + th2 + ")") ;
+            }
+            return false;
+        }
+
+        if (isOK) {
+            try {
+                System.out.println("CLIENT: calling close on the transaction...");
+                uba.close();
+            } catch (Throwable th) {
+                System.out.println("CLIENT: caught exception  closing transaction (" + th + ")") ;
+                return false;
+            }
+        } else {
+            try {
+                System.out.println("CLIENT: calling cancel on the transaction...");
+                uba.cancel();
+            } catch (Throwable th) {
+                System.out.println("CLIENT: caught exception cancelling transaction (" + th + ")") ;
+                return false;
+            }
+        }
+        
+        return isOK;
+    }
+
+    /**
+     * @param config The servlet config
+     * @param property The property name
+     * @param defaultValue The default value.
+     * @return The initialisation property value or the default value if not present. 
+     */
+    private String getURL(final ServletConfig config, final String property, final String defaultValue)
+    {
+        // allow command line override via system property
+        String value = System.getProperty(property);
+        if (value == null) {
+            value = config.getInitParameter(property) ;
+        }
+        return (value == null ? defaultValue : value) ;
+    }
+    
+    /**
+     * Get an endpoint reference for a service so we can create a JaxWS port for it
+     * @param serviceName the QName of the service in question..
+     * @param endpointName the QName of the endpoint associated with the service
+     * @param address a string representation of the service URL. null is ok if this is a service located in the
+     * same app as the client
+     * @return a W3CEndpointReference from which the service port can be obtained.
+     */
+    private <T> T getService(final QName serviceName, final QName endpointName,
+                                            final String address, final String wsdlURL, final Class<T> clazz)
+            throws MalformedURLException
+    {
+        URL url = BasicClient.class.getResource("../../../../../../../" + wsdlURL);
+        Service service = Service.create(url, serviceName);
+        T port = service.getPort(endpointName, clazz);
+        BindingProvider bindingProvider = ((BindingProvider) port);
+        bindingProvider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
+        return port;
+    }
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantConstants.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantConstants.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantConstants.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,12 @@
+package org.jboss.jbossts.txframework.demo.entities.restaurant;
+
+/**
+ * Constant values used by the restaurant service
+ */
+public class RestaurantConstants
+{
+    /**
+     * The default initial capacity of each seating area.
+     */
+    public static final int DEFAULT_SEATING_CAPACITY = 100;
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManager.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManager.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2010, Red Hat, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * @author JBoss Inc.
+ */
+/*
+ * RestaurantManager.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: RestaurantManager.java,v 1.3 2004/04/21 13:09:18 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.restaurant;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ * The application logic for the Restaurant Service.
+ * <p/>
+ * Stores and manages seating reservations. The restaurant manager provides a book method
+ * allowing the web service endpoint to book or unbook seats.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @author Andrew Dinn (adinn at redhat.com)
+ */
+ at Stateless
+ at Local(RestaurantManagerLocal.class)
+public class RestaurantManager implements RestaurantManagerLocal {
+
+    private final static String RESTAURANT_MANAGER = "RestaurantManager/local";
+
+    public static RestaurantManagerLocal getManager()
+    {
+        try {
+            Context initialContext = new InitialContext();
+            if ( initialContext == null){
+                System.out.println("JNDI problem. Cannot get InitialContext.");
+            }
+            RestaurantManagerLocal manager = (RestaurantManagerLocal)initialContext.lookup(RESTAURANT_MANAGER);
+
+            return manager;
+        }
+        catch ( NamingException ex ) {
+            System.out.println("Restaurant Manager lookup failed: " + ex);
+        }
+        return null;
+    }
+
+    /*****************************************************************************/
+    /* Support for the Web Services                                              */
+    /*****************************************************************************/
+
+    /**
+     * Book a number of seats in the restaurant.
+     *
+     * @param txID   The transaction identifier
+     * @param nSeats The number of seats requested
+     */
+    public synchronized boolean bookSeats(int nSeats)
+    {
+        RestaurantState restaurantState = em.find(RestaurantState.class, ENTITY_ID);
+        if (restaurantState == null) {
+            restaurantState = new RestaurantState();
+            restaurantState.setName("il pinguin");
+            restaurantState.setBookings(0);
+            restaurantState.setMaxBookings(80);
+            em.persist(restaurantState);
+        }
+
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+
+        restaurantView.addMessage("RestaurantManager booking " + nSeats + " seats, current bookings = " + restaurantState.getBookings());
+
+        boolean result =  restaurantState.addBookings(nSeats);
+
+        if (result) {
+            restaurantView.addMessage("RestaurantManager successfully booked " + nSeats + " seats, current bookings = " + restaurantState.getBookings());
+            restaurantView.updateFields(restaurantState);
+        } else {
+            restaurantView.addMessage("RestaurantManager failed to book " + nSeats + " seats");
+        }
+
+        return result;
+    }
+
+    /**
+     * Reset to the initial state.
+     */
+    public synchronized void reset()
+    {
+        RestaurantState restaurantState = em.find(RestaurantState.class, ENTITY_ID);
+        if (restaurantState == null) {
+            restaurantState = new RestaurantState();
+            restaurantState.setName("il pinguin");
+            restaurantState.setBookings(0);
+            restaurantState.setMaxBookings(80);
+            em.persist(restaurantState);
+        }
+
+        int bookings = restaurantState.getBookings();
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+
+        restaurantView.addMessage("RestaurantManager resetting current bookings = " + restaurantState.getBookings());
+
+
+        boolean result =  restaurantState.addBookings(-bookings);
+
+        if (result) {
+            restaurantView.addMessage("RestaurantManager successfully reset " + bookings + " bookings");
+            restaurantView.updateFields(restaurantState);
+        } else {
+            restaurantView.addMessage("RestaurantManager failed to reset " + bookings + " bookings");
+        }
+    }
+
+    /*****************************************************************************/
+    /* Private implementation                                                    */
+    /*****************************************************************************/
+
+    /**
+     * injected entity manager used for looking up entity beans
+     */
+    @PersistenceContext()
+    EntityManager em;
+
+    /**
+     * the id for the singleton entity used to hold the restaurant state
+     */
+    private final static int ENTITY_ID = 1;
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManagerLocal.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManagerLocal.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantManagerLocal.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,10 @@
+package org.jboss.jbossts.txframework.demo.entities.restaurant;
+
+/**
+ * Interface for stateless bean used to manage the restaurant state
+ */
+public interface RestaurantManagerLocal
+{
+    public boolean bookSeats(int nSeats);
+    public void reset();
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantState.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantState.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantState.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,87 @@
+package org.jboss.jbossts.txframework.demo.entities.restaurant;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.GeneratedValue;
+import java.io.Serializable;
+
+/**
+ * Entity class modelling bookings for a restaurant
+ */
+/**
+ * class used  to test JPA enntity management
+ */
+ at Entity
+ at Table(name="restaurant")
+public class RestaurantState implements Serializable
+{
+    @Id
+    @GeneratedValue
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getBookings() {
+        return bookings;
+    }
+
+    public void setBookings(int bookings) {
+        this.bookings = bookings;
+    }
+
+    public int getMaxBookings() {
+        return maxBookings;
+    }
+
+    public void setMaxBookings(int maxBookings) {
+        this.maxBookings = maxBookings;
+    }
+
+    public boolean addBookings(int howMany)
+    {
+        int bookings = getBookings();
+        int maxBookings =  getMaxBookings();
+        int newBookings = bookings + howMany;
+        if (newBookings >= 0 && newBookings <= maxBookings) {
+            setBookings( newBookings );
+            return true;
+        }
+
+        return false;
+    }
+
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder();
+        builder.append("TestEntity {");
+        builder.append("\n    id=");
+        builder.append(id);
+        builder.append("\n    name=");
+        builder.append(name);
+        builder.append("\n    bookings=");
+        builder.append(bookings);
+        builder.append("\n    maxBookings=");
+        builder.append(maxBookings);
+        builder.append(" }\n");
+        return builder.toString();
+    }
+
+    private int id;
+    private String name;
+    private int bookings;
+    private int maxBookings;
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantView.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantView.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/restaurant/RestaurantView.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,247 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * RestaurantView.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: RestaurantView.java,v 1.2 2004/04/21 13:09:18 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.restaurant;
+
+import java.awt.*;
+import java.io.Serializable;
+
+/**
+ * The visual interface (GUI) for the Restaurant Service.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.2 $
+ */
+public class RestaurantView extends javax.swing.JFrame implements Serializable
+{
+    // Note: Some parts of this file were auto-generated
+    // by NetBeans 3.3 FormEditor (http://www.netbeans.org)
+
+    /**
+     * Create a new RestaurantView instance.
+     *
+     * @param rManager The {@link org.jboss.jbossts.txframework.demo.entities.restaurant.RestaurantManager} instance to bind to
+     */
+    public RestaurantView()
+    {
+        initComponents();
+    }
+
+    /**
+     * Initialize the form.
+     * This is called by the constructor
+     * <p/>
+     * WARNING: Automatically generated code, may be overwritten
+     */
+    private void initComponents()
+    {//GEN-BEGIN:initComponents
+        jPanel2 = new javax.swing.JPanel();
+        jLabel5 = new javax.swing.JLabel();
+        jLabelNBookedSeats = new javax.swing.JLabel();
+        jLabel9 = new javax.swing.JLabel();
+        jLabelNFreeSeats = new javax.swing.JLabel();
+        jLabel7 = new javax.swing.JLabel();
+        jButtonResetFields = new javax.swing.JButton();
+        jPanel1 = new javax.swing.JPanel();
+        jLabel8 = new javax.swing.JLabel();
+        jLabel1 = new javax.swing.JLabel();
+        jLabelNTotalSeats = new javax.swing.JLabel();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jTextArea = new javax.swing.JTextArea();
+
+        setTitle("Restaurant Service");
+        setName("restaurantView");
+        addWindowListener(new java.awt.event.WindowAdapter()
+        {
+            public void windowClosing(java.awt.event.WindowEvent evt)
+            {
+                exitForm(evt);
+            }
+        });
+
+        jPanel2.setBorder(new javax.swing.border.LineBorder(java.awt.Color.black));
+        jLabel5.setText("Seats: ");
+        jLabel5.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel5);
+
+        jLabelNBookedSeats.setText("  ");
+        jLabelNBookedSeats.setForeground(java.awt.Color.gray);
+        jLabelNBookedSeats.setFont(new java.awt.Font("Dialog", 1, 18));
+        jPanel2.add(jLabelNBookedSeats);
+
+        jLabel9.setText("Booked,    ");
+        jPanel2.add(jLabel9);
+
+        jLabelNFreeSeats.setText("  ");
+        jLabelNFreeSeats.setForeground(new java.awt.Color(0, 153, 0));
+        jLabelNFreeSeats.setFont(new java.awt.Font("Dialog", 1, 18));
+        jPanel2.add(jLabelNFreeSeats);
+
+        jLabel7.setText("Free            ");
+        jPanel2.add(jLabel7);
+
+        jButtonResetFields.setText("Reset Fields");
+        jButtonResetFields.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                jButtonResetFieldsActionPerformed(evt);
+            }
+        });
+
+        jPanel2.add(jButtonResetFields);
+
+        jPanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        getContentPane().add(jPanel2, java.awt.BorderLayout.SOUTH);
+
+        jPanel1.setBorder(new javax.swing.border.LineBorder(java.awt.Color.black));
+        jLabel8.setText("Restaurant                                      ");
+        jLabel8.setForeground(java.awt.Color.red);
+        jLabel8.setFont(new java.awt.Font("Dialog", 1, 24));
+        jPanel1.add(jLabel8);
+
+        jLabel1.setText("TOTAL SEATS   ");
+        jLabel1.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel1);
+
+        jLabelNTotalSeats.setText("  ");
+        jLabelNTotalSeats.setForeground(java.awt.Color.gray);
+        jLabelNTotalSeats.setFont(new java.awt.Font("Dialog", 1, 18));
+        jPanel1.add(jLabelNTotalSeats);
+
+        jPanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        getContentPane().add(jPanel1, java.awt.BorderLayout.NORTH);
+
+        jScrollPane1.setAutoscrolls(true);
+        jTextArea.setEditable(false);
+        jTextArea.setRows(10);
+        jTextArea.setMargin(new java.awt.Insets(5, 5, 5, 5));
+        jScrollPane1.setViewportView(jTextArea);
+
+        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
+
+        getContentPane().setPreferredSize(new Dimension(600, 200));
+
+        pack();
+    }//GEN-END:initComponents
+
+    /**
+     * Reset event handler.
+     */
+    private void jButtonResetFieldsActionPerformed(java.awt.event.ActionEvent evt)
+    {//GEN-FIRST:event_jButtonResetFieldsActionPerformed
+        RestaurantManagerLocal restaurantManager = RestaurantManager.getManager();
+        restaurantManager.reset();
+    }//GEN-LAST:event_jButtonResetFieldsActionPerformed
+
+    /**
+     * Exit the application.
+     */
+    private void exitForm(java.awt.event.WindowEvent evt)
+    {//GEN-FIRST:event_exitForm
+        //System.exit(0); // disabled for embedding in application servers.
+    }//GEN-LAST:event_exitForm
+
+    /**
+     * Add regular text to the central jTextArea.
+     *
+     * @param text The String to add
+     */
+    public void addMessage(java.lang.String text)
+    {
+        jTextArea.append(text + "\n");
+        jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
+    }
+
+    /**
+     * Add status (highlighted) text to the central jTextArea.
+     *
+     * @param text The String to add
+     */
+    public void addPrepareMessage(java.lang.String text)
+    {
+        jTextArea.append(text + "\n");
+        jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
+    }
+
+
+    /**
+     * Synchronise the GUI with the underlying state.
+     */
+    public void updateFields(RestaurantState restaurantState)
+    {
+        int bookings = restaurantState.getBookings();
+        int maxBookings = restaurantState.getMaxBookings();
+        jLabelNBookedSeats.setText((Integer.toString(bookings)));
+
+        jLabelNTotalSeats.setText((Integer.toString(maxBookings)));
+
+        jLabelNFreeSeats.setText((Integer.toString(maxBookings - bookings)));
+    }
+
+    /**
+     * Allow use of a singleton model for web services demo.
+     */
+    public static RestaurantView getSingletonInstance()
+    {
+        if (singletonInstance == null)
+        {
+            singletonInstance = new RestaurantView();
+        }
+
+        singletonInstance.show();
+        return singletonInstance;
+    }
+
+    /**
+     * A singleton instance of this class.
+     */
+    private static RestaurantView singletonInstance;
+
+
+    // Variables declaration - automatically generated - do not modify
+
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JLabel jLabel5;
+    private javax.swing.JLabel jLabelNBookedSeats;
+    private javax.swing.JLabel jLabel9;
+    private javax.swing.JLabel jLabelNFreeSeats;
+    private javax.swing.JLabel jLabel7;
+    private javax.swing.JButton jButtonResetFields;
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JLabel jLabel8;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabelNTotalSeats;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JTextArea jTextArea;
+
+    // End of automatically generated variables declarations
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManager.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManager.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TaxiManager.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: TaxiManager.java,v 1.3 2004/04/21 13:09:19 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.taxi;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+/**
+ * The application logic for the Taxi Service
+ * <p/>
+ * Manages taxi reservations, providing prepare, commit and rollback calls for
+ * modifying bookings <em>in memory only</em>.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @author Andrew Dinn (adinn at redhat.com)
+ */
+ at Stateless
+ at Local(TaxiManagerLocal.class)
+public class TaxiManager implements TaxiManagerLocal
+{
+    private final static String TAXI_MANAGER = "TaxiManager/local";
+
+    public static TaxiManagerLocal getManager()
+    {
+        try {
+            Context initialContext = new InitialContext();
+            if ( initialContext == null){
+                System.out.println("JNDI problem. Cannot get InitialContext.");
+            }
+            TaxiManagerLocal manager = (TaxiManagerLocal)initialContext.lookup(TAXI_MANAGER);
+
+            return manager;
+        }
+        catch ( NamingException ex ) {
+            System.out.println("Taxi Manager lookup failed: " + ex);
+        }
+        return null;
+    }
+
+    /*****************************************************************************/
+    /* Support for the Web Services                                              */
+    /*****************************************************************************/
+
+    /**
+     * Book a taxi.
+     * @param txID The transaction identifier
+     */
+    public synchronized boolean bookTaxi(int nTaxis)
+    {
+        TaxiState taxiState = em.find(TaxiState.class, ENTITY_ID);
+        if (taxiState == null) {
+            taxiState = new TaxiState();
+            taxiState.setName("xts cabs");
+            taxiState.setBookings(0);
+            em.persist(taxiState);
+        }
+        
+        TaxiView taxiView = TaxiView.getSingletonInstance();
+
+        taxiView.addMessage("TaxiManager booking taxi, current bookings = " + taxiState.getBookings());
+
+        boolean result =  taxiState.addBookings(nTaxis);
+
+        if (result) {
+            taxiView.addMessage("TaxiManager successfully booked taxi, current bookings = " + taxiState.getBookings());
+            taxiView.updateFields(taxiState);
+        } else {
+            taxiView.addMessage("TaxiManager failed to book taxi");
+        }
+
+        return result;
+    }
+
+    /**
+     * Reset to the initial state.
+     */
+    public synchronized void reset()
+    {
+        TaxiState taxiState = em.find(TaxiState.class, ENTITY_ID);
+        if (taxiState == null) {
+            taxiState = new TaxiState();
+            taxiState.setName("xts cabs");
+            taxiState.setBookings(0);
+            em.persist(taxiState);
+        }
+
+        int bookings = taxiState.getBookings();
+        TaxiView taxiView = TaxiView.getSingletonInstance();
+
+        taxiView.addMessage("TaxiManager resetting current bookings = " + taxiState.getBookings());
+
+
+        boolean result =  taxiState.addBookings(-bookings);
+
+        if (result) {
+            taxiView.addMessage("TaxitManager successfully reset " + bookings + " bookings");
+            taxiView.updateFields(taxiState);
+        } else {
+            taxiView.addMessage("TaxitManager failed to reset " + bookings + " bookings");
+        }
+    }
+
+    /*****************************************************************************/
+    /* Private implementation                                                    */
+    /*****************************************************************************/
+
+    /**
+     * injected entity manager used for looking up entity beans
+     */
+    @PersistenceContext()
+    EntityManager em;
+
+    /**
+     * the id for the singleton entity used to hold the theatre state
+     */
+    private final static int ENTITY_ID = 1;
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManagerLocal.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManagerLocal.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiManagerLocal.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,10 @@
+package org.jboss.jbossts.txframework.demo.entities.taxi;
+
+/**
+ * Interface for stateless bean used to manage the restaurant state
+ */
+public interface TaxiManagerLocal
+{
+    public boolean bookTaxi(int nTaxis);
+    public void reset();
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiState.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiState.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiState.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,72 @@
+package org.jboss.jbossts.txframework.demo.entities.taxi;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+/**
+ * Entity class modelling bookings for a taxi
+ */
+
+/**
+ * class used  to test JPA enntity management
+ */
+ at Entity
+ at Table(name="taxi")
+public class TaxiState implements Serializable
+{
+    @Id
+    @GeneratedValue
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getBookings() {
+        return bookings;
+    }
+
+    public void setBookings(int bookings) {
+        this.bookings = bookings;
+    }
+
+    public boolean addBookings(int howMany)
+    {
+        int bookings = getBookings();
+        int newBookings = bookings + howMany;
+        setBookings( newBookings );
+        return true;
+    }
+
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder();
+        builder.append("TestEntity {");
+        builder.append("\n    id=");
+        builder.append(id);
+        builder.append("\n    name=");
+        builder.append(name);
+        builder.append("\n    bookings=");
+        builder.append(bookings);
+        builder.append(" }\n");
+        return builder.toString();
+    }
+
+    private int id;
+    private String name;
+    private int bookings;
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiView.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiView.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/taxi/TaxiView.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TaxiView.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: TaxiView.java,v 1.2 2004/04/21 13:09:20 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.taxi;
+
+import com.sun.imageio.plugins.common.I18N;
+
+import java.awt.*;
+import java.io.Serializable;
+
+/**
+ * The visual interface (GUI) for the Taxi Service.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.2 $
+ */
+public class TaxiView extends javax.swing.JFrame implements Serializable
+{
+    // Note: Some parts of this file were auto-generated
+    // by NetBeans 3.3 FormEditor (http://www.netbeans.org)
+
+    /**
+     * Create a new TaxiView instance.
+     *
+     * @param tManager The {@link org.jboss.jbossts.txframework.demo.entities.taxi.TaxiManager} instance to bind to
+     */
+    public TaxiView()
+    {
+        initComponents();
+    }
+
+    /**
+     * Initialize the form.
+     * This is called by the constructor
+     *
+     * WARNING: Automatically generated code, may be overwritten
+     */
+    private void initComponents()
+    {//GEN-BEGIN:initComponents
+        jPanel2 = new javax.swing.JPanel();
+        jLabel1 = new javax.swing.JLabel();
+        jLabelNBookings = new javax.swing.JLabel();
+        jLabel10 = new javax.swing.JLabel();
+        jButtonResetFields = new javax.swing.JButton();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jTextArea = new javax.swing.JTextArea();
+
+        setTitle("Taxi Service");
+        addWindowListener(new java.awt.event.WindowAdapter()
+        {
+            public void windowClosing(java.awt.event.WindowEvent evt)
+            {
+                exitForm(evt);
+            }
+        });
+
+        jPanel2.setBorder(new javax.swing.border.LineBorder(java.awt.Color.black));
+        jLabel10.setText("Taxi                                     ");
+        jLabel10.setForeground(java.awt.Color.red);
+        jLabel10.setFont(new java.awt.Font("Dialog", 1, 24));
+        jPanel2.add(jLabel10);
+
+        jLabel1.setText("Bookings:");
+        jLabel1.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel1);
+
+        jLabelNBookings.setText("  ");
+        jLabelNBookings.setForeground(java.awt.Color.gray);
+        jLabelNBookings.setFont(new java.awt.Font("Dialog", 1, 18));
+        jPanel2.add(jLabelNBookings);
+
+        jButtonResetFields.setText("Reset Fields");
+        jButtonResetFields.addActionListener(new java.awt.event.ActionListener() {
+            public void actionPerformed(java.awt.event.ActionEvent evt) {
+                jButtonResetFieldsActionPerformed(evt);
+            }
+        });
+
+        jPanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);
+
+        jScrollPane1.setAutoscrolls(true);
+        jTextArea.setEditable(false);
+        jTextArea.setRows(10);
+        jTextArea.setMargin(new java.awt.Insets(5, 5, 5, 5));
+        jScrollPane1.setViewportView(jTextArea);
+
+        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
+
+        getContentPane().setPreferredSize(new Dimension(450, 150));
+
+        pack();
+    }//GEN-END:initComponents
+
+    /**
+     * ResetFields event handler.
+     */
+    private void jButtonResetFieldsActionPerformed(java.awt.event.ActionEvent evt)
+    {//GEN-FIRST:event_jButtonResetFieldsActionPerformed
+        TaxiManagerLocal taxiManager = TaxiManager.getManager();
+        taxiManager.reset();
+    }//GEN-LAST:event_jButtonResetFieldsActionPerformed
+
+    /**
+     * Exit the application.
+     */
+    private void exitForm(java.awt.event.WindowEvent evt)
+    {//GEN-FIRST:event_exitForm
+        //System.exit(0); // disabled for embedding in application servers.
+    }//GEN-LAST:event_exitForm
+
+    /**
+     * Add status (highlighted) text to the central jTextArea.
+     *
+     * @param text The String to add
+     */
+    public void addMessage(java.lang.String text)
+    {
+        jTextArea.append(text + "\n");
+        jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
+    }
+
+    /**
+     * Add status (highlighted) text to the central jTextArea.
+     *
+     * @param text The String to add
+     */
+    public void addPrepareMessage(java.lang.String text)
+    {
+        jTextArea.append(text + "\n");
+        jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
+    }
+
+    /**
+     * Synchronise the GUI with the underlying state.
+     */
+    public void updateFields(TaxiState taxiState)
+    {
+        int bookings = taxiState.getBookings();
+        jLabelNBookings.setText(Integer.toString(bookings));
+    }
+
+    /**
+     * Allow use of a singleton model for web services demo.
+     */
+    public static TaxiView getSingletonInstance()
+    {
+        if (singletonInstance == null)
+        {
+            singletonInstance = new TaxiView();
+        }
+        singletonInstance.show();
+        return singletonInstance;
+    }
+
+    /**
+     * A singleton instance of this class.
+     */
+    private static TaxiView singletonInstance;
+
+    // Variables declaration - automatically generated - do not modify
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JLabel jLabel10;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabelNBookings;
+    private javax.swing.JButton jButtonResetFields;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JTextArea jTextArea;
+
+    // End of automatically generated variables declarations
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreConstants.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreConstants.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreConstants.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,32 @@
+package org.jboss.jbossts.txframework.demo.entities.theatre;
+
+/**
+ * Constant values used by the theatre service
+ */
+public class TheatreConstants
+{
+    /**
+     * Constant (array index) used for the seating area CIRCLE.
+     */
+    public static final int CIRCLE = 0;
+
+    /**
+     * Constant (array index) used for the seating area STALLS.
+     */
+    public static final int STALLS = 1;
+
+    /**
+     * Constant (array index) used for the seating area BALCONY.
+     */
+    public static final int BALCONY = 2;
+
+    /**
+     * The total number (array size) of seating areas.
+     */
+    public static final int NUM_SEAT_AREAS = 3;
+
+    /**
+     * The default initial capacity of each seating area.
+     */
+    public static final int DEFAULT_SEATING_CAPACITY = 100;
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManager.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManager.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,188 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TheatreManager.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: TheatreManager.java,v 1.4 2004/04/21 13:09:20 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.theatre;
+
+import javax.ejb.Local;
+import javax.ejb.Stateless;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+import static org.jboss.jbossts.txframework.demo.entities.theatre.TheatreConstants.*;
+
+/**
+ * The application logic for the Theatre Service.
+ * <p/>
+ * Stores and manages seating reservations. The theatre manager provides a book method
+ * allowing the web service endpoint to book or unbook seats.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @author Andrew Dinn (adinn at redhat.com)
+ */
+ at Stateless
+ at Local(TheatreManagerLocal.class)
+public class TheatreManager implements TheatreManagerLocal
+{
+    private final static String THEATRE_MANAGER = "TheatreManager/local";
+
+    public static TheatreManagerLocal getManager()
+    {
+        try {
+            Context initialContext = new InitialContext();
+            if ( initialContext == null){
+                System.out.println("JNDI problem. Cannot get InitialContext.");
+            }
+            TheatreManagerLocal manager = (TheatreManagerLocal)initialContext.lookup(THEATRE_MANAGER);
+
+            return manager;
+        }
+        catch ( NamingException ex ) {
+            System.out.println("Theatre Manager lookup failed: " + ex);
+        }
+        return null;
+    }
+
+    /*****************************************************************************/
+    /* Support for the Web Services                                              */
+    /*****************************************************************************/
+
+    /**
+     * Book a number of seats in a specific area of the theatre.
+     *
+     * @param nSeats The number of seats requested
+     * @param area   The type of seating requested
+     */
+    public synchronized boolean bookSeats(int nSeats, int area)
+    {
+        TheatreState theatreState = em.find(TheatreState.class, ENTITY_ID);
+        if (theatreState == null) {
+            theatreState = new TheatreState();
+            theatreState.setName("theatre royal");
+            theatreState.setBookings(new int[]{0, 0, 0});
+            theatreState.setMaxBookings(new int[]{100, 100, 60});
+            em.persist(theatreState);
+        }
+
+        String areaName = areaName(area);
+        TheatreView theatreView = TheatreView.getSingletonInstance();
+
+        theatreView.addMessage("TheatreManager booking " + nSeats + " seats in " + areaName + ", current bookings = " + theatreState.getBookings()[area]);
+
+        boolean result =  theatreState.addBookings(nSeats, area);
+
+        if (result) {
+            theatreView.addMessage("TheatreManager successfully booked " + nSeats + "seats in " + areaName+ ", current bookings = " + theatreState.getBookings()[area]);
+            theatreView.updateFields(theatreState);
+        } else {
+            theatreView.addMessage("TheatreManager failed to book " + nSeats + " seats in " + areaName);
+        }
+
+        return result;
+    }
+
+    /**
+     * Reset to the initial state.
+     */
+    public synchronized void reset()
+    {
+        TheatreState theatreState = em.find(TheatreState.class, ENTITY_ID);
+        if (theatreState == null) {
+            theatreState = new TheatreState();
+            theatreState.setName("theatre royal");
+            theatreState.setBookings(new int[] { 0, 0, 0});
+            theatreState.setMaxBookings(new int[] { 100, 100, 60});
+            em.persist(theatreState);
+        }
+
+        int[] bookings = theatreState.getBookings();
+        TheatreView theatreView = TheatreView.getSingletonInstance();
+
+        theatreView.addMessage("TheatreManager resetting current bookings { stalls = " + bookings[STALLS] + ", circle = " + bookings[CIRCLE] + ", BALCONY = " + bookings[BALCONY] + "}");
+
+
+        boolean result = theatreState.addBookings(-bookings[STALLS], STALLS);
+
+        if (result) {
+            theatreView.addMessage("TheatreManager successfully reset " + bookings + " bookings in stalls");
+        } else {
+            theatreView.addMessage("TheatreManager failed to reset " + bookings + " bookings in stalls");
+            return;
+        }
+
+        result = theatreState.addBookings(-bookings[CIRCLE], CIRCLE);
+
+        if (result) {
+            theatreView.addMessage("TheatreManager successfully reset " + bookings + " bookings in circle");
+        } else {
+            theatreView.addMessage("TheatreManager failed to reset " + bookings + " bookings in circle");
+            return;
+        }
+
+        result = theatreState.addBookings(-bookings[BALCONY], BALCONY);
+
+        if (result) {
+            theatreView.addMessage("TheatreManager successfully reset " + bookings + " bookings in balcony");
+            theatreView.updateFields(theatreState);
+        } else {
+            theatreView.addMessage("TheatreManager failed to reset " + bookings + " bookings in balcony");
+        }
+    }
+
+    /*****************************************************************************/
+    /* Private implementation                                                    */
+    /*****************************************************************************/
+
+    /**
+     * injected entity manager used for looking up entity beans
+     */
+    @PersistenceContext()
+    EntityManager em;
+
+    /**
+     * the id for the singleton entity used to hold the theatre state
+     */
+    private final static int ENTITY_ID = 1;
+
+
+    private String areaName(int area)
+    {
+        if (area == STALLS) {
+            return "stalls";
+        } else if (area == CIRCLE) {
+            return "circle";
+        } else if (area == BALCONY) {
+            return "balcony"; }
+        else {
+            return "???";
+        }
+    }
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManagerLocal.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManagerLocal.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreManagerLocal.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,10 @@
+package org.jboss.jbossts.txframework.demo.entities.theatre;
+
+/**
+ * Interface for stateless bean used to manage the restaurant state
+ */
+public interface TheatreManagerLocal
+{
+    public boolean bookSeats(int nSeats, int area);
+    public void reset();
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreState.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreState.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreState.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,100 @@
+package org.jboss.jbossts.txframework.demo.entities.theatre;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import java.io.Serializable;
+
+import static org.jboss.jbossts.txframework.demo.entities.theatre.TheatreConstants.*;
+
+/**
+ * Entity class modelling bookings for a theatre
+ */
+
+/**
+ * class used  to test JPA enntity management
+ */
+ at Entity
+ at Table(name="theatre")
+public class TheatreState implements Serializable
+{
+    @Id
+    @GeneratedValue
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int[] getBookings() {
+        return bookings;
+    }
+
+    public void setBookings(int[] bookings) {
+        this.bookings = bookings;
+    }
+
+    public int[] getMaxBookings() {
+        return maxBookings;
+    }
+
+    public void setMaxBookings(int[] maxBookings) {
+        this.maxBookings = maxBookings;
+    }
+
+    public boolean addBookings(int howMany,  int area)
+    {
+        int[] bookings = getBookings();
+        int[] maxBookings =  getMaxBookings();
+        int newBookings = bookings[area] + howMany;
+        if (newBookings >= 0 && newBookings <= maxBookings[area]) {
+            bookings[area] = newBookings;
+            return true;
+        }
+
+        return false;
+    }
+
+    public String toString()
+    {
+        StringBuilder builder = new StringBuilder();
+        builder.append("TestEntity {");
+        builder.append("\n    id=");
+        builder.append(id);
+        builder.append("\n    name=");
+        builder.append(name);
+        builder.append("\n    bookings={CIRCLE=");
+        builder.append(bookings[CIRCLE]);
+        builder.append(", STALLS=");
+        builder.append(bookings[STALLS]);
+        builder.append(", BALCONY=");
+        builder.append(bookings[BALCONY]);
+        builder.append("}");
+        builder.append("\n    maxBookings={");
+        builder.append(maxBookings[CIRCLE]);
+        builder.append(", STALLS=");
+        builder.append(maxBookings[STALLS]);
+        builder.append(", BALCONY=");
+        builder.append(maxBookings[BALCONY]);
+        builder.append("}");
+        builder.append(" }\n");
+        return builder.toString();
+    }
+
+    private int id;
+    private String name;
+    private int[] bookings;
+    private int[] maxBookings;
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreView.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreView.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/entities/theatre/TheatreView.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,330 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TheatreView.java
+ *
+ * Copyright (c) 2003 Arjuna Technologies Ltd.
+ *
+ * $Id: TheatreView.java,v 1.3 2004/04/21 13:09:21 jhalliday Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.entities.theatre;
+
+import java.awt.*;
+import java.io.Serializable;
+import static org.jboss.jbossts.txframework.demo.entities.theatre.TheatreConstants.*;
+
+/**
+ * The visual interface (GUI) for the Theatre Service.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.3 $
+ */
+public class TheatreView extends javax.swing.JFrame implements Serializable
+{
+
+    // Note: Some parts of this file were auto-generated
+    // by NetBeans 3.3 FormEditor (http://www.netbeans.org)
+
+    /**
+     * Create a new TheatreView instance.
+     *
+     * @param tManager The {@link TheatreManager} instance to bind to
+     */
+    public TheatreView()
+    {
+        initComponents();
+    }
+
+
+    /**
+     * Initialize the form.
+     * This is called by the constructor
+     * <p/>
+     * WARNING: Automatically generated code, may be overwritten
+     */
+    private void initComponents()
+    {//GEN-BEGIN:initComponents
+        jPanel1 = new javax.swing.JPanel();
+        jLabel1 = new javax.swing.JLabel();
+        jLabel3 = new javax.swing.JLabel();
+        jLabel30 = new javax.swing.JLabel();
+        jLabel25 = new javax.swing.JLabel();
+        jLabelNBookedSeatsCircle = new javax.swing.JLabel();
+        jLabelNFreeSeatsCircle = new javax.swing.JLabel();
+        jLabel35 = new javax.swing.JLabel();
+        jLabelNBookedSeatsStalls = new javax.swing.JLabel();
+        jLabelNFreeSeatsStalls = new javax.swing.JLabel();
+        jLabel28 = new javax.swing.JLabel();
+        jLabelNBookedSeatsBalcony = new javax.swing.JLabel();
+        jLabelNFreeSeatsBalcony = new javax.swing.JLabel();
+        jLabel34 = new javax.swing.JLabel();
+        jButtonResetFields = new javax.swing.JButton();
+        jPanel2 = new javax.swing.JPanel();
+        jLabel10 = new javax.swing.JLabel();
+        jLabel13 = new javax.swing.JLabel();
+        jLabel18 = new javax.swing.JLabel();
+        jLabelNTotalSeatsCircle = new javax.swing.JLabel();
+        jLabel19 = new javax.swing.JLabel();
+        jLabelNTotalSeatsStalls = new javax.swing.JLabel();
+        jLabel20 = new javax.swing.JLabel();
+        jLabelNTotalSeatsBalcony = new javax.swing.JLabel();
+        jScrollPane1 = new javax.swing.JScrollPane();
+        jTextArea = new javax.swing.JTextArea();
+
+        setTitle("Theatre Service");
+        addWindowListener(new java.awt.event.WindowAdapter()
+        {
+            public void windowClosing(java.awt.event.WindowEvent evt)
+            {
+                exitForm(evt);
+            }
+        });
+
+        jPanel1.setBorder(new javax.swing.border.LineBorder(java.awt.Color.black));
+        jLabel1.setText("SEATS");
+        jLabel1.setForeground(java.awt.Color.darkGray);
+        jLabel1.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel1);
+
+        jLabel3.setText("(booked, ");
+        jLabel3.setForeground(java.awt.Color.gray);
+        jPanel1.add(jLabel3);
+
+        jLabel30.setText("free)       ");
+        jLabel30.setForeground(new java.awt.Color(0, 153, 0));
+        jPanel1.add(jLabel30);
+
+        jLabel25.setText("Circle (");
+        jLabel25.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel25);
+
+        jLabelNBookedSeatsCircle.setText("  ");
+        jLabelNBookedSeatsCircle.setForeground(java.awt.Color.gray);
+        jLabelNBookedSeatsCircle.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNBookedSeatsCircle);
+
+        jLabelNFreeSeatsCircle.setText("  ");
+        jLabelNFreeSeatsCircle.setForeground(new java.awt.Color(0, 153, 0));
+        jLabelNFreeSeatsCircle.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNFreeSeatsCircle);
+
+        jLabel35.setText("),  Stalls (");
+        jLabel35.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel35);
+
+        jLabelNBookedSeatsStalls.setText("  ");
+        jLabelNBookedSeatsStalls.setForeground(java.awt.Color.gray);
+        jLabelNBookedSeatsStalls.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNBookedSeatsStalls);
+
+        jLabelNFreeSeatsStalls.setText("  ");
+        jLabelNFreeSeatsStalls.setForeground(new java.awt.Color(0, 153, 0));
+        jLabelNFreeSeatsStalls.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNFreeSeatsStalls);
+
+        jLabel28.setText("),  Balcony (");
+        jLabel28.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel28);
+
+        jLabelNBookedSeatsBalcony.setText("  ");
+        jLabelNBookedSeatsBalcony.setForeground(java.awt.Color.gray);
+        jLabelNBookedSeatsBalcony.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNBookedSeatsBalcony);
+
+        jLabelNFreeSeatsBalcony.setText("  ");
+        jLabelNFreeSeatsBalcony.setForeground(new java.awt.Color(0, 153, 0));
+        jLabelNFreeSeatsBalcony.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel1.add(jLabelNFreeSeatsBalcony);
+
+        jLabel34.setText(")     ");
+        jLabel34.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel1.add(jLabel34);
+
+        jButtonResetFields.setText("Reset Fields");
+        jButtonResetFields.addActionListener(new java.awt.event.ActionListener()
+        {
+            public void actionPerformed(java.awt.event.ActionEvent evt)
+            {
+                jButtonResetFieldsActionPerformed(evt);
+            }
+        });
+
+        jPanel1.add(jButtonResetFields);
+
+        getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);
+
+        jPanel2.setBorder(new javax.swing.border.LineBorder(java.awt.Color.black));
+        jLabel10.setText("Theatre                          ");
+        jLabel10.setForeground(java.awt.Color.red);
+        jLabel10.setFont(new java.awt.Font("Dialog", 1, 24));
+        jPanel2.add(jLabel10);
+
+        jLabel13.setText("TOTAL SEATS   ");
+        jLabel13.setForeground(java.awt.Color.darkGray);
+        jLabel13.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel13);
+
+        jLabel18.setText("Circle:");
+        jLabel18.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel18);
+
+        jLabelNTotalSeatsCircle.setText("  ");
+        jLabelNTotalSeatsCircle.setForeground(java.awt.Color.darkGray);
+        jLabelNTotalSeatsCircle.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel2.add(jLabelNTotalSeatsCircle);
+
+        jLabel19.setText("Stalls:");
+        jLabel19.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel19);
+
+        jLabelNTotalSeatsStalls.setText("  ");
+        jLabelNTotalSeatsStalls.setForeground(java.awt.Color.darkGray);
+        jLabelNTotalSeatsStalls.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel2.add(jLabelNTotalSeatsStalls);
+
+        jLabel20.setText("Balcony:");
+        jLabel20.setFont(new java.awt.Font("Dialog", 1, 14));
+        jPanel2.add(jLabel20);
+
+        jLabelNTotalSeatsBalcony.setText("  ");
+        jLabelNTotalSeatsBalcony.setForeground(java.awt.Color.darkGray);
+        jLabelNTotalSeatsBalcony.setFont(new java.awt.Font("Dialog", 0, 14));
+        jPanel2.add(jLabelNTotalSeatsBalcony);
+
+        jPanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        getContentPane().add(jPanel2, java.awt.BorderLayout.NORTH);
+
+        jScrollPane1.setAutoscrolls(true);
+        jTextArea.setEditable(false);
+        jTextArea.setRows(10);
+        jTextArea.setMargin(new java.awt.Insets(5, 5, 5, 5));
+        jScrollPane1.setViewportView(jTextArea);
+
+        getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
+
+        jPanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
+
+        getContentPane().setPreferredSize(new Dimension(700, 200));
+
+        pack();
+    }//GEN-END:initComponents
+
+    /**
+     * Reset event handler.
+     */
+    private void jButtonResetFieldsActionPerformed(java.awt.event.ActionEvent evt)
+    {//GEN-FIRST:event_jButtonResetFieldsActionPerformed
+        TheatreManagerLocal theatreManager = TheatreManager.getManager();
+        theatreManager.reset();
+    }//GEN-LAST:event_jButtonResetFieldsActionPerformed
+
+    /**
+     * Exit the application.
+     */
+    private void exitForm(java.awt.event.WindowEvent evt)
+    {//GEN-FIRST:event_exitForm
+        //System.exit(0); // disabled for embedding in application servers.
+    }//GEN-LAST:event_exitForm
+
+    /**
+     * Add regular text to the central jTextArea.
+     *
+     * @param text The String to add
+     */
+    public void addMessage(java.lang.String text)
+    {
+        jTextArea.append(text + "\n");
+        jScrollPane1.getVerticalScrollBar().setValue(jScrollPane1.getVerticalScrollBar().getMaximum());
+    }
+
+    /**
+     * Synchronise the GUI with the underlying state.
+     */
+    public void updateFields(TheatreState theatreState)
+    {
+        int[] bookings = theatreState.getBookings();
+        int[] maxBookings = theatreState.getMaxBookings();
+        jLabelNBookedSeatsCircle.setText((Integer.toString(bookings[CIRCLE])));
+        jLabelNBookedSeatsStalls.setText((Integer.toString(bookings[STALLS])));
+        jLabelNBookedSeatsBalcony.setText((Integer.toString(bookings[BALCONY])));
+
+        jLabelNTotalSeatsCircle.setText((Integer.toString(maxBookings[CIRCLE])));
+        jLabelNTotalSeatsStalls.setText((Integer.toString(maxBookings[STALLS])));
+        jLabelNTotalSeatsBalcony.setText((Integer.toString(maxBookings[BALCONY])));
+
+        jLabelNFreeSeatsCircle.setText((Integer.toString(maxBookings[CIRCLE] - bookings[CIRCLE])));
+        jLabelNFreeSeatsStalls.setText((Integer.toString(maxBookings[STALLS] - bookings[STALLS])));
+        jLabelNFreeSeatsBalcony.setText((Integer.toString(maxBookings[BALCONY] - bookings[BALCONY])));
+    }
+
+    /**
+     * Allow use of a singleton model for web services demo.
+     */
+    public static TheatreView getSingletonInstance()
+    {
+        if (singletonInstance == null)
+        {
+            singletonInstance = new TheatreView();
+        }
+
+        singletonInstance.show();
+        return singletonInstance;
+    }
+
+    /**
+     * A singleton instance of this class.
+     */
+    private static TheatreView singletonInstance;
+
+    // Variables declaration - automatically generated - do not modify
+
+    private javax.swing.JPanel jPanel1;
+    private javax.swing.JLabel jLabel1;
+    private javax.swing.JLabel jLabel3;
+    private javax.swing.JLabel jLabel30;
+    private javax.swing.JLabel jLabel25;
+    private javax.swing.JLabel jLabelNBookedSeatsCircle;
+    private javax.swing.JLabel jLabelNFreeSeatsCircle;
+    private javax.swing.JLabel jLabel35;
+    private javax.swing.JLabel jLabelNBookedSeatsStalls;
+    private javax.swing.JLabel jLabelNFreeSeatsStalls;
+    private javax.swing.JLabel jLabel28;
+    private javax.swing.JLabel jLabelNBookedSeatsBalcony;
+    private javax.swing.JLabel jLabelNFreeSeatsBalcony;
+    private javax.swing.JLabel jLabel34;
+    private javax.swing.JButton jButtonResetFields;
+    private javax.swing.JPanel jPanel2;
+    private javax.swing.JLabel jLabel10;
+    private javax.swing.JLabel jLabel13;
+    private javax.swing.JLabel jLabel18;
+    private javax.swing.JLabel jLabelNTotalSeatsCircle;
+    private javax.swing.JLabel jLabel19;
+    private javax.swing.JLabel jLabelNTotalSeatsStalls;
+    private javax.swing.JLabel jLabel20;
+    private javax.swing.JLabel jLabelNTotalSeatsBalcony;
+    private javax.swing.JScrollPane jScrollPane1;
+    private javax.swing.JTextArea jTextArea;
+
+    // End of automatically generated variables declarations
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/IRestaurantService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,26 @@
+package org.jboss.jbossts.txframework.demo.restaurant;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:21 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+ 
+ at WebService(targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Restaurant", name = "IRestaurantService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface IRestaurantService {
+
+    @WebResult(name = "bookSeatsResponse", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Restaurant", partName = "bookSeatsResponse")
+    @WebMethod
+    public boolean bookSeats(
+        @WebParam(partName = "how_many", name = "how_many")
+        int howMany
+    );
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/RestaurantServiceService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/RestaurantServiceService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/restaurant/RestaurantServiceService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,77 @@
+
+/*
+ * 
+ */
+
+package org.jboss.jbossts.txframework.demo.restaurant;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:21 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+
+
+ at WebServiceClient(name = "RestaurantServiceService", 
+                  wsdlLocation = "/WEB-INF/wsdl/RestaurantService.wsdl",
+                  targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Restaurant") 
+public class RestaurantServiceService extends Service {
+
+    public final static URL WSDL_LOCATION;
+    public final static QName SERVICE = new QName("http://www.jboss.org/jbossts/txframework/demo/Restaurant", "RestaurantServiceService");
+    public final static QName RestaurantService = new QName("http://www.jboss.org/jbossts/txframework/demo/Restaurant", "RestaurantService");
+    static {
+        URL url = null;
+        try {
+            url = new URL("/WEB-INF/wsdl/RestaurantService.wsdl");
+        } catch (MalformedURLException e) {
+            System.err.println("Can not initialize the default wsdl from /WEB-INF/wsdl/RestaurantService.wsdl");
+            // e.printStackTrace();
+        }
+        WSDL_LOCATION = url;
+    }
+
+    public RestaurantServiceService(URL wsdlLocation) {
+        super(wsdlLocation, SERVICE);
+    }
+
+    public RestaurantServiceService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public RestaurantServiceService() {
+        super(WSDL_LOCATION, SERVICE);
+    }
+
+    /**
+     * 
+     * @return
+     *     returns IRestaurantService
+     */
+    @WebEndpoint(name = "RestaurantService")
+    public IRestaurantService getRestaurantService() {
+        return super.getPort(RestaurantService, IRestaurantService.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
+     * @return
+     *     returns IRestaurantService
+     */
+    @WebEndpoint(name = "RestaurantService")
+    public IRestaurantService getRestaurantService(WebServiceFeature... features) {
+        return super.getPort(RestaurantService, IRestaurantService.class, features);
+    }
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/restaurant/RestaurantService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/restaurant/RestaurantService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/restaurant/RestaurantService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,179 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * RestaurantService.java
+ *
+ * Copyright (c) 2003, 2004 Arjuna Technologies Ltd
+ *
+ * $Id: RestaurantService.java,v 1.3 2004/12/01 16:26:44 kconner Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.services.restaurant;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+import org.jboss.jbossts.txframework.api.configuration.trigger.ATLifecycleEvent;
+import org.jboss.jbossts.txframework.api.configuration.trigger.BALifecycleEvent;
+import org.jboss.jbossts.txframework.demo.entities.restaurant.RestaurantManager;
+import org.jboss.jbossts.txframework.demo.entities.restaurant.RestaurantManagerLocal;
+import org.jboss.jbossts.txframework.demo.entities.restaurant.RestaurantView;
+import org.jboss.jbossts.txframework.demo.restaurant.IRestaurantService;
+import org.jboss.jbossts.txframework.api.annotation.lifecycle.LifecycleHandler;
+import org.jboss.jbossts.txframework.api.annotation.service.Parameter;
+import org.jboss.jbossts.txframework.api.annotation.service.ParticipantService;
+import org.jboss.jbossts.txframework.api.annotation.service.ServiceRequest;
+import org.jboss.jbossts.txframework.api.configuration.transaction.CompletionType;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSAT;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSBA;
+import org.jboss.jbossts.txframework.api.annotation.trigger.*;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.WebMethod;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * An adapter class that exposes the RestaurantManager business API as a
+ * transactional Web Service. Also logs events to a RestaurantView object.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.3 $
+ */
+ at WebService(serviceName="RestaurantServiceService", portName="RestaurantService",
+        name = "IRestaurantService", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Restaurant",
+        wsdlLocation = "/WEB-INF/wsdl/RestaurantService.wsdl")
+ at HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")                  
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
+ at ParticipantService(serviceGroup = "NightOnTheTown")
+ at WSBA(bridgeType = BridgeType.JTA, completionType = CompletionType.PARTICIPANT)
+ at WSAT(bridgeType = BridgeType.JTA)
+public class RestaurantService implements IRestaurantService
+{
+    /**
+     * Book a number of seats in the restaurant using an EJB to do the actual work. The web service transaction
+     * should be bridged automatically to a JTA transaction and lifecycle handlers run where requested
+     *
+     * @param how_many The number of seats to book
+     */
+    @WebMethod
+    @ServiceRequest
+    @TriggerSet(
+            wsba = {
+                    // this is just for reporting
+                    @WSBATrigger(lifecycleEvent = BALifecycleEvent.COMPLETE, methodName = "complete"),
+                    // so is this
+                    @WSBATrigger(lifecycleEvent = BALifecycleEvent.CLOSE, methodName = "close"),
+                    // this one has real  work to do
+                    @WSBATrigger(lifecycleEvent = BALifecycleEvent.COMPENSATE, methodName = "compensate")
+            },
+            wsat = {
+                    // this is just for reporting
+                    @WSATTrigger(lifecycleEvent = ATLifecycleEvent.PREPARE, methodName = "prepare"),
+                    // this is just for reporting
+                    @WSATTrigger(lifecycleEvent = ATLifecycleEvent.COMMIT, methodName = "commit"),
+                    // this is just for reporting
+                    @WSATTrigger(lifecycleEvent = ATLifecycleEvent.ABORT, methodName = "abort")
+            }
+    )
+    public boolean bookSeats(
+            @WebParam(name = "how_many", partName = "how_many")
+            @Parameter int how_many)
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        RestaurantManagerLocal restaurantManagerLocal = RestaurantManager.getManager();
+
+        restaurantView.addMessage("******************************");
+        restaurantView.addMessage("Received a booking request for one table of " + how_many + " people");
+
+        // invoke the backend business logic:
+        boolean result = restaurantManagerLocal.bookSeats(how_many);
+
+        restaurantView.addMessage("Request complete\n");
+
+        return result;
+    }
+
+    @LifecycleHandler
+    public void prepare(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking prepare request for " + how_many + " seats");
+    }
+    @LifecycleHandler
+    public void commit(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking commit request for " + how_many + " seats");
+    }
+    @LifecycleHandler
+    public void abort(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking abort request for " + how_many + " seats");
+    }
+    @LifecycleHandler
+    public void complete(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking complete request for " + how_many + " seats");
+    }
+
+    @LifecycleHandler
+    public void close(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking close request for " + how_many + " seats");
+    }
+
+    @LifecycleHandler
+    public void compensate(int how_many) throws Exception
+    {
+        RestaurantView restaurantView = RestaurantView.getSingletonInstance();
+        RestaurantManagerLocal restaurantManagerLocal = RestaurantManager.getManager();
+
+        // create a transaction for the update
+
+        restaurantView.addMessage("******************************");
+
+        restaurantView.addMessage("Received a restaurant booking compensation request for " + how_many + " seats");
+
+        // invoke the backend business logic:
+        boolean result =  restaurantManagerLocal.bookSeats(-how_many);
+
+        if (result == false) {
+            restaurantView.addMessage("Compensation request failed\n");
+            throw new Exception("Failed to compensate booking request for " + how_many + " seats");
+        }
+
+        restaurantView.addMessage("Compensation request complete\n");
+    }
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/taxi/TaxiService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/taxi/TaxiService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/taxi/TaxiService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TaxiService.java
+ *
+ * Copyright (c) 2003, 2004 Arjuna Technologies Ltd.
+ *
+ * $Id: TaxiService.java,v 1.3 2004/12/01 16:27:01 kconner Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.services.taxi;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+import org.jboss.jbossts.txframework.api.configuration.transaction.CompletionType;
+import org.jboss.jbossts.txframework.api.configuration.trigger.BALifecycleEvent;
+import org.jboss.jbossts.txframework.demo.entities.taxi.TaxiManager;
+import org.jboss.jbossts.txframework.demo.entities.taxi.TaxiManagerLocal;
+import org.jboss.jbossts.txframework.demo.entities.taxi.TaxiView;
+import org.jboss.jbossts.txframework.demo.taxi.ITaxiService;
+import org.jboss.jbossts.txframework.api.annotation.lifecycle.LifecycleHandler;
+import org.jboss.jbossts.txframework.api.annotation.service.ParticipantService;
+import org.jboss.jbossts.txframework.api.annotation.service.ServiceRequest;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSAT;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSBA;
+import org.jboss.jbossts.txframework.api.annotation.trigger.BATrigger;
+import org.jboss.jbossts.txframework.api.annotation.trigger.TriggerSet;
+
+import javax.jws.WebService;
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * An adapter class that exposes the TaxiManager business API as a
+ * transactional Web Service. Also logs events to a TaxiView object.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.3 $
+ */
+ at WebService(serviceName="TaxiServiceService", portName="TaxiService",
+        name = "ITaxiService", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Taxi",
+        wsdlLocation = "/WEB-INF/wsdl/TaxiService.wsdl")
+ at HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
+ at ParticipantService(serviceGroup = "NightOnTheTown")
+ at WSBA(bridgeType = BridgeType.JTA, completionType = CompletionType.PARTICIPANT)
+ at WSAT(bridgeType = BridgeType.JTA)
+public class TaxiService implements ITaxiService
+{
+    /**
+     * Book a taxi
+     * Enrols a Participant if necessary, then passes
+     * the call through to the business logic.
+     */
+    @WebMethod
+    @ServiceRequest
+    // this is just for reporting
+    @TriggerSet(ba = {
+            @BATrigger(lifecycleEvent = BALifecycleEvent.COMPLETE, methodName = "complete"),
+            // so is this
+            @BATrigger(lifecycleEvent = BALifecycleEvent.CLOSE, methodName = "close"),
+            // this one has real  work to do
+            @BATrigger(lifecycleEvent = BALifecycleEvent.COMPENSATE, methodName = "compensate")
+    })
+    public boolean bookTaxi()
+    {
+        TaxiView taxiView = TaxiView.getSingletonInstance();
+        TaxiManagerLocal taxiManagerLocal= TaxiManager.getManager();
+
+        taxiView.addMessage("******************************");
+
+        taxiView.addMessage("Received a taxi booking request");
+
+        // invoke the backend business logic:
+        boolean result = taxiManagerLocal.bookTaxi(1);
+
+        taxiView.addMessage("Request complete\n");
+
+        return result;
+    }
+
+    @LifecycleHandler
+    public boolean compensate(int how_many) throws Exception
+    {
+        TaxiView taxiView = TaxiView.getSingletonInstance();
+        TaxiManagerLocal taxiManagerLocal = TaxiManager.getManager();
+
+        // create a transaction for the update
+
+        taxiView.addMessage("******************************");
+
+        taxiView.addMessage("Received a taxi booking compensation request for " + how_many + " seats");
+
+        // invoke the backend business logic:
+        boolean result =  taxiManagerLocal.bookTaxi(-1);
+
+        if (result == false) {
+            taxiView.addMessage("Compensation request failed\n");
+            throw new Exception("Failed to compensate booking request for " + how_many + " seats");
+        }
+
+        taxiView.addMessage("Compensation request complete\n");
+
+        return result;
+    }
+}
+
+
+
+

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/theatre/TheatreService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/theatre/TheatreService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/services/theatre/TheatreService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,135 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * TheatreService.java
+ *
+ * Copyright (c) 2003, 2004 Arjuna Technologies Ltd.
+ *
+ * $Id: TheatreService.java,v 1.3 2004/12/01 16:27:21 kconner Exp $
+ *
+ */
+
+package org.jboss.jbossts.txframework.demo.services.theatre;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+import org.jboss.jbossts.txframework.api.configuration.transaction.CompletionType;
+import org.jboss.jbossts.txframework.api.configuration.trigger.BALifecycleEvent;
+import org.jboss.jbossts.txframework.api.configuration.trigger.DataMatch;
+import org.jboss.jbossts.txframework.demo.entities.theatre.TheatreManager;
+import org.jboss.jbossts.txframework.demo.entities.theatre.TheatreManagerLocal;
+import org.jboss.jbossts.txframework.demo.entities.theatre.TheatreView;
+import org.jboss.jbossts.txframework.demo.theatre.ITheatreService;
+import org.jboss.jbossts.txframework.api.annotation.lifecycle.LifecycleHandler;
+import org.jboss.jbossts.txframework.api.annotation.service.Parameter;
+import org.jboss.jbossts.txframework.api.annotation.service.ParticipantService;
+import org.jboss.jbossts.txframework.api.annotation.service.ServiceRequest;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSAT;
+import org.jboss.jbossts.txframework.api.annotation.transaction.WSBA;
+import org.jboss.jbossts.txframework.api.annotation.trigger.BATrigger;
+import org.jboss.jbossts.txframework.api.annotation.trigger.TriggerSet;
+
+import javax.jws.WebService;
+import javax.jws.WebParam;
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * An adapter class that exposes the TheatreManager business API as a
+ * transactional Web Service. Also logs events to a TheatreView object.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at arjuna.com)
+ * @version $Revision: 1.3 $
+ */
+ at WebService(serviceName="TheatreServiceService", portName="TheatreService",
+        name = "ITheatreService", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Theatre",
+        wsdlLocation = "/WEB-INF/wsdl/TheatreService.wsdl")
+ at HandlerChain(file = "../context-handlers.xml", name = "Context Handlers")
+ at SOAPBinding(style=SOAPBinding.Style.RPC)
+ at ParticipantService(serviceGroup = "NightOnTheTown")
+ at WSBA(bridgeType = BridgeType.JTA, completionType = CompletionType.COORDINATOR)
+ at WSAT(bridgeType = BridgeType.JTA)
+public class TheatreService implements ITheatreService
+{
+    /**
+     * Book a number of seats in the Theatre
+     *
+     * @param how_many   The number of seats to book
+     * @param which_area The area of the theatre to book seats in
+     */
+    @WebMethod
+    @ServiceRequest
+    @TriggerSet(ba = {
+            // this is just for reporting
+            @BATrigger(lifecycleEvent = BALifecycleEvent.COMPLETE, methodName = "complete"),
+            // so is this
+            @BATrigger(lifecycleEvent = BALifecycleEvent.CLOSE, methodName = "close"),
+            // this one has real  work to do
+            @BATrigger(lifecycleEvent = BALifecycleEvent.COMPENSATE, methodName = "compensate", type = DataMatch.PARAMETERS_MATCH)
+    })
+    public boolean bookSeats(
+        @WebParam(name = "how_many", partName = "how_many")
+        @Parameter int how_many,
+        @WebParam(name = "which_area", partName = "which_area")
+        @Parameter int which_area)
+    {
+        TheatreView theatreView = TheatreView.getSingletonInstance();
+        TheatreManagerLocal theatreManagerLocal = TheatreManager.getManager();
+
+        // create a transaction for the update
+
+        theatreView.addMessage("******************************");
+
+        theatreView.addMessage("Received a theatre booking request for " + how_many + " seats in area " + which_area);
+
+        // invoke the backend business logic:
+        boolean result =  theatreManagerLocal.bookSeats(how_many, which_area);
+
+        theatreView.addMessage("Request complete\n");
+
+        return result;
+    }
+
+    @LifecycleHandler()
+    public boolean compensate(int how_many, int which_area) throws Exception
+    {
+        TheatreView theatreView = TheatreView.getSingletonInstance();
+        TheatreManagerLocal theatreManagerLocal = TheatreManager.getManager();
+
+        // create a transaction for the update
+
+        theatreView.addMessage("******************************");
+
+        theatreView.addMessage("Received a theatre booking compensation request for " + how_many + " seats in area " + which_area);
+
+        // invoke the backend business logic:
+        boolean result =  theatreManagerLocal.bookSeats(-how_many, which_area);
+
+        if (result == false) {
+            theatreView.addMessage("Compensation request failed\n");
+            throw new Exception("Failed to compensate booking request for " + how_many + " seats in area " + which_area);
+        }
+
+        theatreView.addMessage("Compensation request complete\n");
+
+        return result;
+    }
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/ITaxiService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/ITaxiService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/ITaxiService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,22 @@
+package org.jboss.jbossts.txframework.demo.taxi;
+
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:25 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+ 
+ at WebService(targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Taxi", name = "ITaxiService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface ITaxiService {
+
+    @WebResult(name = "bookTaxiResponse", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Taxi", partName = "bookTaxiResponse")
+    @WebMethod
+    public boolean bookTaxi();
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/TaxiServiceService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/TaxiServiceService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/taxi/TaxiServiceService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,77 @@
+
+/*
+ * 
+ */
+
+package org.jboss.jbossts.txframework.demo.taxi;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:25 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+
+
+ at WebServiceClient(name = "TaxiServiceService", 
+                  wsdlLocation = "/WEB-INF/wsdl/TaxiService.wsdl",
+                  targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Taxi") 
+public class TaxiServiceService extends Service {
+
+    public final static URL WSDL_LOCATION;
+    public final static QName SERVICE = new QName("http://www.jboss.org/jbossts/txframework/demo/Taxi", "TaxiServiceService");
+    public final static QName TaxiService = new QName("http://www.jboss.org/jbossts/txframework/demo/Taxi", "TaxiService");
+    static {
+        URL url = null;
+        try {
+            url = new URL("/WEB-INF/wsdl/TaxiService.wsdl");
+        } catch (MalformedURLException e) {
+            System.err.println("Can not initialize the default wsdl from /WEB-INF/wsdl/TaxiService.wsdl");
+            // e.printStackTrace();
+        }
+        WSDL_LOCATION = url;
+    }
+
+    public TaxiServiceService(URL wsdlLocation) {
+        super(wsdlLocation, SERVICE);
+    }
+
+    public TaxiServiceService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public TaxiServiceService() {
+        super(WSDL_LOCATION, SERVICE);
+    }
+    
+    /**
+     * 
+     * @return
+     *     returns ITaxiService
+     */
+    @WebEndpoint(name = "TaxiService")
+    public ITaxiService getTaxiService() {
+        return super.getPort(TaxiService, ITaxiService.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
+     * @return
+     *     returns ITaxiService
+     */
+    @WebEndpoint(name = "TaxiService")
+    public ITaxiService getTaxiService(WebServiceFeature... features) {
+        return super.getPort(TaxiService, ITaxiService.class, features);
+    }
+
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/ITheatreService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/ITheatreService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/ITheatreService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,28 @@
+package org.jboss.jbossts.txframework.demo.theatre;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:31 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+ 
+ at WebService(targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Theatre", name = "ITheatreService")
+ at SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface ITheatreService {
+
+    @WebResult(name = "bookSeatsResponse", targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Theatre", partName = "bookSeatsResponse")
+    @WebMethod
+    public boolean bookSeats(
+        @WebParam(partName = "how_many", name = "how_many")
+        int howMany,
+        @WebParam(partName = "which_area", name = "which_area")
+        int whichArea
+    );
+}

Added: labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/TheatreServiceService.java
===================================================================
--- labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/TheatreServiceService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/src/org/jboss/jbossts/txframework/demo/theatre/TheatreServiceService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,77 @@
+
+/*
+ * 
+ */
+
+package org.jboss.jbossts.txframework.demo.theatre;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceFeature;
+import javax.xml.ws.Service;
+
+/**
+ * This class was generated by Apache CXF 2.2.9-patch-01
+ * Mon Nov 29 18:18:31 GMT 2010
+ * Generated source version: 2.2.9-patch-01
+ * 
+ */
+
+
+ at WebServiceClient(name = "TheatreServiceService", 
+                  wsdlLocation = "/WEB-INF/wsdl/TheatreService.wsdl",
+                  targetNamespace = "http://www.jboss.org/jbossts/txframework/demo/Theatre") 
+public class TheatreServiceService extends Service {
+
+    public final static URL WSDL_LOCATION;
+    public final static QName SERVICE = new QName("http://www.jboss.org/jbossts/txframework/demo/Theatre", "TheatreServiceService");
+    public final static QName TheatreService = new QName("http://www.jboss.org/jbossts/txframework/demo/Theatre", "TheatreService");
+    static {
+        URL url = null;
+        try {
+            url = new URL("/WEB-INF/wsdl/TheatreService.wsdl");
+        } catch (MalformedURLException e) {
+            System.err.println("Can not initialize the default wsdl from /WEB-INF/wsdl/TheatreService.wsdl");
+            // e.printStackTrace();
+        }
+        WSDL_LOCATION = url;
+    }
+
+    public TheatreServiceService(URL wsdlLocation) {
+        super(wsdlLocation, SERVICE);
+    }
+
+    public TheatreServiceService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public TheatreServiceService() {
+        super(WSDL_LOCATION, SERVICE);
+    }
+    
+    /**
+     * 
+     * @return
+     *     returns ITheatreService
+     */
+    @WebEndpoint(name = "TheatreService")
+    public ITheatreService getTheatreService() {
+        return super.getPort(TheatreService, ITheatreService.class);
+    }
+
+    /**
+     * 
+     * @param features
+     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
+     * @return
+     *     returns ITheatreService
+     */
+    @WebEndpoint(name = "TheatreService")
+    public ITheatreService getTheatreService(WebServiceFeature... features) {
+        return super.getPort(TheatreService, ITheatreService.class, features);
+    }
+
+}

Added: labs/jbosstm/workspace/txframework/demo/web/images/JBoss_DivOfRH_RGB.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/JBoss_DivOfRH_RGB.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/JBoss_byRH_logo_rgb.png
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/JBoss_byRH_logo_rgb.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/a_nav_6699cc.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/a_nav_6699cc.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/bl_corner_10.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/bl_corner_10.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/bl_navcorner_20.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/bl_navcorner_20.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/br_corner_10.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/br_corner_10.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/br_navcorner_20.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/br_navcorner_20.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/tl_corner_10.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/tl_corner_10.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/tl_navcorner_20.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/tl_navcorner_20.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/tr_corner_10.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/tr_corner_10.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/images/tr_navcorner_20.gif
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/txframework/demo/web/images/tr_navcorner_20.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/txframework/demo/web/index.jsp
===================================================================
--- labs/jbosstm/workspace/txframework/demo/web/index.jsp	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/web/index.jsp	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,283 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+
+<!-- $Id:$ -->
+
+<head>
+<title>XML Transaction Service 1.1 Demo Application Client</title>
+</head>
+
+<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" vlink="#336699" alink="#003366" link="#003366" text="#000000" bgcolor="#ffffff">
+
+<!-- logo and header text -->
+<table width="740" cellpadding="0" cellspacing="0" border="0">
+  <tr>
+    <td colspan="2" height="28">&nbsp;</td>
+  </tr>
+  <tr>
+    <td width="20">&nbsp;</td>
+    <td align="center" width="170" bgcolor="#ffffff">
+      <img src="images/JBoss_byRH_logo_rgb.png" alt="jboss logo" border="0">
+    </td>
+    <td width="20">&nbsp;</td>
+    <td valign="middle" align="left" width="530" bgcolor="#ffffff">
+      <br/>
+      <font size="5" style="font-family: Arial, Helvetica, sans-serif">
+        XML Transaction Service 1.1 Demonstrator Application
+      </font>
+    </td>
+  </tr>
+</table>
+
+
+<TABLE width="740" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD width="20">&nbsp;</TD><TD valign="top" width="170">
+
+<!-- nav menu -->
+<TABLE width="170" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="130" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD colspan="2" valign="top" align="left" height="20" width="20" bgcolor="#336699"><IMG src="images/tl_navcorner_20.gif" alt="" border="0"></TD><TD align="center" height="20" width="130" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Web Services</B></FONT></TD><TD colspan="2" valign="top" align="right" height="20" width="20" bgcolor="#336699"><IMG src="images/tr_navcorner_20.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Restaurant"  style="text-decoration: none">Restaurant Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Theatre"  style="text-decoration: none">Theatre Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Taxi"  style="text-decoration: none">Taxi Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD colspan="2" valign="bottom" align="left" height="20" width="20" bgcolor="#e3e3e3"><IMG src="images/bl_navcorner_20.gif" alt="" border="0"></TD><TD height="20" width="130" bgcolor="#e3e3e3">&nbsp;</TD><TD colspan="2" valign="bottom" align="right" height="20" width="20" bgcolor="#e3e3e3"><IMG src="images/br_navcorner_20.gif" alt="" border="0"></TD>
+</TR>
+</table>
+
+<p></p>
+</TD><TD width="20">&nbsp;</TD><TD valign="top" width="530">
+
+<form method="GET" action="basicclient">
+
+<% if(null != request.getAttribute("result")) { %>
+<!-- tx result panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Transaction Result</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+<%= request.getAttribute("result") %>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+<% } // end if %>
+
+
+<!-- transaction type selection panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Restaurant Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Transaction Type:
+<SELECT NAME="txType">
+<option value="AtomicTransaction">Atomic Transaction</option>
+<option value="BusinessActivity">Business Activity</option>
+</SELECT>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+
+<!-- restaurant booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Restaurant Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Table for
+<SELECT NAME="restaurant">
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+people.
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- theatre booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Theatre Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Book
+<SELECT NAME="theatrecirclecount">
+<OPTION>0
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+seats in the Circle
+</p>
+<p>
+Book
+<SELECT NAME="theatrestallscount">
+<OPTION>0
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+seats in the Stalls
+</p>
+<p>
+Book
+<SELECT NAME="theatrebalconycount">
+<OPTION>0
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+seats in the Balcony
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- taxi booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Taxi Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Book a taxi?
+<SELECT NAME="taxi">
+<option value="0">No</option>
+<option value="1">Yes</option>
+</SELECT>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- submit / reset panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Booking Controls</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<p>
+<input type="submit" name="submit" value="Submit Booking Requests" />
+&nbsp;&nbsp;
+<input type="reset" name="reset" value="Reset Form Values" />
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+</form>
+
+</table>
+
+</body>
+
+</html>
+

Added: labs/jbosstm/workspace/txframework/demo/web/indexrpc.jsp
===================================================================
--- labs/jbosstm/workspace/txframework/demo/web/indexrpc.jsp	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/demo/web/indexrpc.jsp	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,253 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+
+<!-- $Id: index.jsp,v 1.6 2005/02/25 09:26:46 kconner Exp $ -->
+
+<head>
+<title>XML Transaction Service Demo Application Client</title>
+</head>
+
+<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" vlink="#336699" alink="#003366" link="#003366" text="#000000" bgcolor="#ffffff">
+
+<!-- logo and header text -->
+<table width="740" cellpadding="0" cellspacing="0" border="0">
+  <tr>
+    <td colspan="2" height="28">&nbsp;</td>
+  </tr>
+  <tr>
+    <td width="20">&nbsp;</td>
+    <td align="center" width="170" bgcolor="#ffffff">
+      <img src="images/JBoss_byRH_logo_rgb.png" alt="jboss logo" border="0">
+    </td>
+    <td width="20">&nbsp;</td>
+    <td valign="middle" align="left" width="530" bgcolor="#ffffff">
+      <br/>
+      <font size="5" style="font-family: Arial, Helvetica, sans-serif">
+        XML Transaction Service Demonstrator Application
+      </font>
+    </td>
+  </tr>
+</table>
+
+
+<TABLE width="740" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD width="20">&nbsp;</TD><TD valign="top" width="170">
+
+<!-- nav menu -->
+<TABLE width="170" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="130" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD><TD height="20" width="10" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD colspan="2" valign="top" align="left" height="20" width="20" bgcolor="#336699"><IMG src="images/tl_navcorner_20.gif" alt="" border="0"></TD><TD align="center" height="20" width="130" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Web Services</B></FONT></TD><TD colspan="2" valign="top" align="right" height="20" width="20" bgcolor="#336699"><IMG src="images/tr_navcorner_20.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Restaurant"  style="text-decoration: none">Restaurant Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Theatre"  style="text-decoration: none">Theatre Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="middle" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/a_nav_6699cc.gif" name="N800004" alt="" border="0"></TD><TD colspan="3" width="150" bgcolor="#e3e3e3"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><A href="#Taxi"  style="text-decoration: none">Taxi Booking Service</A></FONT></TD><TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD colspan="2" valign="bottom" align="left" height="20" width="20" bgcolor="#e3e3e3"><IMG src="images/bl_navcorner_20.gif" alt="" border="0"></TD><TD height="20" width="130" bgcolor="#e3e3e3">&nbsp;</TD><TD colspan="2" valign="bottom" align="right" height="20" width="20" bgcolor="#e3e3e3"><IMG src="images/br_navcorner_20.gif" alt="" border="0"></TD>
+</TR>
+</table>
+
+<p></p>
+</TD><TD width="20">&nbsp;</TD><TD valign="top" width="530">
+
+<form method="GET" action="basicclientrpc">
+
+<% if(null != request.getAttribute("result")) { %>
+<!-- tx result panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Transaction Result</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+<%= request.getAttribute("result") %>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+<% } // end if %>
+
+
+<!-- transaction type selection panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Restaurant Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Transaction Type:
+<SELECT NAME="txType">
+<option value="AtomicTransaction">Atomic Transaction</option>
+<option value="BusinessActivity">Business Activity</option>
+</SELECT>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+
+<!-- restaurant booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Restaurant Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Table for
+<SELECT NAME="restaurant">
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+people.
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- theatre booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Theatre Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Book
+<SELECT NAME="theatrecount">
+<OPTION>1
+<OPTION>2
+<OPTION>3
+<OPTION>4
+<OPTION>5
+<OPTION>6
+<OPTION>7
+<OPTION>8
+<OPTION>9
+<OPTION>10
+</SELECT>
+seats in the
+<select name="theatrearea">
+<option value="0">Circle
+<option value="1">Stalls
+<option value="2">Balcony
+</select>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- taxi booking panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Taxi Service - Booking Form</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<div>
+<p>
+Book a taxi?
+<SELECT NAME="taxi">
+<option value="0">No</option>
+<option value="1">Yes</option>
+</SELECT>
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+<!-- submit / reset panel -->
+<TABLE width="530" cellpadding="0" cellspacing="0" border="0">
+<TR>
+<TD colspan="3" height="20" bgcolor="#ffffff">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="top" align="left" width="10" bgcolor="#336699"><IMG src="images/tl_corner_10.gif" alt="" border="0"></TD><TD valign="middle" align="left" width="510" bgcolor="#336699"><FONT size="2" color="#ffffff" style="font-family: Arial, Helvetica, sans-serif"><B>Booking Controls</B></FONT></TD><TD valign="top" align="right" width="10" bgcolor="#336699"><IMG src="images/tr_corner_10.gif" alt="" border="0"></TD>
+</TR>
+<TR>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD><TD width="510" bgcolor="#e3e3e3">
+<FONT size="2" style="font-family: Arial, Helvetica, sans-serif">
+<p>
+<input type="submit" name="submit" value="Submit Booking Requests" />
+&nbsp;&nbsp;
+<input type="reset" name="reset" value="Reset Form Values" />
+</p>
+</FONT></TD>
+<TD width="10" bgcolor="#e3e3e3">&nbsp;</TD>
+</TR>
+<TR>
+<TD valign="bottom" align="left" width="10" bgcolor="#e3e3e3"><IMG src="images/bl_corner_10.gif" alt="" border="0"></TD><TD width="510" bgcolor="#e3e3e3">&nbsp;</TD><TD valign="bottom" align="right" width="10" bgcolor="#e3e3e3"><IMG src="images/br_corner_10.gif" alt="" border="0"></TD>
+</TR>
+</TABLE>
+
+</form>
+
+</table>
+
+</body>
+
+</html>
+

Added: labs/jbosstm/workspace/txframework/resources/jboss-aop.xml
===================================================================
--- labs/jbosstm/workspace/txframework/resources/jboss-aop.xml	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/resources/jboss-aop.xml	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2011 Red Hat 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) 2011
+  @author JBoss Inc.
+-->
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+    <!-- ServiceRequest and Tx/DataManagementProcessing Aspect -->
+    <aspect class="org.jboss.jbossts.txframework.internal.aspect.TxAspect" scope="PER_INSTANCE"/>
+
+    <!-- Specification of the pointcuts -->
+    <!-- ServiceRequest method in a ServiceParticipant class -->
+    <pointcut name="ServiceRequestAnnotation" expr="execution(* @org.jboss.jbossts.txframework.api.annotation.service.ParticipantService->@org.jboss.jbossts.txframework.api.annotation.service.ServiceRequest(..))"/>
+
+    <!-- TxManagement field in a ServiceParticipant class -->
+    <pointcut name="ParticipantServiceTxManagementAnnotation" expr="field(org.jboss.jbossts.txframework.api.management.TxControl @org.jboss.jbossts.txframework.api.annotation.service.ParticipantService->@org.jboss.jbossts.txframework.api.annotation.management.TxManagement)"/>
+
+    <!-- TxManagement field in a LifecycleManager class -->
+    <pointcut name="LifecycleManagerTxManagementAnnotation" expr="field(org.jboss.jbossts.txframework.api.management.TxControl @org.jboss.jbossts.txframework.api.annotation.lifecycle.LifecycleManager->@org.jboss.jbossts.txframework.api.annotation.management.TxManagement)"/>
+
+    <!-- DataManagement field in a ServiceParticipant class -->
+    <pointcut name="ParticipantServiceDataManagementAnnotation" expr="field(org.jboss.jbossts.txframework.api.management.DataControl @org.jboss.jbossts.txframework.api.annotation.service.ParticipantService->@org.jboss.jbossts.txframework.api.annotation.management.DataManagement)"/>
+
+    <!-- DataManagement field in a LifecycleManager class -->
+    <pointcut name="LifecycleManagerDataManagementAnnotation" expr="field(org.jboss.jbossts.txframework.api.management.DataControl @org.jboss.jbossts.txframework.api.annotation.lifecycle.LifecycleManager->@org.jboss.jbossts.txframework.api.annotation.management.DataManagement)"/>
+
+    <!-- Binding of  pointcut to aspects  -->
+    <!-- TxAspect.serviceRequest() handles ServiceRequest method calls -->
+    <bind pointcut="ServiceRequestAnnotation">
+        <advice name="serviceRequest" aspect="org.jboss.jbossts.txframework.internal.aspect.TxAspect"/>
+    </bind>
+
+    <!-- TxAspect.txManagement() handles TxManagement field reads and  writes -->
+    <bind pointcut="ParticipantServiceTxManagementAnnotation">
+        <advice name="txManagement" aspect="org.jboss.jbossts.txframework.internal.aspect.TxAspect"/>
+    </bind>
+
+    <bind pointcut="LifecycleManagerTxManagementAnnotation">
+        <advice name="txManagement" aspect="org.jboss.jbossts.txframework.internal.aspect.TxAspect"/>
+    </bind>
+
+    <!-- TxAspect.dataManagement() handles TxManagement field reads and  writes -->
+    <bind pointcut="ParticipantServiceDataManagementAnnotation">
+        <advice name="dataManagement" aspect="org.jboss.jbossts.txframework.internal.aspect.TxAspect"/>
+    </bind>
+
+    <bind pointcut="LifecycleManagerDataManagementAnnotation">
+        <advice name="dataManagement" aspect="org.jboss.jbossts.txframework.internal.aspect.TxAspect"/>
+    </bind>
+
+</aop>

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleHandler.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleHandler.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleHandler.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, 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) 2010
+ * @author JBoss Inc.
+ */
+package org.jboss.jbossts.txframework.api.annotation.lifecycle;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation used to identify a method which is potentially the target of a lifecycle trigger
+ * annotation
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface LifecycleHandler
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a transactional
+     * lifecyle handler (CLOSE or COMPENSATE) is called in an enclosing WS or REST transaction. This can be
+     * used to override any default provided at the class level
+     */
+    BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleManager.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/lifecycle/LifecycleManager.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,23 @@
+package org.jboss.jbossts.txframework.api.annotation.lifecycle;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to identify a lifecycle manager class and thereby enable identification of
+ * methods with LifecycleHandler annotations and injection into fields with LifecycleManager and DataManager
+ * annotations
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface LifecycleManager
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a transactional
+     * lifecyle handler (CLOSE or COMPENSATE) is called in an enclosing WS or REST transaction. This can be
+     * used to override any default provided at the class level
+     */
+    boolean autobridge() default false;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/DataManagement.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/DataManagement.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/DataManagement.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,16 @@
+package org.jboss.jbossts.txframework.api.annotation.management;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Field level annotation used to enable injection of a data control into service participant
+ * and lifecycle management classes
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.FIELD)
+public @interface DataManagement
+{
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/TxManagement.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/TxManagement.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/management/TxManagement.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,16 @@
+package org.jboss.jbossts.txframework.api.annotation.management;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Field level annotation used to enable injection of a transaction control into service participant
+ * and lifecycle management classes
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.FIELD)
+public @interface TxManagement
+{
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Parameter.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Parameter.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Parameter.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,21 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method parameter level annotation used when CUSTOM parameter matching is employed to identify service request
+ * method parameters with their corresponding lifecycle handler method parameters
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.PARAMETER)
+public @interface Parameter
+{
+    /**
+     * a string used to label a service request or lifecycle handler method parameter so that they can be
+     * identified as source and target for parameter passing.
+     */
+    String value() default "";
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ParticipantService.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ParticipantService.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ParticipantService.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,32 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import org.jboss.jbossts.txframework.api.configuration.service.Default;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to identify that a class is participating in the TX Framework and to specify
+ * default values for fields in method level ServiceRequest annotations
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface ParticipantService
+{
+    /**
+     * a group name used to label services which are implemented by more than one participant class.
+     * lifecycle handling within a given transaction is pooled for all service requests to participant classes
+     * in the same service group. in particular, this means that the group will only be registered once as
+     * a participant in the transaction, avoiding unnecessary round trips to the coordinator at PREPARE,
+     * COMMIT etc.
+     */
+    public String serviceGroup() default "";
+    /**
+     * The class which is the target of lifecycle handler callbacks. With POJO execution mode this class is the
+     * direct target for handler method invocations. With EJB execution mode it identifies the EJB interface
+     * class. With WS execution mode it identifies the client interface for  a JaxWS client.
+     */
+    public Class lifecycleClass() default Default.class;
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Recover.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Recover.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Recover.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,17 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation used to identify a method of a service participant which should be called during
+ * startup to handle recovery of objects previously stored using [@link TxControl#storeObject(Serializable)}.
+ * The target method should take a single object as argument and have void type.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface Recover
+{
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/RecoveryComplete.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/RecoveryComplete.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/RecoveryComplete.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,18 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation used to identify a method of a service participant which should be called during
+ * startup once recovery of objects previously stored using {@link TxControl#storeObject(Serializable)} has
+ * completed. The target method should have take no arguments and have void type.
+
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface RecoveryComplete
+{
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Result.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Result.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/Result.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,21 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation used when CUSTOM parameter matching is employed to identify the service request
+ * result with a corresponding lifecycle handler method parameter
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface Result
+{
+    /**
+     * a string used to label the service request result so that it can be identified as source for a lifecycle
+     * handler method parameter labelled with the same name.
+     */
+    String value();
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ServiceRequest.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ServiceRequest.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/service/ServiceRequest.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,38 @@
+package org.jboss.jbossts.txframework.api.annotation.service;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+import org.jboss.jbossts.txframework.api.configuration.service.Default;
+import org.jboss.jbossts.txframework.api.configuration.service.RequestType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation used to enable lifecycle handling and configure parameters which control its operation
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface ServiceRequest
+{
+    /**
+     * The class which is the target of lifecycle handler callbacks. With POJO execution mode this class is the
+     * direct target for handler method invocations. With EJB execution mode it identifies the EJB interface
+     * class. With WS execution mode it identifies the client interface for  a JaxWS client.
+     */
+    public Class lifecycleClass() default Default.class;
+    /**
+     * identifies whether the service request is always read only as far as transactional modifications are
+     * concerned or, alternatively, that it may make changes to transactional data. in the latter case the
+     * service request method can indicate a read-only outcome by invoking the readOnly method of an injected
+     * control.
+     */
+    public RequestType requestType() default RequestType.MODIFY;
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction. This can be used to override any default provided at the class level
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/AT.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/AT.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/AT.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,24 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for all atomic transaction types
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface AT
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/BA.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/BA.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/BA.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,24 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for all business activity transaction types
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface BA
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/JTA.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/JTA.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/JTA.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,21 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for JTA transactions.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface JTA
+{
+    /**
+     * we could potentially allow auto brdiging to a WSAT transaction when in a JTA transaction
+     * but for now this is disabled
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+     */
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTAT.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTAT.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTAT.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,24 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for RESTful atomic transactions.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface RESTAT
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTJDI.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTJDI.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/RESTJDI.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,24 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for RESTful business activity transactions.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface RESTJDI
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSAT.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSAT.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSAT.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,24 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for WSAT atomic transactions.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface WSAT
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSBA.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSBA.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/transaction/WSBA.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,31 @@
+package org.jboss.jbossts.txframework.api.annotation.transaction;
+
+import org.jboss.jbossts.txframework.api.configuration.BridgeType;
+import org.jboss.jbossts.txframework.api.configuration.transaction.CompletionType;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Class level annotation used to declare that  a participant service will participate in lifecycle
+ * processing for WSBA business activity transactions.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.TYPE)
+public @interface WSBA
+{
+    /**
+     * attribute specifying whether automatic bridging to a JTA transaction should occur when a service
+     * request or transactional lifecyle handler (CLOSE or COMPENSATE) is first called in an enclosing
+     * WS or REST transaction
+     */
+    public BridgeType bridgeType() default BridgeType.DEFAULT;
+
+    /**
+     * the specific WSBA completion protocol which should be used for a WSBA service participant
+     * @return
+     */
+    public CompletionType completionType() default CompletionType.COORDINATOR;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/ATTrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/ATTrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/ATTrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Atomic Transaction lifecycle event in response to an invocation of the method
+ * in any type of atomic transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface ATTrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public ATLifecycleEvent lifecycleEvent() default ATLifecycleEvent.PREPARE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/BATrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/BATrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/BATrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Business Activity lifecycle event in response to an invocation of the method
+ * in any type of business activity transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface BATrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public BALifecycleEvent lifecycleEvent() default BALifecycleEvent.COMPLETE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/JTATrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/JTATrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/JTATrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,45 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Atomic Transaction lifecycle event in response to an invocation of the method
+ * in a JTA transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface JTATrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public ATLifecycleEvent lifecycleEvent() default ATLifecycleEvent.PREPARE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTATTrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTATTrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTATTrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Atomic Transaction lifecycle event in response to an invocation of the method
+ * in a Restful atomic transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface RESTATTrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public ATLifecycleEvent lifecycleEvent() default ATLifecycleEvent.PREPARE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTJDITrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTJDITrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/RESTJDITrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Business Activity lifecycle event in response to an invocation of the method
+ * in a RESTful business activity transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface RESTJDITrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public BALifecycleEvent lifecycleEvent() default BALifecycleEvent.COMPLETE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/TriggerSet.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/TriggerSet.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/TriggerSet.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,52 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying generic and protocol-specific sets
+ * of lifecycle handlers to be registered for a corresponding set of lifecycle events in response to an invocation
+ * of the method in matching type of transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface TriggerSet
+{
+    /**
+     * a set of generic atomic transaction lifecycle trigger annotations identifying handler methods to be
+     * triggered by invocations of the service request method in any atomic transaction
+     */
+    ATTrigger[] at() default {};
+    /**
+     * a set of JTA atomic transaction lifecycle trigger annotations identifying handler methods to be
+     * triggered by invocations of the service request method in a JTA transaction
+     */
+    JTATrigger[] jta() default {};
+    /**
+     * a set of WSAT atomic transaction lifecycle trigger annotations identifying handler methods to be
+     * triggered by invocations of the service request method in a WSAT transaction
+     */
+    WSATTrigger[] wsat() default {};
+    /**
+     * a set of RESTAT atomic transaction lifecycle trigger annotations identifying handler methods to be
+     * triggered by invocations of the service request method in a RESTAT transaction
+     */
+    RESTATTrigger[] restat() default {};
+    /**
+     * a set of generic business activity transaction lifecycle trigger annotations identifying handler methods
+     * to be triggered by invocations of the service request method in any business activity transaction
+     */
+    BATrigger[] ba() default {};
+    /**
+     * a set of WSBA business activity transaction lifecycle trigger annotations identifying handler methods
+     * to be triggered by invocations of the service request method in a WSBA business activity transaction
+     */
+    WSBATrigger[] wsba() default {};
+    /**
+     * a set of RESTJDI business activity transaction lifecycle trigger annotations identifying handler methods
+     * to be triggered by invocations of the service request method in a RESTJDI business activity transaction
+     */
+    RESTJDITrigger[] restjdi() default {};
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSATTrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSATTrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSATTrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Atomic Transaction lifecycle event in response to an invocation of the method
+ * in a WSAT atomic transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface WSATTrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public ATLifecycleEvent lifecycleEvent() default ATLifecycleEvent.PREPARE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSBATrigger.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSBATrigger.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/annotation/trigger/WSBATrigger.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,44 @@
+package org.jboss.jbossts.txframework.api.annotation.trigger;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.*;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Method level annotation attached to a service request method identifying a lifecycle handler to be
+ * registered for a specific Business Activity lifecycle event in response to an invocation of the method
+ * in a WSBA business activity transaction.
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+public @interface WSBATrigger
+{
+    /**
+     * the lifecycle event which will trigger execution of the handler method
+     */
+    public BALifecycleEvent lifecycleEvent() default BALifecycleEvent.COMPLETE;
+    /**
+     * the name of the handler method
+     */
+    public String methodName();
+    /**
+     * How data obtained from the service request should be matched against parameters of the handler method
+     */
+    public DataMatch type() default DataMatch.RETURN_VALUE;
+    /**
+     * Whether parameter matching must be strictly  1-1 or should allow defaulting of unmatched parameters
+     */
+    public ParameterMatch match() default ParameterMatch.STRICT;
+    /**
+     * Whether the handler should be triggered for each service request or once only using data from the last request
+     */
+    public boolean single() default false;
+    /**
+     * Whether the handler should be triggered in request order, prioritized to the start of the queue of handlers
+     * to be triggered or downgraded to the end of the list
+     */
+    public ExecutionOrder order() default ExecutionOrder.NORMAL;
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/BridgeType.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/BridgeType.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/BridgeType.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,12 @@
+package org.jboss.jbossts.txframework.api.configuration;
+
+/**
+ * enumerated type representing possible target types for transaction bridging
+ */
+public enum BridgeType
+{
+    DEFAULT,
+    NONE,
+    JTA,
+    WSAT
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/Default.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/Default.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/Default.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,8 @@
+package org.jboss.jbossts.txframework.api.configuration.service;
+
+/**
+ * Marker type used to provide default value for class fields in tx framework service annotations
+ */
+final public class Default
+{
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/RequestType.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/RequestType.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/service/RequestType.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,17 @@
+package org.jboss.jbossts.txframework.api.configuration.service;
+
+/**
+ * specifies values taken by the requestType field in {@link org.jboss.jbossts.txframework.api.annotation.service.ServiceRequest#requestType()}annotations
+ */
+public enum RequestType
+{
+    /**
+     * this value indicates that a service request method will never make changes to data.
+     */
+    READ_ONLY,
+    /**
+     * this value indicates that a service request method may make changes to data and will employ an
+     * injected control, where necessary, to notify read only status for a specific invocation.
+     */
+    MODIFY
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/transaction/CompletionType.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/transaction/CompletionType.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/transaction/CompletionType.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,10 @@
+package org.jboss.jbossts.txframework.api.configuration.transaction;
+
+/**
+ * 
+ */
+public enum CompletionType
+{
+    COORDINATOR,
+    PARTICIPANT
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ATLifecycleEvent.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ATLifecycleEvent.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ATLifecycleEvent.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,33 @@
+package org.jboss.jbossts.txframework.api.configuration.trigger;
+
+/**
+ * values identifying each of the possible atomic transaction lifecycle events for which lifecycle handlees
+ * can be registered
+ */
+public enum ATLifecycleEvent
+{
+    /**
+     * lifecycle event which happens just prior to the prepare operation while the transaction is still running
+     */
+    PRE_PREPARE,
+    /**
+     * lifecycle event which happens at prepare when the transaction is no longer running
+     */
+    PREPARE,
+    /**
+     * lifecycle event which happens if all service requests executed in the transaction have read only outcomes
+     */
+    READ_ONLY,
+    /**
+     * lifecycle event which happens if all the transaction is rolled back
+     */
+    ABORT,
+    /**
+     * lifecycle event which happens if the transaction commits
+     */
+    COMMIT,
+    /**
+     * lifecycle event which happens after commit or rollback
+     */
+    POST_COMMIT
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/BALifecycleEvent.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/BALifecycleEvent.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/BALifecycleEvent.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,39 @@
+package org.jboss.jbossts.txframework.api.configuration.trigger;
+
+/**
+ */
+public enum BALifecycleEvent
+{
+    /**
+     * lifecycle event which happens if all service requests methods executed in the activity have read only
+     * outcomes or if a service request method indicates, via a control, that the activity should exit.
+     */
+    EXIT,
+    /**
+     * lifecycle event which happens if a service request indicates that the activity cannot complete
+     */
+    NOT_COMPLETE,
+    /**
+     * lifecycle event which happens when the activity is complete. for coordinator completion activities this
+     * occurs when a complete notification is received from the coordinator. for participant completion activities
+     * this happens when a service request method indicates, via a control, that the activity has completed or a
+     * service request annotated with an @CompletedBy annotation finishes executing.
+     */
+    COMPLETE,
+    /**
+     * lifecycle event which happens when the activity is cancelled.
+     */
+    CANCEL,
+    /**
+     * lifecycle event which happens when the activity is closed.
+     */
+    CLOSE,
+    /**
+     * lifecycle event which happens when the activity is compensated.
+     */
+    COMPENSATE,
+    /**
+     * lifecycle event which happens when the activity fails.
+     */
+    FAIL
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/DataMatch.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/DataMatch.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/DataMatch.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,22 @@
+package org.jboss.jbossts.txframework.api.configuration.trigger;
+
+/**
+ * values identifying how data obtained from a service request should be used to parameterise a lifecycle handler call
+ */
+public enum DataMatch
+{
+    /**
+     * the handler should be passed the result returned from the call to the service request method
+     */
+    RETURN_VALUE,
+    /**
+     * the handler should be passed the parameters passed in the call to the service request method
+     */
+    PARAMETERS_MATCH,
+    /**
+     * parameters to the handler should be obtained from parameters to the service request call and/or the
+     * service request result by matching ServiceParameter and ServiceResult annotations attached to the
+     * service request method with ServiceParameter annotations attached to the handler method.
+     */
+    CUSTOM
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ExecutionOrder.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ExecutionOrder.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ExecutionOrder.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,23 @@
+package org.jboss.jbossts.txframework.api.configuration.trigger;
+
+/**
+ * values identifying how a lifecycle handler is to be scheduled relative to other handlers when more than
+ * one service request executed in the transaction triggers the same lifecycle event
+ */
+public enum ExecutionOrder
+{
+    /**
+     * the handler is to be added to the scheduler queue in order with its corresponding web service request.
+     */
+    NORMAL,
+    /**
+     * the handler is to be promoted to the head of the scheduler queue. if multiple FIRST handlers are registered
+     * then handlers registered later precede those registered earlier
+     */
+    FIRST,
+    /**
+     * the handler is to be relegated to the tail of the scheduler queue. if multiple LAST handlers are registered
+     * then handlers registered later succeed those registered earlier
+     */
+    LAST
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ParameterMatch.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ParameterMatch.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/configuration/trigger/ParameterMatch.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,19 @@
+package org.jboss.jbossts.txframework.api.configuration.trigger;
+
+/**
+ * values identifying whether lifecycle handler parameters must match 1-1 with service request parameters or may
+ * include parameters whose values are defaulted.
+ */
+public enum ParameterMatch
+{
+    /**
+     * parameter matchign must be strictly 1-1
+     */
+    STRICT,
+    /**
+     * parameters to the handler method which do not conform to a service request parameter may be defaulted
+     * to null or zero so long as all service request parameters are matched with a corresponnding handler
+     * parameter.
+     */
+    ALLOW_NULL
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/exception/UnknownServiceException.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/exception/UnknownServiceException.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/exception/UnknownServiceException.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,14 @@
+package org.jboss.jbossts.txframework.api.exception;
+
+import com.arjuna.mw.wsas.status.Unknown;
+
+/**
+ * exception thrown when an unknown service request is notified during aspect processing
+ */
+public class UnknownServiceException extends Exception
+{
+    public UnknownServiceException(String message)
+    {
+        super(message);
+    }
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/ATTxControl.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/ATTxControl.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/ATTxControl.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,12 @@
+package org.jboss.jbossts.txframework.api.management;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.ATLifecycleEvent;
+
+/**
+ * Interface defining a transaction control object which can be injected into a framework web service or
+ * lifecycle method for one of the Atomic Transaction protocols.
+ */
+public interface ATTxControl extends TxControl
+{
+    public void readOnly(ATLifecycleEvent event);
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/BATxControl.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/BATxControl.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/BATxControl.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,13 @@
+package org.jboss.jbossts.txframework.api.management;
+
+import org.jboss.jbossts.txframework.api.configuration.trigger.BALifecycleEvent;
+
+/**
+ * Interface defining a transaction control object which can be injected into a framework web service or
+ * lifecycle method for one of the Business Activity protocols.
+ */
+public interface BATxControl extends TxControl
+{
+    public void readOnly(BALifecycleEvent event);
+    public void complete();
+}
\ No newline at end of file

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/DataControl.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/DataControl.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/DataControl.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,12 @@
+package org.jboss.jbossts.txframework.api.management;
+
+/**
+ * Interface defining a data control object which can be injected into a framework web service or
+ * lifecycle method. Instances of this type and its subtypes can be uses to type fields which are
+ * the target of a DataManagement attribute.
+ */
+public interface DataControl
+{
+    public void put(Object objectId, Object object);
+    public Object get(Object objectId);
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/TxControl.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/TxControl.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/TxControl.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,26 @@
+package org.jboss.jbossts.txframework.api.management;
+
+import java.io.Serializable;
+
+/**
+ * Interface defining at the most generic level a transaction control object which can be injected into a
+ * framework web service or lifecycle method. Instances of this type and its subtypes can be uses
+ * to type fields which are the target of a TxManagement attribute. A TxControl provides a set of
+ * operations which the web service or lifecycle method can use to influence the logic of the
+ * transaction.
+ */
+public interface TxControl
+{
+    /**
+     * this method can be called from a web service method while a transaction is active to notify the
+     * framework that no changes have been made during execution of the service method.
+     */
+    public void readOnly();
+    /**
+     * this method can be called from a web service or lifecycle method to notify the framework that the
+     * transaction has failed and may have left the service in an inconsistent state
+     */
+    public void fail();
+    public String storeObject(Serializable object);
+    public boolean deleteObject(String identifier);
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/WSBATxControl.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/WSBATxControl.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/api/management/WSBATxControl.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,11 @@
+package org.jboss.jbossts.txframework.api.management;
+
+/**
+ * Interface defining a transaction control object which can be injected into a framework web service or
+ * lifecycle method for the Web Service Business Activity protocol.
+ */
+public interface WSBATxControl extends BATxControl
+{
+    public void exit() ;
+    public void cannotComplete();
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/aspect/TxAspect.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/aspect/TxAspect.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/aspect/TxAspect.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,104 @@
+package org.jboss.jbossts.txframework.internal.aspect;
+
+// import org.jboss.aop.Aspect;
+import org.jboss.aop.joinpoint.FieldReadInvocation;
+import org.jboss.aop.joinpoint.FieldWriteInvocation;
+import org.jboss.aop.joinpoint.MethodInvocation;
+import org.jboss.jbossts.txframework.internal.service.ServiceManager;
+
+import java.lang.reflect.Method;
+
+/**
+ * This class adds aspects to ServiceRequest annotated methods, TxControl annotated fields and  DataControl
+ * annotated fields.<p/>
+ *
+ * The SeviceRequest aspect performs any transaction bridging specified in the bridgeType fields of either
+ * the method owner class's framework transaction annotations (WSAT, WSBA etc) or the method's ServiceRequest
+ * annotation (assuming the transaction is not already bridged).<p/>
+ *
+ * The SeviceRequest aspect also enrols a lifecycle management participant in any surrounding transaction
+ * for which there is one or more trigger annotations attached to the method (assuming a participant is not
+ * already enrolled.
+ *
+ * The TControl aspect manages reads and writes of TxManagement annotated fields located in classes annotated
+ * with either a ParticipantService or a LifecycleManagement annotation. Reads are satsified by returning a
+ * TxControl which allows the service request or handler to interact with the management participant for the
+ * enclosing transaction. If there is no matching transaction of the required type  then a null value is
+ * returned. In the case  where bridging implies there is more than one condidate for the injection (e.g. a
+ * read of an ATTxControl field when a WSAT transaction has been bridged to a JTA transaction) the control
+ * will provide access to the innermost transaction.
+ *
+ * Writes to TControl fields are illegal and the aspect enforces this by throwing an exception wherever they are
+ * attempted.
+ *
+ * the DataControl aspect manages reads and writes of dataManagement annotated fields located in classes
+ * annotated with either a ParticipantService or a LifecycleManagement annotation. Reads are satsified by
+ * returning a DataControl which allows the service request or handler to share data with the management
+ * participant for the enclosing transaction. In the case where the transaction is bridged and there is a
+ * management participant registered for both the bridging and bridged transaction the same data manager
+ * will be shared by both management participants.
+ *
+ */
+public class TxAspect
+{
+    /**
+     * handler for ServiceRequest annotated method invocation aspect
+     * @param the method invocation
+     * @return
+     * @throws Throwable
+     */
+    public Object serviceRequest(MethodInvocation invocation) throws Throwable
+    {
+        // pass the invocation to the service request handler
+        // then continue with the method call
+        ServiceManager.serviceRequest(invocation.getActualMethod(), invocation.getTargetObject(), invocation.getArguments());
+        return invocation.invokeNext();
+    }
+
+    /**
+     * handler for TxManagement annotated field read invocation aspect
+     * @param the field read invocation
+     * @return
+     * @throws Throwable
+     */
+    public Object txManagement(FieldReadInvocation invocation) throws Throwable
+    {
+        // pass the invocation to the tx management control handler
+        // then continue with the method call
+        return invocation.invokeNext();
+    }
+
+    /**
+     * handler for TxManagement annotated field write invocation aspect
+     * @param the field write invocation
+     * @return
+     * @throws Throwable
+     */
+    public Object txManagement(FieldWriteInvocation invocation) throws Throwable
+    {
+        throw new IllegalAccessException();
+    }
+    /**
+     * handler for DataManagement annotated field read invocation aspect
+     * @param the field read invocation
+     * @return
+     * @throws Throwable
+     */
+    public Object dataManagement(FieldReadInvocation invocation) throws Throwable
+    {
+        // pass the invocation to the tx management control handler
+        // then continue with the method call
+        return invocation.invokeNext();
+    }
+
+    /**
+     * handler for DataManagement annotated field write invocation aspect
+     * @param the field write invocation
+     * @return
+     * @throws Throwable
+     */
+    public Object dataManagement(FieldWriteInvocation invocation) throws Throwable
+    {
+        throw new IllegalAccessException();
+    }
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/RequestHandler.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/RequestHandler.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/RequestHandler.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,13 @@
+package org.jboss.jbossts.txframework.internal.service;
+
+import org.jboss.jbossts.txframework.api.exception.UnknownServiceException;
+
+import java.lang.reflect.Method;
+
+/**
+ * Object which performs the processing appropriate for a specific service request.
+ */
+public abstract class RequestHandler
+{
+    public abstract void handleRequest(Object target, Object[] args) throws Exception;
+}

Added: labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/ServiceManager.java
===================================================================
--- labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/ServiceManager.java	                        (rev 0)
+++ labs/jbosstm/workspace/txframework/src/org/jboss/jbossts/txframework/internal/service/ServiceManager.java	2011-07-25 10:07:06 UTC (rev 37291)
@@ -0,0 +1,131 @@
+package org.jboss.jbossts.txframework.internal.service;
+
+import org.jboss.jbossts.txframework.api.annotation.service.ParticipantService;
+import org.jboss.jbossts.txframework.api.annotation.transaction.*;
+import org.jboss.jbossts.txframework.api.exception.UnknownServiceException;
+
+import java.lang.reflect.Method;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * Class which manages participant services and handles service requests
+ */
+public class ServiceManager
+{
+    public static void serviceRequest(Method method, Object receiver, Object[] args) throws Exception
+    {
+        RequestHandler requestHandler = findOrCreateRequestHandler(method);
+            requestHandler.handleRequest(receiver, args);
+    }
+
+    /**
+     * an index connecting service request methods to
+     */
+    private static ConcurrentHashMap<Method,  RequestHandler> handlerMap = new ConcurrentHashMap<Method,  RequestHandler>();
+
+    /**
+     * generate a handler for an invalid service request which we add to thhe handler table so as to avoid
+     * having to recompute invalid requests
+     * @param method
+     * @return
+     */
+    private static RequestHandler tombstoneHandler(Method method)
+    {
+        final String className = method.getDeclaringClass().getCanonicalName();
+        final String methodName = method.getName();
+
+        return new RequestHandler() {
+            @Override
+            public void handleRequest(Object target, Object[] args) throws Exception
+            {
+                // the tombstonehandler only gets called if
+                throw new UnknownServiceException("no handler for ServiceRequest method " + className +"." + methodName);
+            }
+        };
+    }
+
+    private static RequestHandler findOrCreateRequestHandler(Method method)
+    {
+        RequestHandler handler = handlerMap.get(method);
+
+        if (handlerMap == null) {
+            handler = createRequestHandler(method);
+            RequestHandler previous = handlerMap.putIfAbsent(method, handler);
+            if (previous != null) {
+                handler = previous;
+            }
+        }
+
+        return handler;
+    }
+
+    private static RequestHandler createRequestHandler(Method method)
+    {
+        // we need to assemble all the information provided at the class level and the method level
+        // the class level info is contained in the ParticipantService annotation and the various
+        // transaction annotations.
+        // the method level info is contained in the method ServiceRequest annotation, the method parameter
+        // amd result annotations and the various trigger annotations
+
+        RequestConfiguration requestConfiguration  =  getClassRequestConfiguration(method.getDeclaringClass());
+
+        if (requestConfiguration == null) {
+            // hmm, we must have an invalid participant service so return a tombstone handler
+            // which will notify the problem and avoid us having to do the lookup again
+
+            return tombstoneHandler();
+        }
+
+        // add in the configuration information provided on the method
+        requestConfiguration = addMethodRequestConfiguration(requestConfiguration, method);
+
+        return requestConfiguration.createHandler();
+    }
+
+    public RequestConfiguration getClassRequestConfiguration(Class<?> participantServideClass)
+    {
+        // first obtaina ll the class level annotations
+        ParticipantService participantService = participantServiceClass.getAnnotation(ParticipantService.class);
+
+        if (participantService == null) {
+            return null;
+        }
+
+        AT at = participantServiceClass.getAnnotation(AT.class);
+        BA ba = participantServiceClass.getAnnotation(BA.class);
+        JTA jta = participantServiceClass.getAnnotation(JTA.class);
+        RESTAT restat = participantServiceClass.getAnnotation(RESTAT.class);
+        RESTJDI restjdi = participantServiceClass.getAnnotation(RESTJDI.class);
+        WSAT wsat = participantServiceClass.getAnnotation(WSAT.class);
+        WSBA wsba = participantServiceClass.getAnnotation(WSBA.class);
+
+        RequestConfiguration configuration =  new RequestConfiguration();
+
+        configuration.setServiceGroup(participantService.serviceGroup());
+        configuration.setLifecycleClass(participantService.lifecycleClass());
+        if (at != null) {
+            configuration.setAT(true);
+            configuration.setATBridgeType(at.bridgeType());
+        }
+        if (ba != null) {
+            configuration.setBA(true);
+            configuration.setBABridgeType(ba.bridgeType());
+        }
+        if (restat != null) {
+            configuration.setRESTAT(true);
+            configuration.setRESTATBridgeType(restat.bridgeType());
+        }
+        if (restjdi != null) {
+            configuration.setRESTBA(true);
+            configuration.setRESTJDIBridgeType(restjdi.bridgeType());
+        }
+        if (wsat != null) {
+            configuration.setWSAT(true);
+            configuration.setWSATBridgeType(wsat.bridgeType());
+        }
+        if (wsba != null) {
+            configuration.setWSBA(true);
+            configuration.setWSBABridgeType(wsba.bridgeType());
+        }
+    }
+}



More information about the jboss-svn-commits mailing list