[jboss-svn-commits] JBL Code SVN: r19546 - in labs/jbosstm/trunk/XTS: WS-C and 252 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Apr 14 06:44:30 EDT 2008


Author: adinn
Date: 2008-04-14 06:44:28 -0400 (Mon, 14 Apr 2008)
New Revision: 19546

Added:
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_handlers.xml
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/build.sh
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-activation-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-registration-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor.wsdl
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/ws-addr.xsd
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/wscoor.xsd
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/BodyHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HandlerRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HeaderHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorChain.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/MessageContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapBody.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapClient.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapFault10.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessageLogging.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapService.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapServiceEndpointProvider.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/adapters/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/base/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/base/handlers/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/base/policy/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap11Details.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap12Details.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapBodyMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapConstants.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapDetails.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapFaultMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapMessageBase.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapNotUnderstoodType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapParser.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/stax/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/StreamHelper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/ArjunaContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/InstanceIdentifier.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/handler/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/policy/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/processor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactory.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactoryMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/Registrar.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrarMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/SoapFault11.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/util/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/util/StreamHelper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsaddr/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsaddr/AddressingHelper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/ArjunaContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/InstanceIdentifier.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierInHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/processor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/processor/BaseNotificationProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/CoordinationConstants.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/ActivationCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/WSCOORClient.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ActivationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactoryMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrarMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/MessageId.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/deploy/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/deploy/CoordinationInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationPortType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationService.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContextType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextResponseType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/Expires.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ObjectFactory.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterResponseType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationPortType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationService.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/package-info.java
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t_handlers.xml
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/build.sh
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-orig.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/build.sh
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-participant-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba.wsdl
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/ws-addr.xsd
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsat.xsd
   labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsba.xsd
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/NotificationType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/client/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/handlers/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/policy/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/processors/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/BAParticipantManager.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/CompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Durable2PCStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/ParticipantStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Volatile2PCStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ExceptionType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/NotificationType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ObjectFactory.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/package-info.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/ArjunaTX11Constants.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/WSARJTXClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantCallback.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationParticipantPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/AtomicTransactionConstants.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/CoordinatorInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/ParticipantInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/State.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/WSATClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorCallback.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/ParticipantProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionInitiatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/ParticipantPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/BusinessActivityConstants.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionCoordinatorInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionCoordinatorInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionParticipantInboundEvents.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/State.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/WSBAClient.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionParticipantProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionCoordinatorProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionParticipantProcessor.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BAParticipantManager.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BusinessActivityTerminator.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/CompletionCoordinatorParticipant.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CompletionCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionParticipantProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionParticipantProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/TerminationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/deploy/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/deploy/TransactionInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionCoordinatorEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionParticipantEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionCoordinatorEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionParticipantEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BACoordinatorCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BAParticipantCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessActivityTerminatorStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithCoordinatorCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithParticipantCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/CompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Durable2PCStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/ParticipantStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Volatile2PCStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ATAssertion.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/Notification.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ObjectFactory.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/package-info.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAAtomicOutcomeAssertion.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAMixedOutcomeAssertion.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantPortType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantService.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ExceptionType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/NotificationType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ObjectFactory.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/StatusType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/package-info.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wsc/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/arjunajta/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/protocols/
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/protocols/Initializer.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/context/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/context/Context.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/deploy/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/deploy/WSCFInitialisation.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/common/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/common/Environment.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolRegistry.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wsc11/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wsc11/ContextFactoryMapperImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java
   labs/jbosstm/trunk/XTS/WSCF/config/wscf11.xml
   labs/jbosstm/trunk/XTS/WSCF/xml/Sagas11HLSImple.xml
   labs/jbosstm/trunk/XTS/WSCF/xml/TwoPhase11HLSImple.xml
   labs/jbosstm/trunk/XTS/WSCF/xml/wscf11_web-app.xml
   labs/jbosstm/trunk/XTS/WSTX/classes10/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivity.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivityFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/CoordinationContextHelper.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/participants/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivity.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivityFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxBaseHeaderContextProcessor.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxWSHeaderContextProcessor.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/CoordinationContextHelper.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxBaseHeaderContextProcessor.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CleanupSynchronization.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CompletionCoordinatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/BusinessActivityTerminatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithCoordinatorCompletionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithParticipantCompletionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BAParticipantManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/TwoPhaseTxManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.java
   labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
   labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml
   labs/jbosstm/trunk/XTS/WSTX/xml/AtomicTransaction11.xml
   labs/jbosstm/trunk/XTS/WSTX/xml/BusinessActivity11.xml
   labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app11.xml
   labs/jbosstm/trunk/XTS/demo/web/indexrpc.jsp
   labs/jbosstm/trunk/XTS/ext/jaxb-api.jar
   labs/jbosstm/trunk/XTS/ext/jboss-javaee.jar
   labs/jbosstm/trunk/XTS/ext/jboss-jaxrpc.jar
   labs/jbosstm/trunk/XTS/ext/jboss-jaxws-ext.jar
   labs/jbosstm/trunk/XTS/ext/jboss-jaxws.jar
   labs/jbosstm/trunk/XTS/ext/jboss-saaj.jar
   labs/jbosstm/trunk/XTS/ext/jbossws-client.jar
   labs/jbosstm/trunk/XTS/sar/META-INF/application.xml
   labs/jbosstm/trunk/XTS/sar/META-INF/application10.xml
   labs/jbosstm/trunk/XTS/sar/META-INF/application11.xml
Removed:
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/BodyHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HandlerRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HeaderHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorChain.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/MessageContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapBody.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapClient.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessageLogging.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapProcessor.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapRegistry.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapService.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapServiceEndpointProvider.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/adapters/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/base/handlers/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/base/policy/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap11Details.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap12Details.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapBodyMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapConstants.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapDetails.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapFaultMessage.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapMessageBase.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapNotUnderstoodType.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapParser.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/stax/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/transport/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/StreamHelper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr2005/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/InstanceIdentifier.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/handler/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/policy/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/processor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor/
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactory.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactoryMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/Registrar.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrarMapper.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinator.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/messaging/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/NotificationType.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/handlers/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/policy/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/BAParticipantManager.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/CompletionStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Durable2PCStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/ParticipantStub.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Volatile2PCStub.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wsc/
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/common/Environment.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wsc/
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/Initializer.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivity.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivityFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/client/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelper.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/Environment.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/deploy/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/service/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManagerFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransactionFactory.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/context/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/local/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/context/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/local/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/participants/
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java
   labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueIncomingContextInterceptor.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueOutgoingContextInterceptor.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueIncomingContextInterceptor.java
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueOutgoingContextInterceptor.java
   labs/jbosstm/trunk/XTS/demo/dd/jboss/application-sa.xml
   labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application-sa.xml
   labs/jbosstm/trunk/XTS/ext/glue.jar
   labs/jbosstm/trunk/XTS/ext/jaxrpc.jar
   labs/jbosstm/trunk/XTS/ext/jaxws-2_1-mrel2-api.jar
   labs/jbosstm/trunk/XTS/ext/saaj-api.jar
   labs/jbosstm/trunk/XTS/ext/servlet.jar
   labs/jbosstm/trunk/XTS/ext/stax-api-1.0.jar
   labs/jbosstm/trunk/XTS/ext/wstx-asl-2.0.3.jar
Modified:
   labs/jbosstm/trunk/XTS/WS-C/build.xml
   labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml
   labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapFault.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClient.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClientInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/AddressingContext.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/handlers/AddressingInterceptorHandler.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationRequesterInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationRequesterInitialisation.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/deploy/CoordinationInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/build.xml
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionInitiatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/ParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionParticipantInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CompletionCoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CoordinatorProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/TerminatorParticipantProcessorImpl.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/deploy/TransactionInitialisation.java
   labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/engines/CoordinatorEngine.java
   labs/jbosstm/trunk/XTS/WSCF/build.xml
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/CoordinatorControl.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorControl.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorControl.java
   labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/utils/ProtocolLocator.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wsc/deploy/WSCFInitialisation.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java
   labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc/ContextFactoryMapperImple.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel1.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel2.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel3.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java
   labs/jbosstm/trunk/XTS/WSCF/xml/wscf_web-app.xml
   labs/jbosstm/trunk/XTS/WSTX/build.xml
   labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
   labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app.xml
   labs/jbosstm/trunk/XTS/build.xml
   labs/jbosstm/trunk/XTS/demo/dd/jboss/application.xml
   labs/jbosstm/trunk/XTS/demo/dd/jboss/context-handlers.xml
   labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application.xml
   labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/client-web-app.xml
   labs/jbosstm/trunk/XTS/demo/jboss.properties
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java
   labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java
   labs/jbosstm/trunk/XTS/demo/srcrpc/com/arjuna/xts/nightout/clients/jboss/BasicClient.java
   labs/jbosstm/trunk/XTS/demo/web/index.jsp
   labs/jbosstm/trunk/XTS/demo/xts-build.xml
   labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml
   labs/jbosstm/trunk/XTS/sar/build.xml
   labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java
Log:
added support for OASIS 1.1. WS-COOR/AT/BA over JBossWS 3.0.1 Native 2.0.4 on AS 5.0.0B4 -- fix for JBTM-37

Modified: labs/jbosstm/trunk/XTS/WS-C/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -41,10 +41,14 @@
 
     <property name="build.dir"               value="build"/>
     <property name="dev.src.dir"             value="dev/src"/>
+    <property name="dev.src10.dir"             value="dev/src10"/>
+    <property name="dev.src11.dir"             value="dev/src11"/>
     <property name="dev.dd.dir"              value="dev/dd"/>
     <property name="tests.src.dir"           value="tests/src"/>
     <property name="tests.dd.dir"            value="tests/dd"/>
     <property name="build.dev.classes.dir"   value="${build.dir}/dev/classes"/>
+    <property name="build.dev.classes10.dir"   value="${build.dir}/dev/classes10/classes"/>
+    <property name="build.dev.classes11.dir"   value="${build.dir}/dev/classes11/classes"/>
     <property name="build.dev.lib.dir"       value="${build.dir}/dev/lib"/>
     <property name="build.dev.dd.dir"        value="${build.dir}/dev/dd"/>
     <property name="build.dev.webapps.dir"   value="${build.dir}/dev/webapps"/>
@@ -64,12 +68,12 @@
     <property name="com.arjuna.buildsystem.lib.jars" value="buildsystem.jar"/>
 
     <property name="jta.lib.jars" value="jbossjta.jar"/>
-    <property name="jta.ext.jars" value="jbossts-common.jar commons-logging-1.1.jar"/>
+    <property name="jta.ext.jars" value="jbossts-common.jar commons-logging.jar"/>
     <!--
     <property name="xts.ext.jars" value="stax-api-1.0.jar wstx-asl-2.0.3.jar"/>
     -->
     <property name="xts.ext.jars" value=""/>
-    <property name="xts.ext.compile.jars" value="stax-api-1.0.jar wstx-asl-2.0.3.jar servlet.jar saaj-api.jar"/>
+    <property name="xts.ext.compile.jars" value="jaxb-api.jar jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jbossws-client.jar jboss-saaj.jar"/>
 
     <property name="tests.libs" value="junit.jar"/>
 
@@ -77,10 +81,9 @@
     <property name="javac.optimize"          value="off"/>
 
     <path id="lib.ext.path">
-        <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars} ${jta.ext.compile.jars}"/>
+        <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
         <fileset dir="${com.arjuna.xts.ext}" includes="${xts.ext.jars} ${xts.ext.compile.jars}"/>
         <fileset dir="${com.arjuna.jta.install.lib}" includes="${jta.lib.jars}"/>
-        <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
     </path>
 
     <path id="tests.lib.path">
@@ -115,6 +118,8 @@
     <target name="init-dir">
         <mkdir dir="${build.dir}"/>
         <mkdir dir="${build.dev.classes.dir}"/>
+        <mkdir dir="${build.dev.classes10.dir}"/>
+        <mkdir dir="${build.dev.classes11.dir}"/>
         <mkdir dir="${build.dev.lib.dir}"/>
         <mkdir dir="${build.dev.dd.dir}"/>
         <mkdir dir="${build.dev.webapps.dir}"/>
@@ -124,23 +129,50 @@
         <mkdir dir="${build.tests.webapps.dir}"/>
     </target>
 
-    <target name="dev-compile" depends="init">
+    <target name="dev-compile-generic" depends="init">
         <javac destdir="${build.dev.classes.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
             <classpath>
                 <path refid="lib.ext.path"/>
             </classpath>
             <src path="${dev.src.dir}"/>
         </javac>
+    </target>
+
+    <target name="dev-compile10" depends="dev-compile-generic">
+        <javac destdir="${build.dev.classes10.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
+            <classpath>
+                <path>
+                  <pathelement path="${build.dev.classes.dir}"/>
+                </path>
+                <path refid="lib.ext.path"/>
+            </classpath>
+            <src path="${dev.src10.dir}"/>
+        </javac>
     	<copy todir="${build.dev.classes.dir}">
-    		<fileset dir="${dev.src.dir}" excludes="**/*.java"/>
+    		<fileset dir="${dev.src10.dir}" excludes="**/*.java"/>
     	</copy>
     </target>
 
+    <target name="dev-compile11" depends="dev-compile-generic">
+        <javac destdir="${build.dev.classes11.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
+            <classpath>
+                <path>
+                  <pathelement path="${build.dev.classes.dir}"/>
+                </path>
+                <path refid="lib.ext.path"/>
+            </classpath>
+            <src path="${dev.src11.dir}"/>
+        </javac>
+    </target>
+
+    <target name="dev-compile" depends="dev-compile11, dev-compile10"/>
+
     <target name="dev-resourcebundle">
         <echo message="Generating WS-C Bundle"/>
 
         <classpath-builder filename="${com.arjuna.mwlabs.classpathbuilderfilename}" inproperty="build.classpath"/>
 
+        <!--
         <javadoc    sourcepath="${dev.src.dir}"
                     packagenames="com.arjuna.*"
                     failonerror="yes"
@@ -156,15 +188,67 @@
                 <param name="-resourcebundle" value="${com.arjuna.mwlabs.wsc.resourcebundle}"/>
              </doclet>
         </javadoc>
+        -->
+        <javadoc    packagenames="com.arjuna.*"
+                    failonerror="yes"
+                    private="yes"
+                    defaultexcludes="yes"
+                    classpath="${build.classpath}">
+
+            <packageset dir="${dev.src.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
+            <packageset dir="${dev.src10.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
+            <packageset dir="${dev.src11.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
+             <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
+                <path>
+                    <pathelement path="${com.arjuna.buildsystem.classpath}"/>
+                </path>
+                <param name="-basedir" value="${basedir}/${build.dev.classes.dir}"/>
+                <param name="-resourcebundle" value="${com.arjuna.mwlabs.wsc.resourcebundle}"/>
+             </doclet>
+        </javadoc>
     </target>
 
     <target name="dev-jars" depends="dev-compile, dev-resourcebundle" >
+        <!-- wsdl files for services - loaded as /WEB-INF/wsdl/... -->
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wscoor-activation-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wscoor-activation-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wscoor-registration-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wscoor-registration-binding.wsdl"/>
+
+        <!-- wsdl files for clients - loaded as <ClientClassDir>/wsdl/... -->
+        <mkdir dir="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wscoor-activation-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/wsdl/wscoor-activation-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wscoor-registration-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/wsdl/wscoor-registration-binding.wsdl"/>
         <jar jarfile="${build.dev.lib.dir}/ws-c.jar">
             <fileset dir="${build.dev.classes.dir}"/>
+            <!-- should not be needed now XTS is delivered as a sar
             <manifest>
                 <attribute name="Class-Path" value="${jta.ext.jars} ${xts.ext.jars} ${jta.lib.jars} ${jta.ext.jars}"/>
             </manifest>
+            -->
         </jar>
+        <jar jarfile="${build.dev.lib.dir}/ws-c10.jar">
+            <fileset dir="${build.dev.classes10.dir}"/>
+            <manifest>
+                <attribute name="Class-Path" value="ws-c.jar"/>
+            </manifest>
+        </jar>
+        <jar jarfile="${build.dev.lib.dir}/ws-c11.jar">
+            <fileset dir="${build.dev.classes11.dir}">
+                <exclude name="com/arjuna/webservices11/wscoor/sei/**"/>
+                <exclude name="handlers.xml"/>
+            </fileset>
+            <manifest>
+                <attribute name="Class-Path" value="ws-c.jar"/>
+            </manifest>
+        </jar>
     </target>
 
     <target name="dev-webapps" depends="dev-jars" >
@@ -174,17 +258,32 @@
                 <filter token="port" value="${port}"/>
             </filterset>
         </copy>
-        <war warfile="${build.dev.webapps.dir}/ws-c.war" webxml="${build.dev.dd.dir}/web-app.xml">
+        <copy file="${dev.dd.dir}/ws-c11_web-app.xml" tofile="${build.dev.dd.dir}/web-app11.xml">
+            <filterset>
+                <filter token="hostname" value="${hostname}"/>
+                <filter token="port" value="${port}"/>
+            </filterset>
+        </copy>
+        <copy file="${dev.dd.dir}/ws-c_handlers.xml" tofile="${build.dev.classes11.dir}/handlers.xml"/>
+        <war warfile="${build.dev.webapps.dir}/ws-c10.war" webxml="${build.dev.dd.dir}/web-app.xml">
             <manifest>
-                <attribute name="Class-Path" value="ws-c.jar"/>
+                <attribute name="Class-Path" value="ws-c10.jar"/>
             </manifest>
         </war>
+        <war warfile="${build.dev.webapps.dir}/ws-c11.war" webxml="${build.dev.dd.dir}/web-app11.xml">
+            <webinf dir="${build.dir}/dev/classes11" includes="classes/com/arjuna/webservices11/wscoor/sei/* classes/handlers.xml"/>
+            <webinf dir="${build.dev.dd.dir}" includes="wsdl/**"/>
+            <manifest>
+                <attribute name="Class-Path" value="ws-c11.jar"/>
+            </manifest>
+        </war>
     </target>
 
     <target name="tests-compile" depends="dev-webapps">
         <javac destdir="${build.tests.classes.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
             <classpath>
                 <pathelement path="${build.dev.lib.dir}/ws-c.jar"/>
+                <pathelement path="${build.dev.lib.dir}/ws-c10.jar"/>
                 <path refid="tests.lib.path"/>
                 <path refid="lib.ext.path"/>
             </classpath>
@@ -201,7 +300,7 @@
         </copy>
         <war warfile="${build.tests.webapps.dir}/ws-c-tests.war" webxml="${build.tests.dd.dir}/web-app.xml">
             <manifest>
-                <attribute name="Class-Path" value="ws-c.jar ${tests.libs}"/>
+                <attribute name="Class-Path" value="ws-c10.jar ws-c.jar ${tests.libs}"/>
             </manifest>
             <classes dir="${build.tests.classes.dir}"/>
         </war>
@@ -209,7 +308,7 @@
             <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
             <fileset dir="${com.arjuna.xts.ext}" includes="${xts.ext.jars} ${tests.libs}"/>
             <fileset dir="${com.arjuna.jta.install.lib}" includes="${jta.lib.jars}"/>
-            <fileset dir="${build.dev.lib.dir}" includes="ws-c.jar"/>
+            <fileset dir="${build.dev.lib.dir}" includes="ws-c10.jar ws-c.jar"/>
             <fileset dir="${build.tests.webapps.dir}" includes="ws-c-tests.war"/>
         </ear>
     </target>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c11_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,68 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>WS-Coordination 1.1 Services</display-name>
+
+    <description>WS-Coordination 1.1 Services</description>
+
+    <!-- base URL for location of Coordination 1.1 services -->
+    <context-param>
+        <param-name>BaseURI</param-name>
+	<param-value>http://@hostname@:@port@/ws-c11</param-value>
+    </context-param>
+    <!-- Initialise WS Coord 1.1 services -->
+    <listener>
+        <listener-class>com.arjuna.webservices11.wscoor.server.ActivationCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wscoor.server.RegistrationCoordinatorInitialisation</listener-class>
+    </listener>
+
+    <!-- Initialise WS-C 1.1  -->
+    <listener>
+        <listener-class>com.arjuna.wsc11.messaging.deploy.CoordinationInitialisation</listener-class>
+    </listener>
+
+    <!-- Define WSCOOR 1.1 JaxWS Server Endpoints -->
+    <servlet>
+      <servlet-name>Activation Service</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wscoor.sei.ActivationPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Registration Service</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wscoor.sei.RegistrationPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- Define WSCOOR 1.1 JaxWS Server Endpoint Mappings -->
+    <servlet-mapping>
+      <servlet-name>Activation Service</servlet-name>
+      <url-pattern>/ActivationService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Registration Service</servlet-name>
+      <url-pattern>/RegistrationService</url-pattern>
+    </servlet-mapping>
+</web-app>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_handlers.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_handlers.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_handlers.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2007, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags. 
+  See the copyright.txt in the distribution for a full listing 
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2007,
+  @author JBoss Inc.
+-->
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee" 
+xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+    <handler-chain>
+	<handler>
+		<handler-name>Instance Identifier Handler</handler-name>
+		<handler-class>com.arjuna.webservices11.wsarj.handler.InstanceIdentifierInHandler</handler-class>
+	</handler>
+	<handler>
+		<handler-name>WS Addressing Server Handler</handler-name>
+		<handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</handler-class>
+	</handler>
+    </handler-chain>
+</handler-chains>

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/ws-c_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,96 +1,99 @@
-<!--
-  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 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) 2005-2006,
-  @author JBoss Inc.
--->
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
 
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
     <display-name>Arjuna Web Services and WS-Coordination</display-name>
 
     <description>Arjuna Web Services and WS-Coordination</description>
-
-    <!--  Initialise the Task Manager -->
-    <context-param>
-        <param-name>TaskManager.minWorkerCount</param-name>
-        <param-value>0</param-value>
-    </context-param>
-    <context-param>
-        <param-name>TaskManager.maxWorkerCount</param-name>
-        <param-value>10</param-value>
-    </context-param>
-    <listener>
-        <listener-class>com.arjuna.services.framework.admin.TaskManagerInitialisation</listener-class>
-    </listener>
-    
-    <!-- Initialise WS-C services -->
-    <listener>
-        <listener-class>com.arjuna.webservices.wscoor.server.ActivationCoordinatorInitialisation</listener-class>
-    </listener>
-    <listener>
-        <listener-class>com.arjuna.webservices.wscoor.server.ActivationRequesterInitialisation</listener-class>
-    </listener>
-    <listener>
-        <listener-class>com.arjuna.webservices.wscoor.server.RegistrationCoordinatorInitialisation</listener-class>
-    </listener>
-    <listener>
-        <listener-class>com.arjuna.webservices.wscoor.server.RegistrationRequesterInitialisation</listener-class>
-    </listener>
-    
-    <!-- Initialise WS-C  -->
-    <listener>
-        <listener-class>com.arjuna.wsc.messaging.deploy.CoordinationInitialisation</listener-class>
-    </listener>
-
-    <!--  Initialise the HTTP Client -->
-    <listener>
-        <listener-class>com.arjuna.webservices.transport.http.HttpClientInitialisation</listener-class>
-    </listener>
-    
+
+    <!--  Initialise the Task Manager -->
+    <!-- overridden now - this is done in the sar on behalf of either WS-C 1.0 or 1.1 or both -->
+    <!--
+    <context-param>
+        <param-name>TaskManager.minWorkerCount</param-name>
+        <param-value>0</param-value>
+    </context-param>
+    <context-param>
+        <param-name>TaskManager.maxWorkerCount</param-name>
+        <param-value>10</param-value>
+    </context-param>
+    <listener>
+        <listener-class>com.arjuna.services.framework.admin.TaskManagerInitialisation</listener-class>
+    </listener>
+    -->
+
+    <!-- Initialise WS-C services -->
+    <listener>
+        <listener-class>com.arjuna.webservices.wscoor.server.ActivationCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices.wscoor.server.ActivationRequesterInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices.wscoor.server.RegistrationCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices.wscoor.server.RegistrationRequesterInitialisation</listener-class>
+    </listener>
+    
+    <!-- Initialise WS-C  -->
+    <listener>
+        <listener-class>com.arjuna.wsc.messaging.deploy.CoordinationInitialisation</listener-class>
+    </listener>
+
+    <!--  Initialise the HTTP Client -->
+    <listener>
+        <listener-class>com.arjuna.webservices.transport.http.HttpClientInitialisation</listener-class>
+    </listener>
+    
     <servlet>
         <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
-        <servlet-class>com.arjuna.webservices.transport.http.HttpServiceMultiplexorServlet</servlet-class>
-        <!--
-          The BaseHttpURI and BaseHttpsURI parameters specify the default values
-          used to generate the service URIs without reference to an incoming
-          request.
+        <servlet-class>com.arjuna.webservices.transport.http.HttpServiceMultiplexorServlet</servlet-class>
+        <!--
+          The BaseHttpURI and BaseHttpsURI parameters specify the default values
+          used to generate the service URIs without reference to an incoming
+          request.
          -->
         <init-param>
             <param-name>BaseHttpURI</param-name>
-            <param-value>http://@hostname@:@port@/xts/soap/</param-value>
-        </init-param>
+            <param-value>http://@hostname@:@port@/ws-c10/soap/</param-value>
+        </init-param>
         <!--
-        <init-param>
-            <param-name>BaseHttpsURI</param-name>
-            <param-value>https://@hostname@:@port@/xts/soap/</param-value>
-        </init-param>
-        <init-param>
-            <param-name>LogPackets</param-name>
-            <param-value>true</param-value>
-        </init-param>
+        <init-param>
+            <param-name>BaseHttpsURI</param-name>
+            <param-value>https://@hostname@:@port@/xts/soap/</param-value>
+        </init-param>
+        <init-param>
+            <param-name>LogPackets</param-name>
+            <param-value>true</param-value>
+        </init-param>
         -->
-        <load-on-startup>1</load-on-startup>
+        <load-on-startup>1</load-on-startup>
     </servlet>
 
 	<!-- servlet mappings -->
     <servlet-mapping>
-        <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
+        <servlet-name>HTTP SOAP Service Multiplexor Servlet</servlet-name>
         <url-pattern>/soap/*</url-pattern>
     </servlet-mapping>
 </web-app>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/build.sh
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/build.sh	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/build.sh	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,43 @@
+#
+#
+#
+
+if [ ! -d tmp ] ; then
+    mkdir tmp
+fi
+
+if [ ! -d tmp/classes ] ; then
+    mkdir tmp/classes
+fi
+
+if [ ! -d tmp/src ] ; then
+    mkdir tmp/src
+fi
+
+# delete old generated versions -- any changes should be made to a copy!
+
+rm -rf tmp/classes/* tmp/src/*
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /wsdl/wscoor.wsdl -o tmp/classes -s tmp/src -k wsdl/wscoor-binding.wsdl
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /home/adinn/tmp/wsdl/wscoor.wsdl -o tmp/classes -s tmp/src -k wsdl/wscoor-binding.wsdl
+
+# $GF_HOME/bin/wsimport -verbose -keep -wsdllocation /home/adinn/tmp/wsdl/wscoor.wsdl -d tmp/classes -s tmp/src wsdl/wscoor-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wscoor-activation-binding.wsdl -d tmp/classes -s tmp/src -target 2.1 wsdl/wscoor-activation-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wscoor-registration-binding.wsdl -d tmp/classes -s tmp/src -target 2.1 wsdl/wscoor-registration-binding.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w wsdl/wscoor-activation-binding.wsdl -o tmp/classes -s tmp/src -t 2.0 wsdl/wscoor-activation-binding.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w wsdl/wscoor-registration-binding.wsdl -o tmp/classes -s tmp/src -t 2.0 wsdl/wscoor-registration-binding.wsdl
+
+# we need to patch the resource lookup used to provide a jar base URL
+# for the wsdl location supplied above wsimport generates
+# e.g. 'qualified.path.ClassName.class.getResource(".")' to locate a
+# URL for the jar dir containing ClassName.class. But the EJB class
+# loader returns null for this (even though it returns true for
+# hasEntry!). If we patch the generated code to specify
+# 'qualified.path.ClassName.class.getResource("")' it works ok.
+
+sed -i -e 's/ActivationService.class.getResource(".")/ActivationService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationService.java
+sed -i -e 's/RegistrationService.class.getResource(".")/RegistrationService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationService.java

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-activation-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-activation-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-activation-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/wscoor.wsdl" />
+
+  <wsdl:binding name="Activation_SOAPBinding" type="wscoor:ActivationPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CreateCoordinationContextOperation">
+            <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext"/>
+	    <!-- glassfish will eat this but JBoss uses com.ibm.wsdl code which
+		 decides that the name makes it a different input/ouput to the
+		 one specified in the port declaration which has no name
+            <wsdl:input name="wscoor:CreateCoordinationContext" message="wscoor:CreateCoordinationContext">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="wscoor:CreateCoordinationContextResponse" message="wscoor:CreateCoordinationContextResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+	    -->
+            <wsdl:input message="wscoor:CreateCoordinationContext">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output message="wscoor:CreateCoordinationContextResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="ActivationService">
+     <wsdl:port binding="wscoor:Activation_SOAPBinding" name="ActivationPortType">
+       <wsaw:UsingAddressing required="true"/>
+      <soap:address location="http://localhost:9000/ws-c11/ActivationService"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/wscoor.wsdl" />
+
+  <wsdl:binding name="Activation_SOAPBinding" type="wscoor:ActivationPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CreateCoordinationContextOperation">
+            <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext"/>
+            <wsdl:input name="wscoor:CreateCoordinationContext" message="wscoor:CreateCoordinationContext">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="wscoor:CreateCoordinationContextResponse" message="wscoor:CreateCoordinationContextResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="Registration_SOAPBinding" type="wscoor:RegistrationPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="RegisterOperation">
+            <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register"/>
+            <wsdl:input name="wscoor:Register" message="wscoor:Register">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="wscoor:RegisterResponse" message="wscoor:RegisterResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="WSCOOR_SOAPService">
+     <wsdl:port binding="wscoor:Activation_SOAPBinding" name="ActivationPortType">
+       <wsaw:UsingAddressing required="true"/>
+      <soap:address location="http://localhost:9000/ws-c11/ActivationSoapPort"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wscoor:Registration_SOAPBinding" name="RegistrationPortType">
+      <soap:address location="http://localhost:9000/ws-c11/RegistrationSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-registration-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-registration-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor-registration-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/wscoor.wsdl" />
+
+  <wsdl:binding name="Registration_SOAPBinding" type="wscoor:RegistrationPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="RegisterOperation">
+            <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register"/>
+	    <!-- glassfish will eat this but JBoss uses com.ibm.wsdl code which
+		 decides that the name makes it a different input/ouput to the
+		 one specified in the port declaration which has no name
+            <wsdl:input name="wscoor:Register" message="wscoor:Register">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="wscoor:RegisterResponse" message="wscoor:RegisterResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+	    -->
+            <wsdl:input message="wscoor:Register">
+                <soap:body use="literal"/>
+            </wsdl:input>
+            <wsdl:output message="wscoor:RegisterResponse">
+                <soap:body use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="RegistrationService">
+    <wsdl:port binding="wscoor:Registration_SOAPBinding" name="RegistrationPortType">
+      <soap:address location="http://localhost:9000/ws-c11/RegistrationService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/wsdl/wscoor.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS President.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS President.
+Copyright OASIS Open 2006. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself must not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+--> 
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06">
+        <wsdl:types>
+          <xs:schema>
+            <xs:import
+                namespace='http://www.w3.org/2005/08/addressing'
+                schemaLocation='http://www.w3.org/2006/03/addressing/ws-addr.xsd' />
+            <xs:import
+                namespace='http://docs.oasis-open.org/ws-tx/wscoor/2006/06'
+                schemaLocation='http://docs.oasis-open.org/ws-tx/wscoor/2006/06/wscoor.xsd' />
+          </xs:schema>
+        </wsdl:types> 
+  <!-- Messages -->
+  <wsdl:message name="CreateCoordinationContext">
+    <wsdl:part name="parameters" element="wscoor:CreateCoordinationContext"/>
+  </wsdl:message>
+  <wsdl:message name="CreateCoordinationContextResponse">
+    <wsdl:part name="parameters" element="wscoor:CreateCoordinationContextResponse"/>
+  </wsdl:message>
+  <wsdl:message name="Register">
+    <wsdl:part name="parameters" element="wscoor:Register"/>
+  </wsdl:message>
+  <wsdl:message name="RegisterResponse">
+    <wsdl:part name="parameters" element="wscoor:RegisterResponse"/>
+  </wsdl:message>
+  <!-- Port Types -->
+  <wsdl:portType name="ActivationPortType">
+    <wsdl:operation name="CreateCoordinationContextOperation">
+      <wsdl:input message="wscoor:CreateCoordinationContext"
+        wsa:Action="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext"/>
+      <wsdl:output message="wscoor:CreateCoordinationContextResponse"
+        wsa:Action="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContextResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="RegistrationPortType">
+    <wsdl:operation name="RegisterOperation">
+      <wsdl:input message="wscoor:Register"
+        wsa:Action="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register"/>
+      <wsdl:output message="wscoor:RegisterResponse"
+        wsa:Action="http://docs.oasis-open.org/ws-tx/wscoor/2006/06/RegisterResponse"/>
+    </wsdl:operation>
+  </wsdl:portType>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/ws-addr.xsd
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/ws-addr.xsd	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/ws-addr.xsd	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
+<!--
+    W3C XML Schema defined in the Web Services Addressing 1.0 specification
+    http://www.w3.org/TR/ws-addr-core
+
+   Copyright © 2005 World Wide Web Consortium,
+
+   (Massachusetts Institute of Technology, European Research Consortium for
+   Informatics and Mathematics, Keio University). All Rights Reserved. This
+   work is distributed under the W3C® Software License [1] in the hope that
+   it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+   [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+   $Id: ws-addr.xsd,v 1.1 2006/03/21 10:19:47 hugo Exp $
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
+	
+	<!-- Constructs from the WS-Addressing Core -->
+
+	<xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
+	<xs:complexType name="EndpointReferenceType" mixed="false">
+		<xs:sequence>
+			<xs:element name="Address" type="tns:AttributedURIType"/>
+			<xs:element ref="tns:ReferenceParameters" minOccurs="0"/>
+
+			<xs:element ref="tns:Metadata" minOccurs="0"/>
+			<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+	<xs:element name="ReferenceParameters" type="tns:ReferenceParametersType"/>
+	<xs:complexType name="ReferenceParametersType" mixed="false">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+	<xs:element name="Metadata" type="tns:MetadataType"/>
+	<xs:complexType name="MetadataType" mixed="false">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+
+	</xs:complexType>
+	
+	<xs:element name="MessageID" type="tns:AttributedURIType"/>
+	<xs:element name="RelatesTo" type="tns:RelatesToType"/>
+	<xs:complexType name="RelatesToType" mixed="false">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www.w3.org/2005/08/addressing/reply"/>
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:simpleType name="RelationshipTypeOpenEnum">
+		<xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
+	</xs:simpleType>
+	
+	<xs:simpleType name="RelationshipType">
+		<xs:restriction base="xs:anyURI">
+			<xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
+		</xs:restriction>
+
+	</xs:simpleType>
+	
+	<xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
+	<xs:element name="From" type="tns:EndpointReferenceType"/>
+	<xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
+	<xs:element name="To" type="tns:AttributedURIType"/>
+	<xs:element name="Action" type="tns:AttributedURIType"/>
+
+	<xs:complexType name="AttributedURIType" mixed="false">
+		<xs:simpleContent>
+
+			<xs:extension base="xs:anyURI">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<!-- Constructs from the WS-Addressing SOAP binding -->
+
+	<xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
+	
+	<xs:simpleType name="FaultCodesOpenEnumType">
+
+		<xs:union memberTypes="tns:FaultCodesType xs:QName"/>
+	</xs:simpleType>
+	
+	<xs:simpleType name="FaultCodesType">
+		<xs:restriction base="xs:QName">
+			<xs:enumeration value="tns:InvalidAddressingHeader"/>
+			<xs:enumeration value="tns:InvalidAddress"/>
+			<xs:enumeration value="tns:InvalidEPR"/>
+			<xs:enumeration value="tns:InvalidCardinality"/>
+			<xs:enumeration value="tns:MissingAddressInEPR"/>
+
+			<xs:enumeration value="tns:DuplicateMessageID"/>
+			<xs:enumeration value="tns:ActionMismatch"/>
+			<xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
+			<xs:enumeration value="tns:DestinationUnreachable"/>
+			<xs:enumeration value="tns:ActionNotSupported"/>
+			<xs:enumeration value="tns:EndpointUnavailable"/>
+		</xs:restriction>
+	</xs:simpleType>
+	
+	<xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
+
+	<xs:complexType name="AttributedUnsignedLongType" mixed="false">
+		<xs:simpleContent>
+			<xs:extension base="xs:unsignedLong">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
+	<xs:complexType name="AttributedQNameType" mixed="false">
+
+		<xs:simpleContent>
+			<xs:extension base="xs:QName">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
+	
+	<xs:element name="ProblemAction" type="tns:ProblemActionType"/>
+	<xs:complexType name="ProblemActionType" mixed="false">
+
+		<xs:sequence>
+			<xs:element ref="tns:Action" minOccurs="0"/>
+			<xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+</xs:schema>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/wscoor.xsd
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/wscoor.xsd	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/dd/wscoor1.1/xsd/wscoor.xsd	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS President.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS President.
+Copyright OASIS Open 2006. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself must not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xsd:schema targetNamespace="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wscoor="http://docs.oasis-open.org/ws-tx/wscoor/2006/06" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+  <xsd:import namespace="http://www.w3.org/2005/08/addressing" schemaLocation="http://www.w3.org/2006/03/addressing/ws-addr.xsd"/>
+  <xsd:element name="Expires">
+    <xsd:complexType>
+      <xsd:simpleContent>
+        <xsd:extension base="xsd:unsignedInt">
+          <xsd:anyAttribute namespace="##other" />
+        </xsd:extension>
+      </xsd:simpleContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:complexType name="CoordinationContextType">
+    <xsd:sequence>
+      <xsd:element name="Identifier">
+        <xsd:complexType>
+          <xsd:simpleContent>
+            <xsd:extension base="xsd:anyURI">
+              <xsd:anyAttribute namespace="##other" />
+            </xsd:extension>
+          </xsd:simpleContent>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element ref="wscoor:Expires" minOccurs="0" />
+      <xsd:element name="CoordinationType" type="xsd:anyURI" />
+      <xsd:element name="RegistrationService" type="wsa:EndpointReferenceType" />
+    </xsd:sequence>
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:complexType>
+  <xsd:element name="CoordinationContext">
+    <xsd:complexType>
+      <xsd:complexContent>
+        <xsd:extension base="wscoor:CoordinationContextType">
+          <xsd:sequence>
+            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+          </xsd:sequence>
+        </xsd:extension>
+      </xsd:complexContent>
+    </xsd:complexType>
+  </xsd:element>
+  <xsd:complexType name="CreateCoordinationContextType">
+    <xsd:sequence>
+      <xsd:element ref="wscoor:Expires" minOccurs="0" />
+      <xsd:element name="CurrentContext" minOccurs="0">
+        <xsd:complexType>
+          <xsd:complexContent>
+            <xsd:extension base="wscoor:CoordinationContextType">
+              <xsd:sequence>
+                <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+              </xsd:sequence>
+            </xsd:extension>
+          </xsd:complexContent>
+        </xsd:complexType>
+      </xsd:element>
+      <xsd:element name="CoordinationType" type="xsd:anyURI" />
+      <xsd:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xsd:sequence>
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:complexType>
+  <xsd:element name="CreateCoordinationContext" type="wscoor:CreateCoordinationContextType" />
+  <xsd:complexType name="CreateCoordinationContextResponseType">
+    <xsd:sequence>
+      <xsd:element ref="wscoor:CoordinationContext" />
+      <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xsd:sequence>
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:complexType>
+  <xsd:element name="CreateCoordinationContextResponse" type="wscoor:CreateCoordinationContextResponseType" />
+  <xsd:complexType name="RegisterType">
+    <xsd:sequence>
+      <xsd:element name="ProtocolIdentifier" type="xsd:anyURI" />
+      <xsd:element name="ParticipantProtocolService" type="wsa:EndpointReferenceType" />
+      <xsd:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xsd:sequence>
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:complexType>
+  <xsd:element name="Register" type="wscoor:RegisterType" />
+  <xsd:complexType name="RegisterResponseType">
+    <xsd:sequence>
+      <xsd:element name="CoordinatorProtocolService" type="wsa:EndpointReferenceType" />
+      <xsd:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+    </xsd:sequence>
+    <xsd:anyAttribute namespace="##other" processContents="lax" />
+  </xsd:complexType>
+  <xsd:element name="RegisterResponse" type="wscoor:RegisterResponseType" />
+  <xsd:simpleType name="ErrorCodes">
+    <xsd:restriction base="xsd:QName">
+      <xsd:enumeration value="wscoor:InvalidParameters" />
+      <xsd:enumeration value="wscoor:InvalidProtocol" />
+      <xsd:enumeration value="wscoor:InvalidState" />
+      <xsd:enumeration value="wscoor:CannotCreateContext" />
+      <xsd:enumeration value="wscoor:CannotRegisterParticipant" />
+    </xsd:restriction>
+  </xsd:simpleType>
+</xsd:schema>

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/services/framework/startup/Sequencer.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,229 @@
+package com.arjuna.services.framework.startup;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * A manager which allows initializaton callabcks for a suite of related web apps to be registered and subsequently
+ * run in a fixed order, irrespective of the order in which the application server initializes the web apps.
+ *
+ * Sequencer maintains two lists of independently managed callbacks, one for the WSCOOR 1.0 web app suite and one
+ * for the WSCOOR 1.1 web app suite. When registering a callback listeners or servlets for a given web app supply a
+ * sequence id and a web app id to identify i) the required sequence and ii) the entry in the sequence at which the
+ * callback should be stored. If a web app registers multiple callbacks they are stored in the sequence entry as a
+ * list in registration order. Once a web app has registered all its callbacks it closes the relevant entry. When
+ * all entries in a sequence have been closed the entries are traversed in order and the callbacks in each entry are
+ * triggered, thus ensuring that callbacks for web apps with lower sequence indices complete before callbacks with
+ * higher indices are called.
+ *
+ * User: adinn
+ * Date: Nov 30, 2007
+ * Time: 4:05:13 PM
+ */
+public class Sequencer {
+    // public API
+
+    /*
+     * indices for the independent startup sequences which we manage
+     */
+
+    /**
+     *  index of startup sequence used for serialization of WSCOOR 1.0 initialization callbacks
+     */
+    public static final int SEQUENCE_WSCOOR10 = 0;
+
+    /**
+     *  index of startup sequence used for serialization of WSCOOR 1.1 initialization callbacks
+     */
+    public static final int SEQUENCE_WSCOOR11 = SEQUENCE_WSCOOR10 + 1;
+
+    /**
+     *  count of independent startup sequences.
+     */
+    public static final int SEQUENCE_MAX = SEQUENCE_WSCOOR11 + 1;
+
+    /*
+     * indices for sequence of web apps we need to ensure start in the correct order
+     */
+
+    /**
+     * index of WS-C web app which initialises first in 1.0
+     */
+    public static final int WEBAPP_WSC10 = 0;
+
+    /**
+     * index of WS-T web app which initialises second in 1.0
+     */
+    public static final int WEBAPP_WST10 = WEBAPP_WSC10 + 1;
+
+    /**
+     * index of WSCF web app which intiialises third in 1.0
+     */
+    public static final int WEBAPP_WSCF10 = WEBAPP_WST10 + 1;
+
+    /**
+     * index of WSTX web app which initialises last in 1.0
+     */
+    public static final int WEBAPP_WSTX10 = WEBAPP_WSCF10 + 1;
+
+    /**
+     * there are four startup apps in the 1.0 sequence
+     */
+    public static final int WEBAPP_MAX10 = WEBAPP_WSTX10 + 1;
+
+    /**
+     * index of WS-C web app which initialises first in 1.1
+     */
+    public static final int WEBAPP_WSC11 = 0;
+
+    /**
+     * index of WS-T web app which initialises second in 1.1
+     */
+    public static final int WEBAPP_WST11 = WEBAPP_WSC11 + 1;
+
+    /**
+     * index of WSCF web app which intiialises third in 1.1
+     */
+    public static final int WEBAPP_WSCF11 = WEBAPP_WST11 + 1;
+
+    /**
+     * index of WSTX web app which intiialises fourth in 1.1
+     */
+    public static final int WEBAPP_WSTX11 = WEBAPP_WSCF11 + 1;
+
+    /**
+     * there are three startup apps in the 1.1 sequence
+     */
+    public static final int WEBAPP_MAX11 = WEBAPP_WSTX11 + 1;
+
+    /**
+     * notify end of callback registration for a web app associated with a given sequence
+     * @param webapp
+     */
+
+    public static final void close(int sequence, int webapp)
+    {
+        SEQUENCERS[sequence].close(webapp);
+    }
+
+    /**
+     * a callback class specialised by client web apps to execute startup code
+     */
+    public static abstract class Callback
+    {
+        /**
+         * construct a callback associated with a web app in a given startup sequence and automatically register it
+         * for subsequent execution
+         * @param sequence the sequence in which the web app is contained either WSCOOR_1_0 or WSCOOR_1_1
+         * @param webapp the web app with which this callback is associated
+         */
+        public Callback(int sequence, int webapp)
+        {
+            register(this, sequence, webapp);
+        }
+
+        /**
+         * a callback method which is invoked invoked per callback in registration order per web app in web app
+         * order per sequence as soon as all callback lists in the sequence have been closed
+         */
+        public abstract void run();
+    }
+
+    // private implementation
+
+    /**
+     * a global list of all startup sequences
+     */
+    private static final Sequencer[] SEQUENCERS =
+            {
+                    new Sequencer(WEBAPP_MAX10),
+                    new Sequencer(WEBAPP_MAX11)
+            };
+
+    /**
+     * method called by the Callback constructor to append a startup callback to the list for a web
+     * app in the appropriate startup sequence
+     * @param callback a callback to add to the list for the web app
+     * @param sequence the sequence in which the web app is contained either WSCOOR_1_0 or WSCOOR_1_1
+     * @param webapp the web app with which this callback is associated
+     */
+
+    private static final void register(Callback callback, int sequence, int webapp)
+    {
+        SEQUENCERS[sequence].register(callback, webapp);
+    }
+
+    /**
+     * each sequence contians an array of lists to hold callbacks registered per web app
+     */
+    private List<Callback>[] callbacks;
+
+    /**
+     * each sequence contains an array of flags per web app initially false and set to true when a web app has
+     * registered all its callbacks and called close
+     */
+    private boolean[] closed;
+
+    /**
+     * counter incremented each time a callback list is closed. callback processing is triggered when this reaches the
+     * sequence size count
+     */
+    private int closedCount;
+
+    /**
+     * count which sizes the callbacks list and closed array.
+     */
+    private int sequenceSize;
+
+    /**
+     * insert a callback into the list for a given web app associated with this sequence
+     * @param callback the callback to be registerd
+     * @param webapp the web app with which the callback is associated
+     */
+    private final void register(Callback callback, int webapp)
+    {
+        callbacks[webapp].add(callback);
+    }
+
+    /**
+     * close the callback list associated with a given web app in this sequence and, if this is the last unclosed
+     * list, trigger execution of all callbacks in sequence order
+     * @param webapp the web app whose callback list is to be closed
+     */
+    private final void close(int webapp)
+    {
+        closed[webapp] = true;
+        closedCount++;
+        if (closedCount == sequenceSize) {
+            runCallbacks();
+        }
+    }
+
+    private void runCallbacks()
+    {
+        for (int i = 0; i < sequenceSize; i++) {
+            Iterator<Callback> iter = callbacks[i].iterator();
+            while (iter.hasNext()) {
+                Callback cb = iter.next();
+                cb.run();
+            }
+        }
+    }
+
+    /**
+     * construct a Sequencer to manage registration and execution of callbacks associated with an ordered sequence
+     * of web apps
+     * @param sequenceSize count of the number of web apps for which callbacks are to be registered
+     */
+    private Sequencer(int sequenceSize)
+    {
+        this.sequenceSize = sequenceSize;
+        callbacks = new ArrayList[sequenceSize];
+        for (int i = 0; i < sequenceSize; i++) {
+            callbacks[i] = new ArrayList<Callback>();
+        }
+        closed = new boolean[sequenceSize];
+        closedCount = 0;
+    }
+}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/BodyHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/BodyHandler.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/BodyHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,49 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.soap.SoapDetails;
-
-/**
- * Interface for body handlers.
- * @author kevin
- */
-public interface BodyHandler
-{
-    /**
-     * Handle the body element.
-     * @param soapDetails The SOAP details.
-     * @param context The current message context.
-     * @param responseContext The response message context.
-     * @param action The transport SOAP action.
-     * @param in The current stream reader.
-     * @throws XMLStreamException for parsing errors.
-     * @throws SoapFault for processing errors.
-     * @return The response elements or null if one way.
-     */
-    public SoapBody invoke(final SoapDetails soapDetails,
-        final MessageContext context, final MessageContext responseContext,
-        final String action, final XMLStreamReader in)
-        throws XMLStreamException, SoapFault ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HandlerRegistry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HandlerRegistry.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HandlerRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,174 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-
-import com.arjuna.webservices.util.InsertionOrderSet;
-
-/**
- * The handler registry for a service.
- * @author kevin
- */
-public class HandlerRegistry
-{
-    /**
-     * The header handlers for the service.
-     */
-    private final Map headerHandlers = new HashMap() ;
-    /**
-     * The unmodifiable version of the header handlers.
-     */
-    private final Map unmodifiableHeaderHandlers = Collections.unmodifiableMap(headerHandlers) ;
-    /**
-     * The body handlers for the service.
-     */
-    private final Map bodyHandlers = new HashMap() ;
-    /**
-     * The handler for SOAP faults.
-     */
-    private BodyHandler faultHandler ;
-    /**
-     * The interceptor handlers for the service.
-     */
-    private final Set interceptorHandlers = new InsertionOrderSet() ;
-    /**
-     * The unmodifiable version of the interceptor handlers.
-     */
-    private final Set unmodifiableInterceptorHandlers = Collections.unmodifiableSet(interceptorHandlers) ;
-    
-    /**
-     * Register the header handler against the specified qualified name.
-     * @param headerName The qualified name of the header.
-     * @param handler The header handler.
-     */
-    public void registerHeaderHandler(final QName headerName, final HeaderHandler handler)
-    {
-        headerHandlers.put(headerName, handler) ;
-    }
-
-    /**
-     * Remove the header handler for the specified qualified name.
-     * @param headerName The qualified name of the header.
-     */
-    public void removeHeaderHandler(final QName headerName)
-    {
-        headerHandlers.remove(headerName) ;
-    }
-
-    /**
-     * Get the header handler associated with the specified header name.
-     * @param headerName The name of the header.
-     * @return The header handler or null if not recognised.
-     */
-    public HeaderHandler getHeaderHandler(final QName headerName)
-    {
-        return (HeaderHandler)headerHandlers.get(headerName) ;
-    }
-    
-    /**
-     * Get the header handler map.
-     * @return The header handler map.
-     */
-    public Map getHeaderHandlers()
-    {
-        return unmodifiableHeaderHandlers ;
-    }
-    
-    /**
-     * Register the body handler against the specified qualified name.
-     * @param bodyName The qualified name of the body.
-     * @param handler The body handler.
-     */
-    public void registerBodyHandler(final QName bodyName, final BodyHandler handler)
-    {
-        bodyHandlers.put(bodyName, handler) ;
-    }
-    
-    /**
-     * Remove the body handler for the specified qualified name.
-     * @param bodyName The qualified name of the body.
-     */
-    public void removeBodyHandler(final QName bodyName)
-    {
-        bodyHandlers.remove(bodyName) ;
-    }
-
-    /**
-     * Get the body handler associated with the specified body name.
-     * @param bodyName The name of the body.
-     * @return The body handler or null if not recognised.
-     */
-    public BodyHandler getBodyHandler(final QName bodyName)
-    {
-        return (BodyHandler)bodyHandlers.get(bodyName) ;
-    }
-    
-    /**
-     * Register a handler to process SOAP faults.
-     * @param faultHandler The fault handler.
-     */
-    public void registerFaultHandler(final BodyHandler faultHandler)
-    {
-        this.faultHandler = faultHandler ;
-    }
-    
-    /**
-     * Get the fault handler.
-     * @return The fault handler.
-     */
-    public BodyHandler getFaultHandler()
-    {
-        return faultHandler ;
-    }
-    
-    /**
-     * Register the specified interceptor handler
-     * @param interceptorHandler The interceptor handler.
-     */
-    public void registerInterceptorHandler(final InterceptorHandler interceptorHandler)
-    {
-        interceptorHandlers.add(interceptorHandler) ;
-    }
-    
-    /**
-     * Remove the specified interceptor handler
-     * @param interceptorHandler The interceptor handler.
-     */
-    public void removeInterceptorHandler(final InterceptorHandler interceptorHandler)
-    {
-        interceptorHandlers.remove(interceptorHandler) ;
-    }
-    
-    /**
-     * Get the interceptor handlers.
-     * @return the interceptor handlers.
-     */
-    public Set getInterceptorHandlers()
-    {
-        return unmodifiableInterceptorHandlers ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HeaderHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HeaderHandler.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HeaderHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,71 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.soap.SoapDetails;
-
-/**
- * Interface for header handlers.
- * @author kevin
- */
-public interface HeaderHandler
-{
-    /**
-     * Handle the header element.
-     * @param in The current streamreader.
-     * @param context The current message context.
-     * @throws XMLStreamException for parsing errors.
-     * @throws SoapFault for processing errors.
-     */
-    public void invoke(final XMLStreamReader in, final MessageContext context)
-        throws XMLStreamException, SoapFault ;
-    
-    /**
-     * Write the header element in a response.
-     * @param out The output stream.
-     * @param headerElementName The name of the header element.
-     * @param context The current message context.
-     * @param soapDetails The SOAP details.
-     * @throws XMLStreamException 
-     */
-    public void writeContent(final XMLStreamWriter out, final QName headerElementName,
-        final MessageContext context, final SoapDetails soapDetails)
-        throws XMLStreamException ;
-    
-    /**
-     * Validate headers after processing.
-     * @param context The current message context.
-     * @throws SoapFault for validation errors.
-     */
-    public void headerValidate(final MessageContext context)
-        throws SoapFault ;
-    
-    /**
-     * Notification of a subsequent header processing fault.
-     * @param context The current message context.
-     */
-    public void headerFaultNotification(final MessageContext context) ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorChain.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorChain.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorChain.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,51 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.soap.SoapDetails;
-
-/**
- * Interface for the interceptor chain.
- * @author kevin
- */
-public interface InterceptorChain
-{
-    /**
-     * Invoke the next interceptor in the chain.
-     * @param soapService The SOAP service being called.
-     * @param soapDetails The SOAP details.
-     * @param context The current message context.
-     * @param responseContext The response message context.
-     * @param action The transport SOAP action.
-     * @param in The current stream reader.
-     * @throws XMLStreamException for parsing errors.
-     * @throws SoapFault for processing errors.
-     * @return The response elements or null if one way.
-     */
-    public SoapBody invokeNext(final SoapService soapService,
-        final SoapDetails soapDetails, final MessageContext context,
-        final MessageContext responseContext, final String action,
-        final XMLStreamReader in)
-        throws XMLStreamException, SoapFault ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorHandler.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,51 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.soap.SoapDetails;
-
-/**
- * Interface for interceptors handlers.
- * @author kevin
- */
-public interface InterceptorHandler
-{
-    /**
-     * Invoke the interceptor.
-     * @param chain The interceptor chain.
-     * @param soapService The SOAP service being called.
-     * @param soapDetails The SOAP details.
-     * @param context The current message context.
-     * @param responseContext The response message context.
-     * @param action The transport SOAP action.
-     * @param in The current stream reader.
-     * @throws XMLStreamException for parsing errors.
-     * @throws SoapFault for processing errors.
-     * @return The response elements or null if one way.
-     */
-    public SoapBody invoke(final InterceptorChain chain, final SoapService soapService,
-        final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
-        final String action, final XMLStreamReader in)
-        throws XMLStreamException, SoapFault ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/MessageContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/MessageContext.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/MessageContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,98 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The context of a SOAP message.
- * @author kevin
- */
-public class MessageContext
-{
-    /**
-     * The properties associated with the current context.
-     */
-    private Map properties ;
-    /**
-     * The message scheme.
-     */
-    private String scheme ;
-    
-    /**
-     * The default constructor.
-     */
-    public MessageContext()
-    {
-    }
-    
-    /**
-     * Set the property in the message context. 
-     * @param key The property key.
-     * @param value The property value.
-     */
-    public void setProperty(final Object key, final Object value)
-    {
-        getPropertyMap().put(key, value) ;
-    }
-    
-    /**
-     * Get the property from the message context
-     * @param key The property key.
-     * @return The property value or null if not set.
-     */
-    public Object getProperty(final Object key)
-    {
-        return (properties == null ? null : properties.get(key)) ;
-    }
-    
-    /**
-     * Get the message scheme.
-     * @return The message scheme.
-     */
-    public String getScheme()
-    {
-        return scheme ;
-    }
-    
-    /**
-     * Set the message scheme.
-     * @param scheme The message scheme.
-     */
-    public void setScheme(final String scheme)
-    {
-        this.scheme = scheme ;
-    }
-    
-    /**
-     * Get the property map.
-     * @return The property map.
-     */
-    private Map getPropertyMap()
-    {
-        if (properties == null)
-        {
-            properties = new HashMap() ;
-        }
-        return properties ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapBody.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapBody.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapBody.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,102 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import com.arjuna.webservices.stax.NamedElement;
-
-/**
- * Class representing a SOAP body
- * @author kevin
- */
-public class SoapBody
-{
-    /**
-     * The SOAP body contents.
-     */
-    private NamedElement contents ;
-    /**
-     * The associated action.
-     */
-    private String action ;
-    
-    /**
-     * Default constructor. 
-     */
-    public SoapBody()
-    {
-    }
-    
-    /**
-     * Construct a SOAP body with the specified contents and action.
-     * @param contents The SOAP body contents.
-     */
-    public SoapBody(final NamedElement contents)
-    {
-        this(contents, null) ;
-    }
-    
-    /**
-     * Construct a SOAP body with the specified contents and action.
-     * @param contents The SOAP body contents.
-     * @param action The SOAP body action.
-     */
-    public SoapBody(final NamedElement contents, final String action)
-    {
-        this.contents = contents ;
-        this.action = action ;
-    }
-    
-    /**
-     * Get the SOAP body contents.
-     * @return The SOAP body contents.
-     */
-    public NamedElement getContents()
-    {
-        return contents ;
-    }
-    
-    /**
-     * Set the SOAP body contents.
-     * @param contents The SOAP body contents.
-     */
-    public void setContents(final NamedElement contents)
-    {
-        this.contents = contents ;
-    }
-    
-    /**
-     * Get the body action.
-     * @return The body action.
-     */
-    public String getAction()
-    {
-        return action ;
-    }
-    
-    /**
-     * Set the body action.
-     * @param action The body action.
-     */
-    public void setAction(final String action)
-    {
-        this.action = action ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapClient.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,52 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.io.IOException;
-
-
-/**
- * Interface for soap client processors.
- * @author kevin
- */
-public interface SoapClient
-{
-    /**
-     * Invoke a request on a service.
-     * @param request The request object.
-     * @param url The destination URL.
-     * @return The response object.
-     * @throws SoapFault For errors processing the request.
-     * @throws IOException for processing errors.
-     */
-    public SoapMessage invoke(final SoapMessage request, final String url)
-        throws SoapFault, IOException ;
-    
-    /**
-     * Invoke a one way request on a service.
-     * @param request The request object.
-     * @param url The destination URL.
-     * @throws SoapFault For errors processing the request.
-     * @throws IOException for processing errors.
-     */
-    public void invokeOneWay(final SoapMessage request, final String url)
-        throws SoapFault, IOException ;
-}

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapFault.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapFault.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapFault.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -20,14 +20,12 @@
  */
 package com.arjuna.webservices;
 
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 
-import javax.xml.namespace.QName;
-
-import com.arjuna.webservices.stax.NamedElement;
-import com.arjuna.webservices.stax.TextElement;
-
 /**
  * Class representing a SOAP Fault
  * @author kevin
@@ -42,48 +40,44 @@
     /**
      * The SOAP fault type.
      */
-    private SoapFaultType soapFaultType ;
+    protected SoapFaultType soapFaultType ;
     /**
      * The SOAP fault subcode.
      */
-    private QName subcode ;
+    protected QName subcode ;
     /**
      * The SOAP fault sub subcode.
      */
-    private QName subSubcode ;
+    protected QName subSubcode ;
     /**
      * The SOAP fault reason.
      */
-    private String reason ;
+    protected String reason ;
     /**
-     * The SOAP fault node ;
+     * The SOAP fault reason.
      */
-    private String node ;
+    protected String node ;
     /**
-     * The SOAP fault role.
+     * The SOAP fault detail as a string.
      */
-    private String role ;
+    protected String detail ;
     /**
-     * The detail element.
+     * The SOAP fault role.
      */
-    private NamedElement detail ;
+    protected String role ;
     /**
-     * The header elements.
-     */
-    private NamedElement[] headerElements ;
-    /**
      * The header fault flag.
      */
-    private boolean headerFault ;
+    protected boolean headerFault ;
     /**
      * The associated action.
      */
-    private String action ;
+    protected String action ;
     
     /**
      * Default constructor. 
      */
-    public SoapFault()
+    protected SoapFault()
     {
     }
     
@@ -91,96 +85,59 @@
      * Construct a SOAP fault based on a throwable.
      * @param th The throwable.
      */
-    public SoapFault(final Throwable th)
+    protected SoapFault(final Throwable th)
     {
-        this(SoapFaultType.FAULT_RECEIVER, null, th.toString(),
-            new NamedElement(null, new TextElement(generateStackTrace(th))), null) ;
+        this(SoapFaultType.FAULT_RECEIVER, null, th.toString(), generateStackTrace(th)) ;
     }
     
     /**
-     * Construct a SOAP header fault based on a throwable.
-     * @param th The throwable.
-     * @param headerElements The header elements.
-     */
-    public SoapFault(final Throwable th, final NamedElement[] headerElements)
-    {
-        this(SoapFaultType.FAULT_RECEIVER, null, th.toString(),
-            null, headerElements) ;
-    }
-    
-    /**
      * Create a custom SOAP fault.
      * @param soapFaultType the soap fault type.
      * @param subcode The fault subcode.
      * @param reason The fault reason.
      */
-    public SoapFault(final SoapFaultType soapFaultType, final QName subcode, final String reason)
+    protected SoapFault(final SoapFaultType soapFaultType, final QName subcode, final String reason)
     {
-        this(soapFaultType, subcode, reason, null, null) ;
+        this(soapFaultType, subcode, reason, null) ;
     }
     
     /**
      * Create a custom SOAP fault.
      * @param soapFaultType the soap fault type.
-     * @param subcode The fault subcode.
      * @param reason The fault reason.
-     * @param headerElements The header elements.
      */
-    public SoapFault(final SoapFaultType soapFaultType, final QName subcode, final String reason, final NamedElement[] headerElements)
+    protected SoapFault(final SoapFaultType soapFaultType, final String reason)
     {
-        this(soapFaultType, subcode, reason, null, headerElements) ;
+        this(soapFaultType, null, reason, null) ;
     }
     
     /**
      * Create a custom SOAP fault.
      * @param soapFaultType the soap fault type.
-     * @param subcode The fault subcode.
      * @param reason The fault reason.
      * @param detail The fault detail.
      */
-    public SoapFault(final SoapFaultType soapFaultType, final QName subcode, final String reason, final NamedElement detail)
+    protected SoapFault(final SoapFaultType soapFaultType,
+        final String reason, final String detail)
     {
-        this(soapFaultType, subcode, reason, detail, null) ;
+        this(soapFaultType, null, reason, detail) ;
     }
     
     /**
      * Create a custom SOAP fault.
      * @param soapFaultType the soap fault type.
-     * @param reason The fault reason.
-     */
-    public SoapFault(final SoapFaultType soapFaultType, final String reason)
-    {
-        this(soapFaultType, null, reason, null, null) ;
-    }
-    
-    /**
-     * Create a custom SOAP fault.
-     * @param soapFaultType the soap fault type.
-     * @param reason The fault reason.
-     * @param detail The fault detail.
-     */
-    public SoapFault(final SoapFaultType soapFaultType,
-        final String reason, final NamedElement detail)
-    {
-        this(soapFaultType, null, reason, detail, null) ;
-    }
-    
-    /**
-     * Create a custom SOAP fault.
-     * @param soapFaultType the soap fault type.
      * @param subcode The fault subcode.
      * @param reason The fault reason.
      * @param detail The fault detail.
-     * @param headerElements The fault header elements.
      */
-    public SoapFault(final SoapFaultType soapFaultType, final QName subcode,
-        final String reason, final NamedElement detail, final NamedElement[] headerElements)
+
+    protected SoapFault(final SoapFaultType soapFaultType, final QName subcode,
+        final String reason, final String detail)
     {
         this.soapFaultType = soapFaultType ;
         this.subcode = subcode ;
         this.reason = reason ;
         this.detail = detail ;
-        this.headerElements = headerElements ;
     }
     
     /**
@@ -263,7 +220,7 @@
     {
         return node ;
     }
-    
+
     /**
      * Set the SOAP fault node.
      * @param node The SOAP fault node.
@@ -272,8 +229,8 @@
     {
         this.node = node ;
     }
-    
-    /**
+
+     /**
      * Get the SOAP fault role.
      * @return The SOAP fault role.
      */
@@ -295,7 +252,7 @@
      * Get the SOAP fault detail.
      * @return The SOAP fault detail.
      */
-    public NamedElement getDetail()
+    public String getDetail()
     {
         return detail ;
     }
@@ -304,30 +261,12 @@
      * Set the SOAP fault detail.
      * @param detail The SOAP fault detail.
      */
-    public void setDetail(final NamedElement detail)
+    public void setDetail(final String detail)
     {
         this.detail = detail ;
     }
     
     /**
-     * Get the SOAP fault header elements.
-     * @return The SOAP fault header elements.
-     */
-    public NamedElement[] getHeaderElements()
-    {
-        return headerElements ;
-    }
-    
-    /**
-     * Set the SOAP fault header elements.
-     * @param headerElements The SOAP fault header elements.
-     */
-    public void setHeaderElements(final NamedElement[] headerElements)
-    {
-        this.headerElements = headerElements ;
-    }
-    
-    /**
      * Is this a fault from a SOAP header?
      * @return true if generated by a SOAP header, false otherwise.
      */
@@ -387,6 +326,12 @@
             buffer.append(reason) ;
             buffer.append(']') ;
         }
+        if (detail != null)
+        {
+            buffer.append('[') ;
+            buffer.append(detail) ;
+            buffer.append(']') ;
+        }
         return buffer.toString() ;
     }
     
@@ -395,7 +340,7 @@
      * @param th The throwable.
      * @return The stack trace.
      */
-    private static String generateStackTrace(final Throwable th)
+    public static String generateStackTrace(final Throwable th)
     {
         final StringWriter writer = new StringWriter() ;
         final PrintWriter pw = new PrintWriter(writer) ;

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessage.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessage.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,70 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import com.arjuna.webservices.soap.SoapDetails;
-
-/**
- * Interface representing a SOAP response.
- * @author kevin
- */
-public interface SoapMessage
-{
-    /**
-     * Does the response represent a fault?
-     * @return true if a fault, false otherwise.
-     */
-    public boolean isFault() ;
-    /**
-     * Get the action URI for the response.
-     * @return The action URI for the response.
-     */
-    public String getAction() ;
-    
-    /**
-     * Output the response to the output stream.
-     * @param writer The output writer.
-     * @throws IOException If errors occur during output.
-     */
-    public void output(final Writer writer)
-        throws IOException ;
-    
-    /**
-     * Get the SOAP details associated with the message.
-     * @return The SOAP details.
-     */
-    public SoapDetails getSoapDetails() ;
-    
-    /**
-     * Get the SOAP service associated with the message.
-     * @return The SOAP service or null if not known.
-     */
-    public SoapService getSoapService() ;
-    
-    /**
-     * Get the message context associated with this message.
-     * @return The message context or null if not known.
-     */
-    public MessageContext getMessageContext() ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessageLogging.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessageLogging.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessageLogging.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,103 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class providing SOAP message logging.
- * @author kevin
- */
-public class SoapMessageLogging
-{
-    /**
-     * The thread local message log.
-     */
-    private static final ThreadLocal MESSAGE_LOG = new ThreadLocal() ;
-    /**
-     * The thread local message log enabled flag.
-     */
-    private static final ThreadLocal MESSAGE_LOG_ENABLED = new ThreadLocal() {
-        protected Object initialValue() { return Boolean.FALSE; }
-    };
-    
-    /**
-     * Clear the log for the current thread.
-     */
-    public static void clearThreadLog()
-    {
-        MESSAGE_LOG.set(null) ;
-    }
-    
-    /**
-     * Get the thread log.
-     * @return The thread log.
-     */
-    public static String[] getThreadLog()
-    {
-        final Object value = MESSAGE_LOG.get() ;
-        if (value == null)
-        {
-            return null ;
-        }
-        final List list = (List)value ;
-        return (String[]) list.toArray(new String[list.size()]) ;
-    }
-    
-    /**
-     * Append a message to the thread log.
-     * @param message The thread message to append.
-     */
-    public static void appendThreadLog(final String message)
-    {
-        final Object value = MESSAGE_LOG.get() ;
-        final List list ;
-        if (value == null)
-        {
-            list = new ArrayList() ;
-            MESSAGE_LOG.set(list) ;
-        }
-        else
-        {
-            list = (List)value ;
-        }
-        list.add(message) ;
-    }
-    
-    /**
-     * Is the thread logging enabled?
-     * @return true if enabled, false otherwise.
-     */
-    public static boolean isThreadLogEnabled()
-    {
-        return ((Boolean)MESSAGE_LOG_ENABLED.get()).booleanValue() ;
-    }
-    
-    /**
-     * Set the thread log enable flag.
-     * @param isEnabled True if enabled, false otherwise.
-     */
-    public static void setThreadLogEnabled(final boolean isEnabled)
-    {
-        MESSAGE_LOG_ENABLED.set(isEnabled ? Boolean.TRUE : Boolean.FALSE) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapProcessor.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,44 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.io.IOException;
-import java.io.Reader;
-
-/**
- * Interface for soap version processors.
- * @author kevin
- */
-public interface SoapProcessor
-{
-    /**
-     * Process the input stream and generate a response.
-     * @param messageContext The message context for the request.
-     * @param responseMessageContext The message context for the response.
-     * @param action The transport SOAP action.
-     * @param reader The input reader.
-     * @return The SOAP response.
-     * @throws IOException For errors reading the input stream.
-     */
-    public SoapMessage process(final MessageContext messageContext, final MessageContext responseMessageContext,
-        final String action, final Reader reader)
-        throws IOException ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapRegistry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapRegistry.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,247 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.util.Iterator;
-import java.util.Map;
-import java.util.TreeMap;
-
-/**
- * The registry of SOAP service providers, SOAP services and SOAP clients .
- * @author kevin
- */
-public class SoapRegistry
-{
-    /**
-     * The registry singleton.
-     */
-    private static final SoapRegistry REGISTRY = new SoapRegistry() ;
-    
-    /**
-     * The SOAP service provider registry.
-     */
-    private final Map soapServiceProviderRegistry = new TreeMap() ;
-    /**
-     * The SOAP service registry.
-     */
-    private final Map soapServiceRegistry = new TreeMap() ;
-    /**
-     * The SOAP client registry.
-     */
-    private final Map soapClientRegistry = new TreeMap() ;
-    
-    /**
-     * Get the service registry.
-     * @return The service registry.
-     */
-    public static SoapRegistry getRegistry()
-    {
-        return REGISTRY ;
-    }
-    
-    /**
-     * Register the specified service.
-     * @param scheme The service scheme.
-     * @param provider The service provider.
-     */
-    public void registerSoapServiceProvider(final String scheme, final SoapServiceEndpointProvider provider)
-    {
-        synchronized(soapServiceProviderRegistry)
-        {
-            soapServiceProviderRegistry.put(scheme, provider) ;
-        }
-    }
-    
-    /**
-     * Remove the specified service.
-     * @param scheme The service scheme.
-     */
-    public void removeSoapServiceProvider(final String scheme)
-    {
-        synchronized(soapServiceProviderRegistry)
-        {
-            soapServiceProviderRegistry.remove(scheme) ;
-        }
-    }
-    
-    /**
-     * Register the specified client.
-     * @param scheme The client scheme.
-     * @param client The client.
-     */
-    public void registerSoapClient(final String scheme, final SoapClient client)
-    {
-        synchronized(soapClientRegistry)
-        {
-            soapClientRegistry.put(scheme, client) ;
-        }
-    }
-
-    /**
-     * Get the SOAP client for the specified scheme.
-     * @param scheme The addressing scheme.
-     * @return The SOAP client or null if not known.
-     */
-    public SoapClient getSoapClient(final String scheme)
-    {
-        synchronized(soapClientRegistry)
-        {
-            return (SoapClient)soapClientRegistry.get(scheme) ;
-        }
-    }
-    
-    /**
-     * Remove the specified client.
-     * @param scheme The client scheme.
-     */
-    public void removeSoapClient(final String scheme)
-    {
-        synchronized(soapClientRegistry)
-        {
-            soapClientRegistry.remove(scheme) ;
-        }
-    }
-    
-    /**
-     * Register the specified service.
-     * @param serviceName The unique name of the service.
-     * @param soapService The service instance.
-     */
-    public void registerSoapService(final String serviceName, final SoapService soapService)
-    {
-        synchronized(soapServiceRegistry)
-        {
-            soapServiceRegistry.put(serviceName, soapService) ;
-        }
-    }
-
-    /**
-     * Get the SOAP service for the specified service.
-     * @param serviceName The name of the service.
-     * @return The SOAP service or null if not known.
-     */
-    public SoapService getSoapService(final String serviceName)
-    {
-        synchronized(soapServiceRegistry)
-        {
-            return (SoapService)soapServiceRegistry.get(serviceName) ;
-        }
-    }
-    
-    /**
-     * Remove the specified service.
-     * @param serviceName The unique name of the service.
-     */
-    public void removeSoapService(final String serviceName)
-    {
-        synchronized(soapServiceRegistry)
-        {
-            soapServiceRegistry.remove(serviceName) ;
-        }
-    }
-    
-    /**
-     * Get the service URI.
-     * @param scheme The addressing scheme.
-     * @param serviceName The service name.
-     * @return The service URI or null if not registered.
-     */
-    public String getServiceURI(final String scheme, final String serviceName)
-    {
-        final SoapServiceEndpointProvider soapServiceProvider ;
-        synchronized(soapServiceRegistry)
-        {
-            soapServiceProvider = (SoapServiceEndpointProvider)soapServiceProviderRegistry.get(scheme) ;
-        }
-        if (soapServiceProvider != null)
-        {
-            return soapServiceProvider.getServiceURI(scheme, serviceName) ;
-        }
-        return null ;
-    }
-    
-    /**
-     * Get the service URI.
-     * @param serviceName The service name.
-     * @return The service URI or null if not registered.
-     */
-    public String getServiceURI(final String serviceName)
-    {
-        synchronized(soapServiceRegistry)
-        {
-            final Iterator entryIter = soapServiceProviderRegistry.entrySet().iterator() ;
-            while(entryIter.hasNext())
-            {
-                final Map.Entry entry = (Map.Entry)entryIter.next() ;
-                final String entryScheme = (String)entry.getKey() ;
-                final SoapServiceEndpointProvider soapServiceProvider = (SoapServiceEndpointProvider)entry.getValue() ;
-                final String uri = soapServiceProvider.getServiceURI(entryScheme, serviceName) ;
-                if (uri != null)
-                {
-                    return uri ;
-                }
-            }
-        }
-        return null ;
-    }
-    
-    /**
-     * Get the service URI.
-     * @param messageContext The message context.
-     * @param serviceName The service name.
-     * @return The service URI or null if not registered.
-     */
-    public String getServiceURI(final MessageContext messageContext, final String serviceName)
-    {
-        final String scheme = messageContext.getScheme() ;
-        final SoapServiceEndpointProvider soapServiceProvider ;
-        synchronized(soapServiceRegistry)
-        {
-            soapServiceProvider = (SoapServiceEndpointProvider)soapServiceProviderRegistry.get(scheme) ;
-        }
-        if (soapServiceProvider != null)
-        {
-            return soapServiceProvider.getServiceURI(messageContext, serviceName) ;
-        }
-        else
-        {
-            return null ;
-        }
-    }
-    
-    /**
-     * Get the scheme from a URL.
-     * @param url The URL.
-     * @return The scheme.
-     */
-    public String getScheme(final String url)
-    {
-        final int separatorIndex = url.indexOf(':') ;
-        if (separatorIndex >= 0)
-        {
-            return url.substring(0, separatorIndex) ;
-        }
-        else
-        {
-            return url ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapService.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,147 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.soap.Soap11Details;
-import com.arjuna.webservices.soap.Soap12Details;
-import com.arjuna.webservices.soap.SoapDetails;
-import com.arjuna.webservices.soap.SoapParser;
-import com.arjuna.webservices.soap.SoapProcessorImpl;
-
-/**
- * Class responsible for handling SOAP services.
- * @author kevin
- */
-public class SoapService
-{
-    /**
-     * The soap 1.1 processor.
-     */
-    private final SoapProcessor soap11Processor = new SoapProcessorImpl(this, new Soap11Details()) ;
-    /**
-     * The soap 1.2 processor.
-     */
-    private final SoapProcessor soap12Processor = new SoapProcessorImpl(this, new Soap12Details()) ;
-    
-    /**
-     * The registry of handlers associated with this service.
-     */
-    private final HandlerRegistry handlerRegistry ;
-    
-    /**
-     * Initialise the SOAP service.
-     * @param handlerRegistry The handler registry for this service.
-     */
-    public SoapService(final HandlerRegistry handlerRegistry)
-    {
-        this.handlerRegistry = handlerRegistry ;
-    }
-
-    /**
-     * Get the header handler associated with the specified header name.
-     * @param headerName The name of the header.
-     * @return The header handler or null if not recognised.
-     */
-    public HeaderHandler getHeaderHandler(final QName headerName)
-    {
-        return handlerRegistry.getHeaderHandler(headerName) ;
-    }
-    
-    /**
-     * Get the header handlers.
-     * @return The header handlers.
-     */
-    public Map getHeaderHandlers()
-    {
-        return handlerRegistry.getHeaderHandlers() ;
-    }
-
-    /**
-     * Get the body handler associated with the specified body name.
-     * @param bodyName The name of the body.
-     * @return The body handler or null if not recognised.
-     */
-    public BodyHandler getBodyHandler(final QName bodyName)
-    {
-        return handlerRegistry.getBodyHandler(bodyName) ;
-    }
-
-    /**
-     * Get the fault handler for the service.
-     * @return The fault handler for the service.
-     */
-    public BodyHandler getFaultHandler()
-    {
-        return handlerRegistry.getFaultHandler() ;
-    }
-    
-    /**
-     * Get the interceptor handlers.
-     * @return The interceptor handlers.
-     */
-    public Set getInterceptorHandlers()
-    {
-        return handlerRegistry.getInterceptorHandlers() ;
-    }
-
-    /**
-     * Return the SOAP 1.1 processor.
-     * @return The SOAP 1.1 processor.
-     */
-    public SoapProcessor getSOAP11Processor()
-    {
-        return soap11Processor ;
-    }
-
-    /**
-     * Return the SOAP 1.2 processor.
-     * @return The SOAP 1.2 processor.
-     */
-    public SoapProcessor getSOAP12Processor()
-    {
-        return soap12Processor ;
-    }
-
-    /**
-     * Handle the processing of the SOAP request.
-     * @param messageContext The current message context.
-     * @param messageResponseContext The current message response context.
-     * @param action The transport SOAP action.
-     * @param streamReader The XML stream reader.
-     * @param soapDetails The SOAP details.
-     * @return The SOAP response.
-     * @throws XMLStreamException For XML parsing errors.
-     * @throws SoapFault For SOAP processing errors.
-     */
-    public SoapBody parse(final MessageContext messageContext, final MessageContext messageResponseContext,
-        final String action, final XMLStreamReader streamReader, final SoapDetails soapDetails)
-        throws XMLStreamException, SoapFault
-    {
-        return SoapParser.parse(messageContext, messageResponseContext, action, streamReader, this, soapDetails) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapServiceEndpointProvider.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapServiceEndpointProvider.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapServiceEndpointProvider.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,45 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices;
-
-/**
- * The interface for a SOAP service endpoint provider.
- * @author kevin
- */
-public interface SoapServiceEndpointProvider
-{
-    /**
-     * Get the URI of a service supported by this endpoint provider.
-     * @param messageContext The message context.
-     * @param serviceName The service name.
-     * @return The service URI or null if not known.
-     */
-    public String getServiceURI(final MessageContext messageContext,
-        final String serviceName) ;
-    
-    /**
-     * Get the URI of a service supported by this endpoint provider.
-     * @param scheme The addressing scheme of the endpoint provider.
-     * @param serviceName The service name.
-     * @return The service URI or null if not known.
-     */
-    public String getServiceURI(final String scheme, final String serviceName) ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap11Details.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap11Details.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap11Details.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,478 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import java.text.MessageFormat;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.AnyElement;
-import com.arjuna.webservices.stax.ElementContent;
-import com.arjuna.webservices.stax.NamedElement;
-import com.arjuna.webservices.stax.TextElement;
-import com.arjuna.webservices.util.QNameHelper;
-import com.arjuna.webservices.util.StreamHelper;
-
-
-/**
- * The class implementing SOAP 1.1 specific processing.
- * @author kevin
- */
-public class Soap11Details implements SoapDetails
-{
-    /**
-     * The SOAP 1.1 namespace.
-     */
-    private static final String NAMESPACE_URI = "http://schemas.xmlsoap.org/soap/envelope/" ;
-    /**
-     * The SOAP 1.1 local name of the role attribute.
-     */
-    private static final String ROLE_LOCAL_NAME = "actor" ;
-    /**
-     * The qualified SOAP 1.1 role attribute. 
-     */
-    private final static QName QNAME_ATTRIBUTE_ROLE = getQName(ROLE_LOCAL_NAME) ;
-    /**
-     * The SOAP 1.1 next role.
-     */
-    private static final String NEXT_ROLE = NAMESPACE_URI + "http://schemas.xmlsoap.org/soap/actor/next" ;
-    /**
-     * The SOAP 1.1 last role.
-     */
-    private static final String LAST_ROLE = null ;
-    /**
-     * The SOAP 1.1 must understand value.
-     */
-    private final static String MUST_UNDERSTAND_VALUE = "1" ;
-    
-    /**
-     * The qualified SOAP 1.1 MustUnderstand name.
-     */
-    private final static QName QNAME_MUST_UNDERSTAND = getQName("mustUnderstand") ;
-    /**
-     * The qualified SOAP 1.1 Fault name. 
-     */
-    private final static QName QNAME_FAULT = getQName("Fault") ;
-    /**
-     * The qualified SOAP 1.1 faultcode name. 
-     */
-    private final static QName QNAME_FAULTCODE = new QName("faultcode") ;
-    /**
-     * The qualified SOAP 1.1 faultstring name. 
-     */
-    private final static QName QNAME_FAULTSTRING = new QName("faultstring") ;
-    /**
-     * The qualified SOAP 1.1 faultactor name. 
-     */
-    private final static QName QNAME_FAULTACTOR = new QName("faultactor") ;
-    /**
-     * The qualified SOAP 1.1 detail name. 
-     */
-    private final static QName QNAME_DETAIL = new QName("detail") ;
-    
-    /**
-     * The Fault Code for version mismatch.
-     */
-    private final static QName FAULT_CODE_VERSION_MISMATCH = getQName("VersionMismatch") ;
-    /**
-     * The Fault Code for must understand.
-     */
-    private final static QName FAULT_CODE_MUST_UNDERSTAND = getQName("MustUnderstand") ;
-    /**
-     * The Fault Code for sender.
-     */
-    private final static QName FAULT_CODE_SENDER = getQName("Client") ;
-    /**
-     * The Fault Code for receiver.
-     */
-    private final static QName FAULT_CODE_RECEIVER = getQName("Server") ;
-    
-    /**
-     * Get the SOAP version.
-     * @return The SOAP version
-     */
-    public String getVersion()
-    {
-        return SOAP_11_VERSION ;
-    }
-    
-    /**
-     * Get the SOAP namespace URI.
-     * @return The SOAP namespace URI.
-     */
-    public String getNamespaceURI()
-    {
-        return NAMESPACE_URI ;
-    }
-    
-    /**
-     * Get the local name of the role attribute.
-     * @return The role local name,
-     */
-    public String getRoleLocalName()
-    {
-        return ROLE_LOCAL_NAME ;
-    }
-    
-    /**
-     * Get the qualified name of the role attribute.
-     * @return The role qualified name,
-     */
-    public QName getRoleQName()
-    {
-        return QNAME_ATTRIBUTE_ROLE ;
-    }
-    
-    /**
-     * Get the SOAP name for the next role.
-     * @return The name of the next role.
-     */
-    public String getNextRole()
-    {
-        return NEXT_ROLE ;
-    }
-    
-    /**
-     * Get the SOAP name for the last role.
-     * @return The name of the last role.
-     */
-    public String getLastRole()
-    {
-        return LAST_ROLE ;
-    }
-    
-    /**
-     * Get the qualified SOAP Fault element name.
-     * @return The qualified SOAP Fault name.
-     */
-    public QName getFaultName()
-    {
-        return QNAME_FAULT ;
-    }
-    
-    /**
-     * Get the qualified name of the must understand attribute.
-     * @return The must understand qualified name.
-     */
-    public QName getMustUnderstandQName()
-    {
-        return QNAME_MUST_UNDERSTAND ;
-    }
-    
-    /**
-     * Get the value of the must understand attribute.
-     * @return The must understand value.
-     */
-    public String getMustUnderstandValue()
-    {
-        return MUST_UNDERSTAND_VALUE ;
-    }
-    
-    /**
-     * Write SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFaultHeaders(streamWriter, soapFault, false) ;
-    }
-    
-    /**
-     * Write a SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFault(streamWriter, soapFault, false) ;
-    }
-    
-    /**
-     * Write a header SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFaultHeaders(streamWriter, soapFault, true) ;
-    }
-    
-    /**
-     * Write a header SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFault(streamWriter, soapFault, true) ;
-    }
-    
-    /**
-     * Parse a SOAP fault from the stream.
-     * @param streamReader The input stream.
-     * @return The soap fault.
-     * @throws XMLStreamException For errors during reading.
-     * 
-     * @message com.arjuna.webservices.soap.Soap11Details_1 [com.arjuna.webservices.soap.Soap11Details_1] - Unexpected start element: {0}
-     */
-    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
-        throws XMLStreamException
-    {
-        final SoapFault soapFault = new SoapFault() ;
-        
-        // faultcode processing
-        StreamHelper.checkNextStartTag(streamReader, QNAME_FAULTCODE) ;
-        final TextElement codeElement = new TextElement(streamReader) ;
-        final QName code = QNameHelper.toQName(streamReader.getNamespaceContext(), codeElement.getText()) ;
-        if (!NAMESPACE_URI.equals(code.getNamespaceURI()))
-        {
-            soapFault.setSoapFaultType(SoapFaultType.FAULT_SENDER) ;
-            soapFault.setSubcode(code) ;
-        }
-        else
-        {
-            soapFault.setSoapFaultType(getSoapFaultType(code)) ;
-        }
-        
-        // faultstring processing
-        StreamHelper.checkNextStartTag(streamReader, QNAME_FAULTSTRING) ;
-        final TextElement reasonElement = new TextElement(streamReader) ;
-        soapFault.setReason(reasonElement.getText()) ;
-        if (StreamHelper.checkParentFinished(streamReader))
-        {
-            return soapFault ;
-        }
-        
-        // faultactor if present
-        if (QNAME_FAULTACTOR.equals(streamReader.getName()))
-        {
-            final TextElement roleElement = new TextElement(streamReader) ;
-            soapFault.setRole(roleElement.getText()) ;
-            if (StreamHelper.checkParentFinished(streamReader))
-            {
-                return soapFault ;
-            }
-        }
-        
-        // detail if present
-        if (QNAME_DETAIL.equals(streamReader.getName()))
-        {
-            soapFault.setDetail(new NamedElement(null, new AnyElement(streamReader))) ;
-            if (StreamHelper.checkParentFinished(streamReader))
-            {
-                return soapFault ;
-            }
-        }
-        
-        final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap11Details_1") ;
-        final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-        throw new XMLStreamException(message) ;
-    }
-
-    /**
-     * Get the headers passed with a MustUnderstand fault.
-     * @param headerName The name of the header that cannot be processed.
-     * @return The headers or null if none required.
-     */
-    public NamedElement[] getMustUnderstandHeaders(final QName headerName)
-    {
-        return null ;
-    }
-    
-    /**
-     * Write SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @param isHeaderFault true if the SOAP fault is generated during header processing.
-     * @throws XMLStreamException For errors during writing.
-     */
-    private void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
-        throws XMLStreamException
-    {
-        final NamedElement[] headerElements = soapFault.getHeaderElements() ;
-        final int numHeaderElements = (headerElements == null ? 0 : headerElements.length) ;
-        for(int count = 0 ; count < numHeaderElements ; count++)
-        {
-            final NamedElement namedElement = headerElements[count] ;
-            final QName headerElementName = namedElement.getName() ;
-            final String namespaceURI = StreamHelper.writeStartElement(streamWriter, headerElementName) ;
-            namedElement.getElementContent().writeContent(streamWriter) ;
-            StreamHelper.writeEndElement(streamWriter, headerElementName.getPrefix(), namespaceURI) ;
-        }
-        
-        // Detail output
-        if (isHeaderFault)
-        {
-            final NamedElement detail = soapFault.getDetail() ;
-            if (detail != null)
-            {
-            		final QName detailName = detail.getName() ;
-            		if (detailName != null)
-            		{
-                    final String namespaceURI = StreamHelper.writeStartElement(streamWriter, detailName) ;
-                    detail.getElementContent().writeContent(streamWriter) ;
-                    StreamHelper.writeEndElement(streamWriter, detailName.getPrefix(), namespaceURI) ;
-            		}
-            }
-        }
-    }
-    
-    /**
-     * Write a SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @param isHeaderFault true if the SOAP fault is generated during header processing.
-     * @throws XMLStreamException For errors during writing.
-     */
-    private void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
-        throws XMLStreamException
-    {
-        final String namespaceURI = StreamHelper.writeStartElement(streamWriter, QNAME_FAULT) ;
-        
-        final QName faultCode ;
-        final QName subcode = soapFault.getSubcode() ;
-        if (subcode != null)
-        {
-            faultCode = soapFault.getSubcode() ;
-        }
-        else
-        {
-            faultCode = getSoapFaultCodeQName(soapFault) ;
-        }
-        
-        final String faultCodeNamespaceURI = QNameHelper.getNormalisedValue(faultCode.getNamespaceURI()) ;
-        
-        if (faultCodeNamespaceURI.length() > 0)
-        {
-            StreamHelper.writeNamespace(streamWriter, faultCode.getPrefix(), faultCodeNamespaceURI) ;
-        }
-        
-        // faultcode output
-        StreamHelper.writeStartElement(streamWriter, QNAME_FAULTCODE) ;
-        StreamHelper.writeQualifiedName(streamWriter, faultCode) ;
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        
-        // faultstring output
-        StreamHelper.writeStartElement(streamWriter, QNAME_FAULTSTRING) ;
-        streamWriter.writeCharacters(soapFault.getReason()) ;
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        
-        // faultactor output
-        final String faultactor = soapFault.getRole() ;
-        if (faultactor != null)
-        {
-            StreamHelper.writeStartElement(streamWriter, QNAME_FAULTACTOR) ;
-            streamWriter.writeCharacters(faultactor) ;
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-        }
-        
-        // Detail output
-        if (!isHeaderFault)
-        {
-            final NamedElement detail = soapFault.getDetail() ;
-            if (detail != null)
-            {
-                StreamHelper.writeStartElement(streamWriter, QNAME_DETAIL) ;
-                final ElementContent detailContent = detail.getElementContent() ;
-                detailContent.writeContent(streamWriter) ;
-                StreamHelper.writeEndElement(streamWriter, null, null) ;
-            }
-        }
-        
-        StreamHelper.writeEndElement(streamWriter, QNAME_FAULT.getPrefix(), namespaceURI) ;
-    }
-    
-    /**
-     * Get the code qualified name for the SOAP fault.
-     * @param soapFault The SOAP fault.
-     * @return The qualified name.
-     */
-    private QName getSoapFaultCodeQName(final SoapFault soapFault)
-    {
-        final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
-        if (soapFaultType == SoapFaultType.FAULT_SENDER)
-        {
-            return FAULT_CODE_SENDER ;
-        }
-        else if (soapFaultType == SoapFaultType.FAULT_RECEIVER)
-        {
-            return FAULT_CODE_RECEIVER ;
-        }
-        else if (soapFaultType == SoapFaultType.FAULT_MUST_UNDERSTAND)
-        {
-            return FAULT_CODE_MUST_UNDERSTAND ;
-        }
-        else
-        {
-            return FAULT_CODE_VERSION_MISMATCH ;
-        }
-    }
-
-    /**
-     * Get the SOAP fault type corresponding to the qualified name.
-     * @param code The qualified name.
-     * @return The soap fault type.
-     */
-    private SoapFaultType getSoapFaultType(final QName code)
-    {
-        if (FAULT_CODE_SENDER.equals(code))
-        {
-            return SoapFaultType.FAULT_SENDER ;
-        }
-        else if (FAULT_CODE_RECEIVER.equals(code))
-        {
-            return SoapFaultType.FAULT_RECEIVER ;
-        }
-        else if (FAULT_CODE_MUST_UNDERSTAND.equals(code))
-        {
-            return SoapFaultType.FAULT_MUST_UNDERSTAND ;
-        }
-        else
-        {
-            return SoapFaultType.FAULT_VERSION_MISMATCH ;
-        }
-    }
-
-    /**
-     * Convenience for generating SOAP qualified names.
-     * @param localName The local name.
-     * @return The qualified name.
-     */
-    private static QName getQName(final String localName)
-    {
-        return new QName(NAMESPACE_URI, localName, SoapConstants.SOAP_PREFIX) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap12Details.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap12Details.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap12Details.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,576 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import java.text.MessageFormat;
-import java.util.Locale;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.AnyElement;
-import com.arjuna.webservices.stax.ElementContent;
-import com.arjuna.webservices.stax.NamedElement;
-import com.arjuna.webservices.stax.TextElement;
-import com.arjuna.webservices.util.QNameHelper;
-import com.arjuna.webservices.util.StreamHelper;
-
-
-/**
- * The class implementing SOAP 1.2 specific processing.
- * @author kevin
- * 
- * @message com.arjuna.webservices.soap.Soap12Details_1 [com.arjuna.webservices.soap.Soap12Details_1] - Unexpected start element: {0}
- */
-public class Soap12Details implements SoapDetails
-{
-    /**
-     * The SOAP 1.2 namespace.
-     */
-    private final static String NAMESPACE_URI = "http://www.w3.org/2003/05/soap-envelope" ;
-    /**
-     * The SOAP 1.2 local name of the role attribute.
-     */
-    private static final String ROLE_LOCAL_NAME = "role" ;
-    /**
-     * The qualified SOAP 1.2 role attribute. 
-     */
-    private final static QName QNAME_ATTRIBUTE_ROLE = getQName(ROLE_LOCAL_NAME) ;
-    /**
-     * The SOAP 1.2 next role.
-     */
-    private final static String NEXT_ROLE = NAMESPACE_URI + "/role/next" ;
-    /**
-     * The SOAP 1.2 none role.
-     */
-    private final static String NONE_ROLE = NAMESPACE_URI + "/role/none" ;
-    /**
-     * The SOAP 1.2 last role.
-     */
-    private final static String LAST_ROLE = NAMESPACE_URI + "/role/ultimateReceiver" ;
-    /**
-     * The SOAP 1.2 must understand value.
-     */
-    private final static String MUST_UNDERSTAND_VALUE = "true" ;
-    
-    /**
-     * The qualified SOAP 1.2 MustUnderstand name.
-     */
-    private final static QName QNAME_MUST_UNDERSTAND = getQName("mustUnderstand") ;
-    /**
-     * The qualified SOAP 1.2 Fault name. 
-     */
-    private final static QName QNAME_FAULT = getQName("Fault") ;
-    /**
-     * The qualified SOAP 1.2 Code name. 
-     */
-    private final static QName QNAME_CODE = getQName("Code") ;
-    /**
-     * The qualified SOAP 1.2 Reason name. 
-     */
-    private final static QName QNAME_REASON = getQName("Reason") ;
-    /**
-     * The qualified SOAP 1.2 Node name. 
-     */
-    private final static QName QNAME_NODE = getQName("Node") ;
-    /**
-     * The qualified SOAP 1.2 Role name. 
-     */
-    private final static QName QNAME_ROLE = getQName("Role") ;
-    /**
-     * The qualified SOAP 1.2 Detail name. 
-     */
-    private final static QName QNAME_DETAIL = getQName("Detail") ;
-    /**
-     * The qualified SOAP 1.2 Value name. 
-     */
-    private final static QName QNAME_VALUE = getQName("Value") ;
-    /**
-     * The qualified SOAP 1.2 Subcode name. 
-     */
-    private final static QName QNAME_SUBCODE = getQName("Subcode") ;
-    /**
-     * The qualified SOAP 1.2 Text name. 
-     */
-    private final static QName QNAME_TEXT = getQName("Text") ;
-    /**
-     * The qualified SOAP 1.2 NotUnderstood name.
-     */
-    private final static QName QNAME_NOT_UNDERSTOOD = getQName("NotUnderstood") ;
-    
-    /**
-     * The XML Lang attribute.
-     */
-    private final static QName QNAME_XML_LANG = new QName("http://www.w3.org/XML/1998/namespace", "lang", "xml") ;
-    
-    /**
-     * The Fault Code for version mismatch.
-     */
-    private final static QName FAULT_CODE_VERSION_MISMATCH = getQName("VersionMismatch") ;
-    /**
-     * The Fault Code for must understand.
-     */
-    private final static QName FAULT_CODE_MUST_UNDERSTAND = getQName("MustUnderstand") ;
-    /**
-     * The Fault Code for data encoding unknown.
-     */
-    private final static QName FAULT_CODE_DATA_ENCODING_UNKNOWN = getQName("DataEncodingUnknown") ;
-    /**
-     * The Fault Code for sender.
-     */
-    private final static QName FAULT_CODE_SENDER = getQName("Sender") ;
-    /**
-     * The Fault Code for receiver.
-     */
-    private final static QName FAULT_CODE_RECEIVER = getQName("Receiver") ;
-    
-    /**
-     * Get the SOAP version.
-     * @return The SOAP version
-     */
-    public String getVersion()
-    {
-        return SOAP_12_VERSION ;
-    }
-    
-    /**
-     * Get the SOAP namespace URI.
-     * @return The SOAP namespace URI.
-     */
-    public String getNamespaceURI()
-    {
-        return NAMESPACE_URI ;
-    }
-    
-    /**
-     * Get the local name of the role attribute.
-     * @return The role local name,
-     */
-    public String getRoleLocalName()
-    {
-        return ROLE_LOCAL_NAME ;
-    }
-    
-    /**
-     * Get the qualified name of the role attribute.
-     * @return The role qualified name,
-     */
-    public QName getRoleQName()
-    {
-        return QNAME_ATTRIBUTE_ROLE ;
-    }
-    
-    /**
-     * Get the SOAP name for the next role.
-     * @return The name of the next role.
-     */
-    public String getNextRole()
-    {
-        return NEXT_ROLE ;
-    }
-    
-    /**
-     * Get the SOAP name for the none role.
-     * @return The name of the none role.
-     */
-    public String getNoneRole()
-    {
-        return NONE_ROLE ;
-    }
-    
-    /**
-     * Get the SOAP name for the last role.
-     * @return The name of the last role.
-     */
-    public String getLastRole()
-    {
-        return LAST_ROLE ;
-    }
-    
-    /**
-     * Get the qualified SOAP Fault element name.
-     * @return The qualified SOAP Fault name.
-     */
-    public QName getFaultName()
-    {
-        return QNAME_FAULT ;
-    }
-    
-    /**
-     * Get the qualified name of the must understand attribute.
-     * @return The must understand qualified name,
-     */
-    public QName getMustUnderstandQName()
-    {
-        return QNAME_MUST_UNDERSTAND ;
-    }
-    
-    /**
-     * Get the value of the must understand attribute.
-     * @return The must understand value.
-     */
-    public String getMustUnderstandValue()
-    {
-        return MUST_UNDERSTAND_VALUE ;
-    }
-    
-    /**
-     * Write SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFaultHeaders(streamWriter, soapFault, false) ;
-    }
-    
-    /**
-     * Write a SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFault(streamWriter, soapFault, false) ;
-    }
-    
-    /**
-     * Write a header SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFaultHeaders(streamWriter, soapFault, true) ;
-    }
-    
-    /**
-     * Write a header SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException
-    {
-        writeSoapFault(streamWriter, soapFault, true) ;
-    }
-    
-    /**
-     * Parse a SOAP fault from the stream.
-     * @param streamReader The input stream.
-     * @return The SOAP fault.
-     * @throws XMLStreamException For errors during reading.
-     */
-    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
-        throws XMLStreamException
-    {
-            final SoapFault soapFault = new SoapFault() ;
-            
-            // Code processing
-            StreamHelper.checkNextStartTag(streamReader, QNAME_CODE) ;
-            StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
-            final TextElement codeElement = new TextElement(streamReader) ;
-            final QName code = QNameHelper.toQName(streamReader.getNamespaceContext(), codeElement.getText()) ;
-            soapFault.setSoapFaultType(getSoapFaultType(code)) ;
-            if (!StreamHelper.checkParentFinished(streamReader))
-            {
-                StreamHelper.checkTag(streamReader, QNAME_SUBCODE) ;
-                StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
-                final TextElement subcodeElement = new TextElement(streamReader) ;
-                soapFault.setSubcode(QNameHelper.toQName(streamReader.getNamespaceContext(), subcodeElement.getText())) ;
-                if (!StreamHelper.checkParentFinished(streamReader))
-                {
-                    StreamHelper.checkTag(streamReader, QNAME_SUBCODE) ;
-                    StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
-                    final TextElement subSubcodeElement = new TextElement(streamReader) ;
-                    soapFault.setSubSubcode(QNameHelper.toQName(streamReader.getNamespaceContext(), subSubcodeElement.getText())) ;
-                    if (!StreamHelper.checkParentFinished(streamReader))
-                    {
-                        // Throw away any subcodes as we only support two level.
-                        new AnyElement(streamReader) ;
-                        if (!StreamHelper.checkParentFinished(streamReader))
-                        {
-                            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
-                            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                            throw new XMLStreamException(message) ;
-                        }
-                    }
-                    if (!StreamHelper.checkParentFinished(streamReader))
-                    {
-                        final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
-                        final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                        throw new XMLStreamException(message) ;
-                    }
-                }
-                if (!StreamHelper.checkParentFinished(streamReader))
-                {
-                    final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
-                    final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                    throw new XMLStreamException(message) ;
-                }
-            }
-            
-            // Reason processing
-            StreamHelper.checkNextStartTag(streamReader, QNAME_REASON) ;
-            StreamHelper.checkNextStartTag(streamReader, QNAME_TEXT) ;
-            final TextElement reasonElement = new TextElement(streamReader) ;
-            soapFault.setReason(reasonElement.getText()) ;
-            if (!StreamHelper.checkParentFinished(streamReader))
-            {
-                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
-                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                throw new XMLStreamException(message) ;
-            }
-            if (StreamHelper.checkParentFinished(streamReader))
-            {
-                return soapFault ;
-            }
-            
-            // Node if present
-            if (QNAME_NODE.equals(streamReader.getName()))
-            {
-                final TextElement nodeElement = new TextElement(streamReader) ;
-                soapFault.setNode(nodeElement.getText()) ;
-                if (StreamHelper.checkParentFinished(streamReader))
-                {
-                    return soapFault ;
-                }
-            }
-            // Role if present
-            if (QNAME_ROLE.equals(streamReader.getName()))
-            {
-                final TextElement roleElement = new TextElement(streamReader) ;
-                soapFault.setRole(roleElement.getText()) ;
-                if (StreamHelper.checkParentFinished(streamReader))
-                {
-                    return soapFault ;
-                }
-            }
-            
-            // Detail if present
-            if (QNAME_DETAIL.equals(streamReader.getName()))
-            {
-                soapFault.setDetail(new NamedElement(null, new AnyElement(streamReader))) ;
-                if (StreamHelper.checkParentFinished(streamReader))
-                {
-                    return soapFault ;
-                }
-            }
-            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
-            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-            throw new XMLStreamException(message) ;
-    }
-
-    /**
-     * Get the headers passed with a MustUnderstand fault.
-     * @param headerName The name of the header that cannot be processed.
-     * @return The headers or null if none required.
-     */
-    public NamedElement[] getMustUnderstandHeaders(final QName headerName)
-    {
-        final ElementContent notUnderstoodElement = new SoapNotUnderstoodType(headerName) ;
-        final NamedElement header = new NamedElement(QNAME_NOT_UNDERSTOOD, notUnderstoodElement) ;
-        return new NamedElement[] {header} ;
-    }
-    
-    /**
-     * Write SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @param isHeaderFault true if the SOAP fault is generated during header processing.
-     * @throws XMLStreamException For errors during writing.
-     */
-    private void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
-        throws XMLStreamException
-    {
-        final NamedElement[] headerElements = soapFault.getHeaderElements() ;
-        final int numHeaderElements = (headerElements == null ? 0 : headerElements.length) ;
-        for(int count = 0 ; count < numHeaderElements ; count++)
-        {
-            final NamedElement namedElement = headerElements[count] ;
-            final QName headerElementName = namedElement.getName() ;
-            final String namespaceURI = StreamHelper.writeStartElement(streamWriter, headerElementName) ;
-            namedElement.getElementContent().writeContent(streamWriter) ;
-            StreamHelper.writeEndElement(streamWriter, headerElementName.getPrefix(), namespaceURI) ;
-        }
-    }
-    
-    /**
-     * Write a SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The SOAP fault.
-     * @param isHeaderFault true if the SOAP fault is generated during header processing.
-     * @throws XMLStreamException For errors during writing.
-     */
-    private void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
-        throws XMLStreamException
-    {
-        final String namespaceURI = StreamHelper.writeStartElement(streamWriter, QNAME_FAULT) ;
-        
-        // Code output
-        StreamHelper.writeStartElement(streamWriter, QNAME_CODE) ;
-        
-        StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
-        StreamHelper.writeQualifiedName(streamWriter, getSoapFaultCodeQName(soapFault)) ;
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        
-        final QName subcode = soapFault.getSubcode() ;
-        if (subcode != null)
-        {
-            StreamHelper.writeStartElement(streamWriter, QNAME_SUBCODE) ;
-            StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
-            StreamHelper.writeQualifiedName(streamWriter, subcode) ;
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-            
-            final QName subSubcode = soapFault.getSubSubcode() ;
-            if (subSubcode != null)
-            {
-                StreamHelper.writeStartElement(streamWriter, QNAME_SUBCODE) ;
-                StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
-                StreamHelper.writeQualifiedName(streamWriter, subSubcode) ;
-                StreamHelper.writeEndElement(streamWriter, null, null) ;
-                StreamHelper.writeEndElement(streamWriter, null, null) ;
-            }
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-        }
-        
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        
-        // Reason output
-        StreamHelper.writeStartElement(streamWriter, QNAME_REASON) ;
-        StreamHelper.writeStartElement(streamWriter, QNAME_TEXT) ;
-        StreamHelper.writeAttribute(streamWriter, QNAME_XML_LANG, Locale.getDefault().getLanguage()) ;
-        streamWriter.writeCharacters(soapFault.getReason()) ;
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        StreamHelper.writeEndElement(streamWriter, null, null) ;
-        
-        // Node output
-        final String node = soapFault.getNode() ;
-        if (node != null)
-        {
-            StreamHelper.writeStartElement(streamWriter, QNAME_NODE) ;
-            streamWriter.writeCharacters(node) ;
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-        }
-        
-        // Role output
-        final String role = soapFault.getNode() ;
-        if (role != null)
-        {
-            StreamHelper.writeStartElement(streamWriter, QNAME_ROLE) ;
-            streamWriter.writeCharacters(role) ;
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-        }
-        
-        // Detail output
-        final NamedElement detail = soapFault.getDetail() ;
-        if (detail != null)
-        {
-            StreamHelper.writeStartElement(streamWriter, QNAME_DETAIL) ;
-            final ElementContent detailContent = detail.getElementContent() ;
-            detailContent.writeContent(streamWriter) ;
-            StreamHelper.writeEndElement(streamWriter, null, null) ;
-        }
-        
-        StreamHelper.writeEndElement(streamWriter, QNAME_FAULT.getPrefix(), namespaceURI) ;
-    }
-    
-    /**
-     * Get the code qualified name for the SOAP fault.
-     * @param soapFault The SOAP fault.
-     * @return The qualified name.
-     */
-    private QName getSoapFaultCodeQName(final SoapFault soapFault)
-    {
-        final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
-        if (soapFaultType == SoapFaultType.FAULT_SENDER)
-        {
-            return FAULT_CODE_SENDER ;
-        }
-        else if (soapFaultType == SoapFaultType.FAULT_RECEIVER)
-        {
-            return FAULT_CODE_RECEIVER ;
-        }
-        else if (soapFaultType == SoapFaultType.FAULT_MUST_UNDERSTAND)
-        {
-            return FAULT_CODE_MUST_UNDERSTAND ;
-        }
-        else if (soapFaultType == SoapFaultType.FAULT_VERSION_MISMATCH)
-        {
-            return FAULT_CODE_VERSION_MISMATCH ;
-        }
-        else
-        {
-            return FAULT_CODE_DATA_ENCODING_UNKNOWN ;
-        }
-    }
-
-    /**
-     * Get the SOAP fault type corresponding to the qualified name.
-     * @param code The qualified name.
-     * @return The soap fault type.
-     */
-    private SoapFaultType getSoapFaultType(final QName code)
-    {
-        if (FAULT_CODE_SENDER.equals(code))
-        {
-            return SoapFaultType.FAULT_SENDER ;
-        }
-        else if (FAULT_CODE_RECEIVER.equals(code))
-        {
-            return SoapFaultType.FAULT_RECEIVER ;
-        }
-        else if (FAULT_CODE_MUST_UNDERSTAND.equals(code))
-        {
-            return SoapFaultType.FAULT_MUST_UNDERSTAND ;
-        }
-        else if (FAULT_CODE_VERSION_MISMATCH.equals(code))
-        {
-            return SoapFaultType.FAULT_VERSION_MISMATCH ;
-        }
-        else
-        {
-            return SoapFaultType.FAULT_DATA_ENCODING_UNKNOWN ;
-        }
-    }
-    
-    /**
-     * Convenience for generating SOAP qualified names.
-     * @param localName The local name.
-     * @return The qualified name.
-     */
-    private static QName getQName(final String localName)
-    {
-        return new QName(NAMESPACE_URI, localName, SoapConstants.SOAP_PREFIX) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapBodyMessage.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapBodyMessage.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapBodyMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,128 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.SoapBody;
-import com.arjuna.webservices.SoapService;
-import com.arjuna.webservices.stax.NamedElement;
-import com.arjuna.webservices.util.StreamHelper;
-
-/**
- * SOAP message representing a normal message.
- * @author kevin
- */
-public class SoapBodyMessage extends SoapMessageBase
-{
-    /**
-     * The SOAP body.
-     */
-    private final SoapBody soapBody ;
-    
-    /**
-     * Construct the SOAP body message.
-     * @param soapBody The SOAP body.
-     * @param soapService The SOAP service.
-     * @param messageContext The message context.
-     */
-    public SoapBodyMessage(final SoapBody soapBody, final SoapService soapService,
-        final MessageContext messageContext)
-    {
-        this(soapBody, null, soapService, messageContext) ;
-    }
-    
-    /**
-     * Construct the SOAP body message.
-     * @param soapBody The SOAP body.
-     * @param soapDetails The SOAP service details.
-     * @param soapService The SOAP service.
-     * @param messageContext The message context.
-     */
-    public SoapBodyMessage(final SoapBody soapBody, final SoapDetails soapDetails,
-       final SoapService soapService, final MessageContext messageContext)
-    {
-        super(soapDetails, soapService, messageContext) ;
-        this.soapBody = soapBody ;
-    }
-
-    /**
-     * Does the message represent a fault?
-     * @return true if a fault, false otherwise.
-     */
-    public boolean isFault()
-    {
-        return false ;
-    }
-    
-    /**
-     * Get the SOAP body.
-     * @return The SOAP body.
-     */
-    public SoapBody getSoapBody()
-    {
-        return soapBody ;
-    }
-    
-    /**
-     * Get the action URI for the message.
-     * @return The action URI for the message.
-     */
-    public String getAction()
-    {
-        return soapBody.getAction() ;
-    }
-    
-    /**
-     * Write the headers specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected void writeMessageHeaders(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        // No headers to write.
-    }
-    
-    /**
-     * Write the body specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected void writeMessageBody(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        if (soapBody != null)
-        {
-            final NamedElement bodyElement = soapBody.getContents() ;
-            if (bodyElement != null)
-            {
-                final QName bodyElementName = bodyElement.getName() ;
-                final String namespaceURI = StreamHelper.writeStartElement(streamWriter, bodyElementName) ;
-                bodyElement.getElementContent().writeContent(streamWriter) ;
-                StreamHelper.writeEndElement(streamWriter, bodyElementName.getPrefix(), namespaceURI) ;
-            }
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapConstants.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapConstants.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapConstants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,49 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-/**
- * Common constants for SOAP.
- * @author kevin
- */
-public interface SoapConstants
-{
-    /**
-     * The local name for a SOAP envelope.
-     */
-    public String SOAP_ENVELOPE_NAME = "Envelope" ;
-    /**
-     * The local name for a SOAP header.
-     */
-    public String SOAP_HEADER_NAME = "Header" ;
-    /**
-     * The local name for a SOAP body.
-     */
-    public String SOAP_BODY_NAME = "Body" ;
-    /**
-     * The local name for a SOAP mustUnderstand attribute.
-     */
-    public String SOAP_MUST_UNDERSTAND_NAME = "mustUnderstand" ;
-    /**
-     * The prefix for SOAP elements.
-     */
-    public String SOAP_PREFIX = "soap" ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapDetails.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapDetails.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapDetails.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,152 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.stax.NamedElement;
-
-/**
- * The interface representing SOAP specific processing.
- * @author kevin
- */
-public interface SoapDetails
-{
-    /**
-     * The version string for SOAP 1.1.
-     */
-    public static String SOAP_11_VERSION = "1.1" ;
-    
-    /**
-     * The version string for SOAP 1.2.
-     */
-    public static String SOAP_12_VERSION = "1.2" ;
-    
-    /**
-     * Get the SOAP version.
-     * @return The SOAP version
-     */
-    public String getVersion() ;
-    
-    /**
-     * Get the SOAP namespace URI.
-     * @return The SOAP namespace URI.
-     */
-    public String getNamespaceURI() ;
-    
-    /**
-     * Get the local name of the role attribute.
-     * @return The role local name,
-     */
-    public String getRoleLocalName() ;
-    
-    /**
-     * Get the qualified name of the role attribute.
-     * @return The role qualified name,
-     */
-    public QName getRoleQName() ;
-    
-    /**
-     * Get the SOAP name for the next role.
-     * @return The name of the next role.
-     */
-    public String getNextRole() ;
-    
-    /**
-     * Get the SOAP name for the last role.
-     * @return The name of the last role.
-     */
-    public String getLastRole() ;
-    
-    /**
-     * Get the qualified SOAP Fault element name.
-     * @return The qualified SOAP Fault name.
-     */
-    public QName getFaultName() ;
-    
-    /**
-     * Get the qualified name of the must understand attribute.
-     * @return The must understand qualified name.
-     */
-    public QName getMustUnderstandQName() ;
-    
-    /**
-     * Get the value of the must understand attribute.
-     * @return The must understand value.
-     */
-    public String getMustUnderstandValue() ;
-    
-    /**
-     * Write SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException ;
-    
-    /**
-     * Write a SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException ;
-    
-    /**
-     * Write a header SOAP fault headers to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException ;
-    
-    /**
-     * Write a header SOAP fault to the stream.
-     * @param streamWriter The output stream.
-     * @param soapFault The soap fault.
-     * @throws XMLStreamException For errors during writing.
-     */
-    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
-        throws XMLStreamException ;
-    
-    /**
-     * Parse a SOAP fault from the stream.
-     * @param streamReader The input stream.
-     * @return The soap fault.
-     * @throws XMLStreamException For errors during reading.
-     */
-    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
-        throws XMLStreamException ;
-
-    /**
-     * Get the headers passed with a MustUnderstand fault.
-     * @param headerName The name of the header that cannot be processed.
-     * @return The headers or null if none required.
-     */
-    public NamedElement[] getMustUnderstandHeaders(final QName headerName) ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapFaultMessage.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapFaultMessage.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapFaultMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,127 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapService;
-
-/**
- * SOAP message representing a fault.
- * @author kevin
- */
-public class SoapFaultMessage extends SoapMessageBase
-{
-    /**
-     * The message SOAP fault.
-     */
-    private final SoapFault soapFault ;
-    
-    /**
-     * Construct a SOAP fault message.
-     * @param soapFault The SOAP fault.
-     * @param soapDetails The SOAP service details.
-     */
-    public SoapFaultMessage(final SoapFault soapFault, final SoapDetails soapDetails)
-    {
-        this(soapFault, soapDetails, null, null) ;
-    }
-    
-    /**
-     * Construct a SOAP service fault message.
-     * @param soapFault The SOAP fault.
-     * @param soapDetails The SOAP service details.
-     * @param soapService The SOAP service.
-     * @param messageContext The message context.
-     */
-    public SoapFaultMessage(final SoapFault soapFault, final SoapDetails soapDetails,
-        final SoapService soapService, final MessageContext messageContext)
-    {
-        super(soapDetails, soapService, messageContext) ;
-        this.soapFault = soapFault ;
-    }
-    
-    /**
-     * Does the message represent a fault?
-     * @return true if a fault, false otherwise.
-     */
-    public boolean isFault()
-    {
-        return true ;
-    }
-    
-    /**
-     * Get the SOAP fault.
-     * @return The SOAP fault.
-     */
-    public SoapFault getSoapFault()
-    {
-        return soapFault ;
-    }
-    
-    /**
-     * Get the action URI for the message.
-     * @return The action URI for the message.
-     */
-    public String getAction()
-    {
-        return soapFault.getAction() ;
-    }
-    
-    /**
-     * Write the headers specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected void writeMessageHeaders(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        if (getSoapService() != null)
-        {
-            getSoapDetails().writeSoapFaultHeaders(streamWriter, soapFault) ;
-        }
-        else
-        {
-            getSoapDetails().writeHeaderSoapFaultHeaders(streamWriter, soapFault) ;
-        }
-    }
-    
-    /**
-     * Write the body specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected void writeMessageBody(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        if (getSoapService() != null)
-        {
-            getSoapDetails().writeSoapFault(streamWriter, soapFault) ;
-        }
-        else
-        {
-            getSoapDetails().writeHeaderSoapFault(streamWriter, soapFault) ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapMessageBase.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapMessageBase.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapMessageBase.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,209 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.HeaderHandler;
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.SoapMessage;
-import com.arjuna.webservices.SoapService;
-import com.arjuna.webservices.util.StreamHelper;
-
-abstract class SoapMessageBase implements SoapMessage
-{
-    /**
-     * The SOAP details for this service.
-     */
-    private final SoapDetails soapDetails ;
-    /**
-     * The SOAP service.
-     */
-    private final SoapService soapService ;
-    /**
-     * The message context.
-     */
-    private final MessageContext messageContext ;
-
-    /**
-     * Construct the SOAP message base.
-     * @param soapDetails The SOAP details.
-     * @param soapService The SOAP service.
-     * @param messageContext The message context.
-     */
-    protected SoapMessageBase(final SoapDetails soapDetails, final SoapService soapService,
-        final MessageContext messageContext)
-    {
-        this.soapDetails = (soapDetails == null ? new Soap11Details() : soapDetails) ;
-        this.soapService = soapService ;
-        this.messageContext = messageContext ;
-    }
-    
-    /**
-     * Get the action URI for the message.
-     * @return The action URI for the message.
-     */
-    public abstract String getAction() ;
-    
-    /**
-     * Output the message to the output stream.
-     * @param writer The output writer.
-     * @throws IOException If errors occur during output.
-     */
-    public void output(final Writer writer)
-        throws IOException
-    {
-        try
-        {
-            final XMLStreamWriter xmlWriter = SoapUtils.getXMLStreamWriter(writer);
-
-            writeEnvelope(xmlWriter);
-            xmlWriter.flush();
-        }
-        catch (final XMLStreamException xmlse)
-        {
-            throw new IOException(xmlse.toString()) ;
-        }
-    }
-    
-    /**
-     * Output the envelope to the stream writer.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException If errors occur during output.
-     */
-    private void writeEnvelope(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        final QName envelopeName = getQualifiedName(SoapConstants.SOAP_ENVELOPE_NAME) ;
-        final String envNamespace = StreamHelper.writeStartElement(streamWriter, envelopeName) ;
-        
-        writeHeaders(streamWriter) ;
-        writeBody(streamWriter) ;
-        
-        StreamHelper.writeEndElement(streamWriter, envelopeName.getPrefix(), envNamespace) ;
-    }
-    
-    /**
-     * Output the headers to the stream writer.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException If errors occur during output.
-     */
-    private void writeHeaders(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        final QName headerName = getQualifiedName(SoapConstants.SOAP_HEADER_NAME) ;
-        final String headerNamespace = StreamHelper.writeStartElement(streamWriter, headerName) ;
-        
-        writeMessageHeaders(streamWriter) ;
-        
-        if (soapService != null)
-        {
-            final Map headerHandlers = soapService.getHeaderHandlers() ;
-            final Iterator headerHandlerEntryIterator = headerHandlers.entrySet().iterator() ;
-            while(headerHandlerEntryIterator.hasNext())
-            {
-                final Map.Entry entry = (Map.Entry)headerHandlerEntryIterator.next() ;
-                final QName headerHandlerName = (QName)entry.getKey() ;
-                final HeaderHandler headerHandler = (HeaderHandler)entry.getValue() ;
-                headerHandler.writeContent(streamWriter, headerHandlerName, messageContext, soapDetails) ;
-            }
-        }
-        
-        StreamHelper.writeEndElement(streamWriter, headerName.getPrefix(), headerNamespace) ;
-    }
-    
-    /**
-     * Output the body to the stream writer.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException If errors occur during output.
-     */
-    private void writeBody(final XMLStreamWriter streamWriter)
-        throws XMLStreamException
-    {
-        final QName bodyName = getQualifiedName(SoapConstants.SOAP_BODY_NAME) ;
-        final String bodyNamespace = StreamHelper.writeStartElement(streamWriter, bodyName) ;
-        
-        writeMessageBody(streamWriter) ;
-        
-        StreamHelper.writeEndElement(streamWriter, bodyName.getPrefix(), bodyNamespace) ;
-    }
-    
-    /**
-     * Get the SOAP qualified name.
-     * @param localName The local name.
-     * @return The SOAP qualified name.
-     */
-    protected QName getQualifiedName(final String localName)
-    {
-        return new QName(soapDetails.getNamespaceURI(), localName,
-            SoapConstants.SOAP_PREFIX) ;
-    }
-    
-    /**
-     * Get the SOAP details associated with this message.
-     * @return The SOAP details.
-     */
-    public SoapDetails getSoapDetails()
-    {
-        return soapDetails ;
-    }
-    
-    /**
-     * Get the SOAP service associated with this message.
-     * @return The SOAP service or null if not known.
-     */
-    public SoapService getSoapService()
-    {
-        return soapService ;
-    }
-    
-    /**
-     * Get the message context associated with this message.
-     * @return The message context or null if not known.
-     */
-    public MessageContext getMessageContext()
-    {
-        return messageContext ;
-    }
-    
-    /**
-     * Write the headers specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected abstract void writeMessageHeaders(final XMLStreamWriter streamWriter)
-        throws XMLStreamException ;
-    
-    /**
-     * Write the body specific to the message.
-     * @param streamWriter The stream writer.
-     * @throws XMLStreamException For errors during writing.
-     */
-    protected abstract void writeMessageBody(final XMLStreamWriter streamWriter)
-        throws XMLStreamException ;
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapNotUnderstoodType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapNotUnderstoodType.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapNotUnderstoodType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,144 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.ElementContent;
-import com.arjuna.webservices.util.QNameHelper;
-import com.arjuna.webservices.util.StreamHelper;
-
-/**
- * Representation of the NotUnderstood header element.
- * @author kevin
- */
-public class SoapNotUnderstoodType extends ElementContent
-{
-    /**
-     * The local name of the qname.
-     */
-    private static final String QNAME_LOCAL_NAME = "qname" ;
-    /**
-     * The qualified name of the qname.
-     */
-    private static final QName QNAME_NAME = new QName(QNAME_LOCAL_NAME) ;
-        
-    /**
-     * The value of the qName.
-     */
-    private QName qName ;
-    
-    /**
-     * Construct the NotUnderstood type.
-     * @param qName The header qualified name.
-     */
-    public SoapNotUnderstoodType(final QName qName)
-    {
-        this.qName = qName ;
-    }
-    
-    /**
-     * Construct the NotUnderstood from the input stream.
-     * @param in The input stream.
-     * @throws XMLStreamException for parsing errors.
-     */
-    public SoapNotUnderstoodType(final XMLStreamReader in)
-        throws XMLStreamException
-    {
-        parse(in) ;
-    }
-    
-    /**
-     * Add the element.
-     * @param in The current input stream.
-     * @param elementName The qualified element name.
-     * @message com.arjuna.webservices.soap.SoapNotUnderstoodType_1 [com.arjuna.webservices.soap.SoapNotUnderstoodType_1] - NotUnderstood elements cannot have embedded elements.
-     */
-    protected void putElement(final XMLStreamReader in,
-        final QName elementName)
-        throws XMLStreamException
-    {
-        throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapNotUnderstoodType_1")) ;
-    }
-    
-    /**
-     * Add the attribute value.
-     * @param in The current input stream.
-     * @param attributeName The qualified attribute name.
-     * @param attributeValue The qualified attibute value.
-     */
-    protected void putAttribute(final XMLStreamReader in,
-        final QName attributeName, final String attributeValue)
-        throws XMLStreamException
-    {
-        final String namespaceURI = attributeName.getNamespaceURI() ;
-        if (((namespaceURI == null) || (namespaceURI.length() == 0)) &&
-            QNAME_LOCAL_NAME.equals(attributeName.getLocalPart()))
-        {
-            setQName(QNameHelper.toQName(in.getNamespaceContext(), attributeValue)) ;
-        }
-        else
-        {
-            super.putAttribute(in, attributeName, attributeValue) ;
-        }
-    }
-    
-    /**
-     * Set the qName of this element.
-     * @param qName The qName of the element.
-     */
-    public void setQName(final QName qName)
-    {
-        this.qName = qName ;
-    }
-    
-    /**
-     * Get the qName of this element.
-     * @return The qName of the element or null if not set.
-     */
-    public QName getQName()
-    {
-        return qName ;
-    }
-    
-    /**
-     * Write the attributes of the element.
-     * @param out The output stream.
-     */
-    protected void writeAttributes(final XMLStreamWriter out)
-        throws XMLStreamException
-    {
-        StreamHelper.writeAttribute(out, QNAME_NAME, qName) ;
-    }
-    
-    /**
-     * Is the configuration of this element valid?
-     * @return true if valid, false otherwise.
-     */
-    public boolean isValid()
-    {
-        return (qName != null) && super.isValid() ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapParser.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapParser.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapParser.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,361 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.BodyHandler;
-import com.arjuna.webservices.HeaderHandler;
-import com.arjuna.webservices.InterceptorChain;
-import com.arjuna.webservices.InterceptorHandler;
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.SoapBody;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.SoapService;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.ElementConsumer;
-import com.arjuna.webservices.util.StreamHelper;
-
-/**
- * Utility class for SOAP parsing.
- * @author kevin
- */
-public class SoapParser
-{
-    /**
-     * Handle the processing of the SOAP request.
-     * @param messageContext The current message context.
-     * @param messageResponseContext The current message response context.
-     * @param action The transport SOAP action.
-     * @param streamReader The XML stream reader.
-     * @param soapService The SOAP service.
-     * @param soapDetails The SOAP details.
-     * @return The SOAP response.
-     * @throws XMLStreamException For XML parsing errors.
-     * @throws SoapFault For SOAP processing errors.
-     * 
-     * @message com.arjuna.webservices.soap.SoapParser_1 [com.arjuna.webservices.soap.SoapParser_1] - Unexpected element: {0}
-     * @message com.arjuna.webservices.soap.SoapParser_2 [com.arjuna.webservices.soap.SoapParser_2] - Unexpected body element: {0}
-     */
-    public static SoapBody parse(final MessageContext messageContext, final MessageContext messageResponseContext,
-        final String action, final XMLStreamReader streamReader, final SoapService soapService,
-        final SoapDetails soapDetails)
-        throws XMLStreamException, SoapFault
-    {
-        StreamHelper.skipToStartElement(streamReader) ;
-        if (!(SoapConstants.SOAP_ENVELOPE_NAME.equals(streamReader.getLocalName()) &&
-            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI())))
-        {
-            throw new SoapFault(SoapFaultType.FAULT_VERSION_MISMATCH,
-                streamReader.getName().toString()) ;
-        }
-        
-        StreamHelper.skipToNextStartElement(streamReader) ;
-        
-        if (SoapConstants.SOAP_HEADER_NAME.equals(streamReader.getLocalName()) &&
-            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI()))
-        {
-            handleHeaders(messageContext, streamReader, soapService, soapDetails) ;
-            streamReader.require(XMLStreamConstants.END_ELEMENT,
-                soapDetails.getNamespaceURI(), SoapConstants.SOAP_HEADER_NAME) ;
-            StreamHelper.skipToNextStartElement(streamReader) ;
-        }
-        
-        if (!(SoapConstants.SOAP_BODY_NAME.equals(streamReader.getLocalName()) &&
-            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI())))
-        {
-            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_1") ;
-            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-            throw new SoapFault(SoapFaultType.FAULT_SENDER, message) ;
-        }
-        
-        StreamHelper.skipToNextStartElement(streamReader) ;
-        final QName bodyName = streamReader.getName() ;
-        final BodyHandler bodyHandler ;
-        final BodyHandler namedBodyHandler = soapService.getBodyHandler(bodyName) ;
-        if (namedBodyHandler == null)
-        {
-            if (!bodyName.equals(soapDetails.getFaultName()))
-            {
-                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_2") ;
-                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                throw new SoapFault(SoapFaultType.FAULT_SENDER, message) ;
-            }
-            bodyHandler = soapService.getFaultHandler() ;
-        }
-        else
-        {
-            bodyHandler = namedBodyHandler ;
-        }
-        
-        final Set interceptorHandlers = soapService.getInterceptorHandlers() ;
-        try
-        {
-            if (interceptorHandlers.size() > 0)
-            {
-                final Iterator interceptorHandlerIter = interceptorHandlers.iterator() ;
-                InterceptorChain interceptorChain = new InterceptorBodyHandler(bodyHandler) ;
-                do
-                {
-                    final InterceptorHandler handler = (InterceptorHandler)interceptorHandlerIter.next();
-                    interceptorChain = new InterceptorChainHandler(interceptorChain, handler) ;
-                }
-                while (interceptorHandlerIter.hasNext()) ;
-                
-                return interceptorChain.invokeNext(soapService, soapDetails, messageContext, messageResponseContext, action, streamReader) ;
-            }
-            else
-            {
-                return bodyHandler.invoke(soapDetails, messageContext, messageResponseContext, action, streamReader) ;
-            }
-        }
-        catch (final SoapFault sf)
-        {
-            throw sf ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SoapFault(th) ;
-        }
-    }
-    
-    /**
-     * Handle the processing of the headers.
-     * @param messageContext The current message context.
-     * @param streamReader The XML stream reader.
-     * @param soapService The SOAP service.
-     * @param soapDetails The SOAP details.
-     * @throws XMLStreamException For XML parsing errors.
-     * @throws SoapFault For SOAP processing errors. 
-     */
-    private static void handleHeaders(final MessageContext messageContext, final XMLStreamReader streamReader,
-            final SoapService soapService, final SoapDetails soapDetails)
-        throws XMLStreamException, SoapFault
-    {
-        boolean finished = false ;
-        final LinkedList handlers = new LinkedList() ;
-        try
-        {
-            do
-            {
-                streamReader.nextTag() ;
-                if (streamReader.isEndElement())
-                {
-                    finished = true ;
-                }
-                else
-                {
-                    final String role = streamReader.getAttributeValue(soapDetails.getNamespaceURI(), soapDetails.getRoleLocalName()) ;
-                    if ((role == null) || role.equals(soapDetails.getLastRole()) ||
-                        role.equals(soapDetails.getNextRole()))
-                    {
-                        final QName headerName = streamReader.getName() ;
-                        final HeaderHandler headerHandler = soapService.getHeaderHandler(headerName) ;
-                        if (headerHandler == null)
-                        {
-                            checkMustUnderstand(streamReader, soapDetails) ;
-                            ElementConsumer.consume(streamReader) ;
-                        }
-                        else
-                        {
-                            headerHandler.invoke(streamReader, messageContext) ;
-                            handlers.add(headerHandler) ;
-                        }
-                        streamReader.require(XMLStreamConstants.END_ELEMENT,
-                                headerName.getNamespaceURI(), headerName.getLocalPart()) ;
-                    }
-                    else
-                    {
-                        ElementConsumer.consume(streamReader) ;
-                    }
-                }
-            }
-            while(!finished) ;
-            
-            final Map headerHandlers = soapService.getHeaderHandlers() ;
-            final Iterator headerHandlerIter = headerHandlers.values().iterator() ;
-            while(headerHandlerIter.hasNext())
-            {
-                final HeaderHandler handler = (HeaderHandler)headerHandlerIter.next() ;
-                handler.headerValidate(messageContext) ;
-            }
-        }
-        catch (final Throwable th)
-        {
-            final int numHandlers = handlers.size() ;
-            if (numHandlers > 0)
-            {
-                final ListIterator listIterator = handlers.listIterator(numHandlers) ;
-                do
-                {
-                    final HeaderHandler headerHandler = (HeaderHandler)listIterator.previous() ;
-                    headerHandler.headerFaultNotification(messageContext) ;
-                }
-                while(listIterator.hasPrevious()) ;
-            }
-            
-            if (th instanceof XMLStreamException)
-            {
-                throw (XMLStreamException)th ;
-            }
-            else if (th instanceof SoapFault)
-            {
-                final SoapFault soapFault = (SoapFault)th ;
-                soapFault.setHeaderFault(true) ;
-                throw soapFault ;
-            }
-            else if (th instanceof RuntimeException)
-            {
-                throw (RuntimeException)th ;
-            }
-            else
-            {
-                throw (Error)th ;
-            }
-        }
-    }
-    
-    /**
-     * Check the existence of the must understand parameter.
-     * @param streamReader
-     * @param soapDetails
-     * @throws XMLStreamException
-     * @throws SoapFault
-     * 
-     * @message com.arjuna.webservices.soap.SoapParser_3 [com.arjuna.webservices.soap.SoapParser_3] - Did not understand header: {0}
-     */
-    private static void checkMustUnderstand(final XMLStreamReader streamReader, final SoapDetails soapDetails)
-        throws XMLStreamException, SoapFault
-    {
-        final String mustUnderstand = streamReader.getAttributeValue(soapDetails.getNamespaceURI(),
-            SoapConstants.SOAP_MUST_UNDERSTAND_NAME) ;
-        if ((mustUnderstand != null) && ("1".equals(mustUnderstand) || "true".equalsIgnoreCase(mustUnderstand)))
-        {
-            final QName headerName = streamReader.getName() ;
-            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_3") ;
-            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-            final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_MUST_UNDERSTAND, message) ;
-            soapFault.setHeaderElements(soapDetails.getMustUnderstandHeaders(headerName)) ;
-            throw soapFault ;
-        }
-    }
-    
-    /**
-     * The interceptor chain for processing the terminal body handler.
-     * @author kevin
-     */
-    private static class InterceptorBodyHandler implements InterceptorChain
-    {
-        /**
-         * The body handler.
-         */
-        private final BodyHandler bodyHandler ;
-        
-        /**
-         * Construct the interceptor body handler.
-         * @param bodyHandler The body handler.
-         */
-        InterceptorBodyHandler(final BodyHandler bodyHandler)
-        {
-            this.bodyHandler = bodyHandler ;
-        }
-        
-        /**
-         * Invoke the next interceptor in the chain.
-         * @param soapService The SOAP service being called.
-         * @param soapDetails The SOAP details.
-         * @param context The current message context.
-         * @param responseContext The response message context.
-         * @param action The transport SOAP action.
-         * @param in The current stream reader.
-         * @throws XMLStreamException for parsing errors.
-         * @throws SoapFault for processing errors.
-         * @return The response elements or null if one way.
-         */
-        public SoapBody invokeNext(final SoapService soapService,
-            final SoapDetails soapDetails, final MessageContext context,
-            final MessageContext responseContext, final String action,
-            final XMLStreamReader in)
-            throws XMLStreamException, SoapFault
-        {
-            return bodyHandler.invoke(soapDetails, context, responseContext, action, in) ;
-        }
-    }
-    
-    /**
-     * The interceptor chain for processing interceptor handlers.
-     * @author kevin
-     */
-    private static class InterceptorChainHandler implements InterceptorChain
-    {
-        /**
-         * The interceptor chain handler.
-         */
-        private final InterceptorChain interceptorChain ;
-        /**
-         * The interceptor handler.
-         */
-        private final InterceptorHandler interceptorHandler ;
-        
-        /**
-         * Construct the interceptor chain handler.
-         * @param interceptorChain The interceptor chain handler.
-         * @param interceptorHandler The interceptor handler.
-         */
-        InterceptorChainHandler(final InterceptorChain interceptorChain, final InterceptorHandler interceptorHandler)
-        {
-            this.interceptorChain = interceptorChain ;
-            this.interceptorHandler = interceptorHandler ;
-        }
-        
-        /**
-         * Invoke the next interceptor in the chain.
-         * @param soapService The SOAP service being called.
-         * @param soapDetails The SOAP details.
-         * @param context The current message context.
-         * @param responseContext The response message context.
-         * @param action The transport SOAP action.
-         * @param in The current stream reader.
-         * @throws XMLStreamException for parsing errors.
-         * @throws SoapFault for processing errors.
-         * @return The response elements or null if one way.
-         */
-        public SoapBody invokeNext(final SoapService soapService,
-            final SoapDetails soapDetails, final MessageContext context,
-            final MessageContext responseContext, final String action,
-            final XMLStreamReader in)
-            throws XMLStreamException, SoapFault
-        {
-            return interceptorHandler.invoke(interceptorChain, soapService, soapDetails, context, responseContext, action, in) ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapProcessorImpl.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,99 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.soap;
-
-import java.io.IOException;
-import java.io.Reader;
-
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.SoapBody;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapMessage;
-import com.arjuna.webservices.SoapProcessor;
-import com.arjuna.webservices.SoapService;
-
-/**
- * The SOAP processor implementation.
- * @author kevin
- */
-public class SoapProcessorImpl implements SoapProcessor
-{
-    /**
-     * The SOAP service associated with this processor.
-     */
-    private final SoapService soapService ;
-    /**
-     * The SOAP details associated with this processor.
-     */
-    private final SoapDetails soapDetails ;
-    
-    /**
-     * Create the SOAP processor for the specific SOAP service and details.
-     * @param soapService The SOAP service.
-     * @param soapDetails The SOAP details.
-     */
-    public SoapProcessorImpl(final SoapService soapService, final SoapDetails soapDetails)
-    {
-        this.soapService = soapService ;
-        this.soapDetails = soapDetails ;
-    }
-    
-    /**
-     * Process the input stream and generate a response.
-     * @param messageContext The message context for the request.
-     * @param messageResponseContext The message context for the response.
-     * @param action The transport SOAP action.
-     * @param reader The input reader.
-     * @return The SOAP response.
-     * @throws IOException For errors reading the input stream.
-     */
-    public SoapMessage process(final MessageContext messageContext, final MessageContext messageResponseContext, final String action, final Reader reader)
-    {
-        try
-        {
-            final XMLStreamReader streamReader = SoapUtils.getXMLStreamReader(reader) ;
-            final SoapBody response = soapService.parse(messageContext, messageResponseContext, action, streamReader, soapDetails) ;
-            if (response == null)
-            {
-                return null ;
-            }
-            
-            return new SoapBodyMessage(response, soapDetails, soapService, messageResponseContext) ;
-        }
-        catch (final SoapFault sf)
-        {
-            if (sf.isHeaderFault())
-            {
-                return new SoapFaultMessage(sf, soapDetails, null, messageContext) ;
-            }
-            else
-            {
-                return new SoapFaultMessage(sf, soapDetails, soapService, messageResponseContext) ;
-            }
-        }
-        catch (final Throwable th)
-        {
-            return new SoapFaultMessage(new SoapFault(th), soapDetails) ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/StreamHelper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/StreamHelper.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/StreamHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,381 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.util;
-
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.ElementContent;
-
-/**
- * Helper class for Stream operations.
- * @author kevin
- * 
- * @message com.arjuna.webservices.util.StreamHelper_1 [com.arjuna.webservices.util.StreamHelper_1] - Unexpected end element: {0}
- * @message com.arjuna.webservices.util.StreamHelper_2 [com.arjuna.webservices.util.StreamHelper_2] - Unexpected end of document reached
- * @message com.arjuna.webservices.util.StreamHelper_3 [com.arjuna.webservices.util.StreamHelper_3] - Unexpected start element: {0}
- */
-public class StreamHelper
-{
-    /**
-     * Pseudo namespace used to unbind a prefix.
-     */
-    private static final String UNBOUND_NAMESPACE = "http://www.arjuna.com/stax/parsing/unboundnamespace" ;
-    
-    /**
-     * Write a start element with appropriate namespace declarations if necessary
-     * @param out The output stream.
-     * @param elementName The element name.
-     * @return The previous namespace if written, null otherwise.
-     * @throws XMLStreamException for errors during writing.
-     */
-    public static String writeStartElement(final XMLStreamWriter out, final QName elementName)
-        throws XMLStreamException
-    {
-        final String namespaceURI = QNameHelper.getNormalisedValue(elementName.getNamespaceURI()) ;
-        final String localName = elementName.getLocalPart() ;
-        
-        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
-        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
-        
-        if (writeNamespace)
-        {
-            final String prefix = QNameHelper.getNormalisedValue(elementName.getPrefix()) ;
-            final String origNamespace = QNameHelper.getNormalisedValue(namespaceContext.getNamespaceURI(prefix)) ;
-            if (prefix.length() == 0)
-            {
-                out.setDefaultNamespace(namespaceURI) ;
-                out.writeStartElement(namespaceURI, localName) ;
-                out.writeDefaultNamespace(namespaceURI) ;
-            }
-            else
-            {
-                out.setPrefix(prefix, namespaceURI) ;
-                out.writeStartElement(namespaceURI, localName) ;
-                out.writeNamespace(prefix, namespaceURI) ;
-            }
-            return origNamespace ;
-        }
-        else
-        {
-            out.writeStartElement(namespaceURI, localName) ;
-            return null ;
-        }
-    }
-    
-    /**
-     * Write an end element removing the namespace binding if necessary
-     * @param out The output stream.
-     * @param prefix The element prefix.
-     * @param namespaceURI The previous binding for the prefix.
-     * @throws XMLStreamException for errors during writing.
-     */
-    public static void writeEndElement(final XMLStreamWriter out, final String prefix,
-        final String namespaceURI)
-        throws XMLStreamException
-    {
-        out.writeEndElement() ;
-        if (namespaceURI != null)
-        {
-            final String resetNamespace = (namespaceURI.length() == 0 ? UNBOUND_NAMESPACE : namespaceURI) ;
-            
-            if (prefix.length() == 0)
-            {
-                out.setDefaultNamespace(resetNamespace) ;
-            }
-            else
-            {
-                out.setPrefix(prefix, resetNamespace) ;
-            }
-        }
-    }
-    
-    /**
-     * Write the element to the stream.
-     * @param out The output stream.
-     * @param elementName The name of the element.
-     * @param elementContent The element contents.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeElement(final XMLStreamWriter out, final QName elementName,
-        final ElementContent elementContent)
-        throws XMLStreamException
-    {
-        final String origNamespace = writeStartElement(out, elementName) ;
-        elementContent.writeContent(out) ;
-        writeEndElement(out, elementName.getPrefix(), origNamespace) ;
-    }
-
-    /**
-     * Write the attributes to the stream.
-     * @param out The output stream.
-     * @param attributes The attributes.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeAttributes(final XMLStreamWriter out, final Map attributes)
-        throws XMLStreamException
-    {
-        final Set entrySet = attributes.entrySet() ;
-        final Iterator entryIter = entrySet.iterator() ;
-        while(entryIter.hasNext())
-        {
-            final Map.Entry entry = (Map.Entry)entryIter.next() ;
-            final QName name = (QName)entry.getKey() ;
-            final Object value = entry.getValue() ;
-            writeAttribute(out, name, value) ;
-        }
-    }
-    
-    /**
-     * Write the attribute to the stream.
-     * @param out The output stream.
-     * @param attributeName The attribute name.
-     * @param attributeValue The attribute value.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
-        final Object attributeValue)
-        throws XMLStreamException
-    {
-        if (attributeValue instanceof QName)
-        {
-            writeAttribute(out, attributeName, (QName)attributeValue) ;
-        }
-        else
-        {
-            writeAttribute(out, attributeName, attributeValue.toString()) ;
-        }
-    }
-    
-    /**
-     * Write the attribute to the stream.
-     * @param out The output stream.
-     * @param attributeName The attribute name.
-     * @param attributeValue The attribute value as a QName.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
-        final QName attributeValue)
-        throws XMLStreamException
-    {
-        final String namespaceURI = QNameHelper.getNormalisedValue(attributeValue.getNamespaceURI()) ;
-        if (namespaceURI.length() == 0)
-        {
-            writeAttribute(out, attributeName, attributeValue.getLocalPart()) ;
-        }
-        else
-        {
-            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
-            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
-            
-            if (origPrefix == null)
-            {
-                final String prefix = QNameHelper.getNormalisedValue(attributeValue.getPrefix()) ;
-                writeNamespace(out, prefix, namespaceURI) ;
-                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(attributeValue)) ;
-            }
-            else
-            {
-                // KEV must handle clashes with default namespace
-                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(origPrefix, attributeValue.getLocalPart())) ;
-            }
-        }
-    }
-    
-    /**
-     * Write the attribute to the stream.
-     * @param out The output stream.
-     * @param attributeName The attribute name.
-     * @param attributeValue The attribute value.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
-        final String attributeValue)
-        throws XMLStreamException
-    {
-        final String namespaceURI = QNameHelper.getNormalisedValue(attributeName.getNamespaceURI()) ;
-        final String localName = attributeName.getLocalPart() ;
-        
-        if (namespaceURI.length() == 0)
-        {
-            out.writeAttribute(localName, attributeValue) ;
-        }
-        else
-        {
-            // KEV must handle clashes with default namespace
-            final String prefix = QNameHelper.getNormalisedValue(attributeName.getPrefix()) ;
-            writeNamespace(out, prefix, namespaceURI) ;
-            out.writeAttribute(namespaceURI, localName, attributeValue) ;
-        }
-    }
-    
-    /**
-     * Write the QName to the stream as text.
-     * @param out The output stream.
-     * @param qName The qualified name.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeQualifiedName(final XMLStreamWriter out, final QName qName)
-        throws XMLStreamException
-    {
-        final String namespaceURI = QNameHelper.getNormalisedValue(qName.getNamespaceURI()) ;
-        
-        if (namespaceURI.length() == 0)
-        {
-            out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
-        }
-        else
-        {
-            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
-            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
-            
-            if (origPrefix == null)
-            {
-                final String prefix = QNameHelper.getNormalisedValue(qName.getPrefix()) ;
-                writeNamespace(out, prefix, namespaceURI) ;
-                out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
-            }
-            else
-            {
-                // KEV must handle clashes with default namespace
-                out.writeCharacters(QNameHelper.toQualifiedName(origPrefix, qName.getLocalPart())) ;
-            }
-        }
-    }
-    
-    /**
-     * Write the namespace if necessary.
-     * @param out The output stream.
-     * @param prefix The namespace prefix.
-     * @param namespaceURI The namespaceURI.
-     * @throws XMLStreamException Thrown for errors during writing.
-     */
-    public static void writeNamespace(final XMLStreamWriter out, final String prefix, final String namespaceURI)
-        throws XMLStreamException
-    {
-        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
-            
-        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
-        if (writeNamespace)
-        {
-            out.setPrefix(prefix, namespaceURI) ;
-            out.writeNamespace(prefix, namespaceURI) ;
-        }
-    }
-
-    /**
-     * Make sure the stream is at the start of the next element.
-     * @param streamReader The current stream reader.
-     * @throws XMLStreamException For parsing errors.
-     */
-    public static void skipToNextStartElement(final XMLStreamReader streamReader)
-        throws XMLStreamException
-    {
-        if (streamReader.hasNext())
-        {
-            streamReader.nextTag() ;
-            if (streamReader.isEndElement())
-            {
-                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_1") ;
-                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
-                throw new XMLStreamException(message) ;
-            }
-        }
-        else
-        {
-            throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
-        }
-    }
-
-    /**
-     * Make sure the stream is at the start of an element.
-     * @param streamReader The current stream reader.
-     * @throws XMLStreamException For parsing errors.
-     */
-    public static void skipToStartElement(final XMLStreamReader streamReader)
-        throws XMLStreamException
-    {
-        while (!streamReader.isStartElement())
-        {
-            if (streamReader.hasNext())
-            {
-                streamReader.next() ;
-            }
-            else
-            {
-                throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
-            }
-        }
-    }
-
-    /**
-     * Check the next start tag is as expected.
-     * @param streamReader The stream reader.
-     * @param expected The expected qualified name.
-     * @throws XMLStreamException For errors during parsing.
-     */
-    public static void checkNextStartTag(final XMLStreamReader streamReader, final QName expected)
-        throws XMLStreamException
-    {
-        skipToNextStartElement(streamReader) ;
-        checkTag(streamReader, expected) ;
-    }
-    
-    /**
-     * Compare the element tag with the expected qualified name.
-     * @param streamReader The current stream reader.
-     * @param expected The expected qualified name.
-     * @throws XMLStreamException For errors during parsing.
-     */
-    public static void checkTag(final XMLStreamReader streamReader, final QName expected)
-        throws XMLStreamException
-    {
-        final QName elementName = streamReader.getName() ;
-        if (!expected.equals(elementName))
-        {
-            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_3") ;
-            final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
-            throw new XMLStreamException(message) ;
-        }
-    }
-
-    /**
-     * Check to see if the parent element is finished.
-     * @param streamReader The stream reader.
-     * @return true if it is finished, false otherwise.
-     * @throws XMLStreamException For errors during parsing.
-     */
-    public static boolean checkParentFinished(final XMLStreamReader streamReader)
-        throws XMLStreamException
-    {
-        return (streamReader.nextTag() == XMLStreamConstants.END_ELEMENT) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContext.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,174 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.wsarj;
-
-import java.text.MessageFormat;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.MessageContext;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.AnyContentSupport;
-import com.arjuna.webservices.util.StreamHelper;
-
-/**
- * The arjuna context.
- * @author kevin
- */
-public class ArjunaContext extends AnyContentSupport
-{
-    /**
-     * The key used for the arjuna context within a message exchange.
-     */
-    private static final byte[] ARJUNA_CONTEXT_PROPERTY = new byte[0] ;
-    
-    /**
-     * The InstanceIdentifier header.
-     */
-    private InstanceIdentifier instanceIdentifier ;
-    
-    /**
-     * Default constructor.
-     */
-    private ArjunaContext()
-    {
-    }
-    
-    /**
-     * Construct an arjuna context from the input stream.
-     * N.B. This method is for testing purposes only.
-     * 
-     * @param in The input stream.
-     * @throws XMLStreamException For errors during parsing.
-     */
-    public ArjunaContext(final XMLStreamReader in)
-        throws XMLStreamException
-    {
-        parse(in) ;
-    }
-    
-    /**
-     * Get the instance identifier.
-     * @return The instance identifier.
-     */
-    public InstanceIdentifier getInstanceIdentifier()
-    {
-        return instanceIdentifier ;
-    }
-    
-    /**
-     * Set the instance identifier.
-     * @param instanceIdentifier The instance identifier.
-     */
-    public void setInstanceIdentifier(final InstanceIdentifier instanceIdentifier)
-    {
-        this.instanceIdentifier = instanceIdentifier ;
-    }
-    
-    /**
-     * Write the content of the context to the stream.
-     * @param out The current output stream.
-     * @message com.arjuna.webservices.wsarj.ArjunaContext_1 [com.arjuna.webservices.wsarj.ArjunaContext_1] - Arjuna context is not valid
-     */
-    public void writeChildContent(final XMLStreamWriter out)
-        throws XMLStreamException
-    {
-       if (!isValid())
-       {
-           throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_1")) ;
-       }
-       
-       StreamHelper.writeElement(out, ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME, instanceIdentifier) ;
-       
-       super.writeChildContent(out) ;
-    }
-
-    /**
-     * Add the element.
-     * @param in The current input stream.
-     * @param elementName The qualified element name.
-     * @message com.arjuna.webservices.wsarj.ArjunaContext_2 [com.arjuna.webservices.wsarj.ArjunaContext_2] - Unexpected element name: {0}
-     */
-    protected void putElement(final XMLStreamReader in,
-        final QName elementName)
-        throws XMLStreamException
-    {
-        if (ArjunaConstants.WSARJ_ATTRIBUTE_NAMESPACE.equals(elementName.getNamespaceURI()))
-        {
-            final String localPart = elementName.getLocalPart() ;
-            if (ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER.equals(localPart))
-            {
-                setInstanceIdentifier(new InstanceIdentifier(in)) ;
-            }
-            else
-            {
-                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_2") ;
-                final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
-                throw new XMLStreamException(message) ;
-            }
-        }
-        else
-        {
-            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_2") ;
-            final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
-            throw new XMLStreamException(message) ;
-        }
-    }
-    
-    /**
-     * Is the configuration of this element valid?
-     * @return true if valid, false otherwise.
-     */
-    public boolean isValid()
-    {
-        return ((instanceIdentifier != null) && instanceIdentifier.isValid()) ;
-    }
-
-    /**
-     * Get the arjuna context from the message context if present.
-     * @param messageContext The message context.
-     * @return The arjuna context or null if not present.
-     */
-    public static ArjunaContext getCurrentContext(final MessageContext messageContext)
-    {
-        return (ArjunaContext)messageContext.getProperty(ARJUNA_CONTEXT_PROPERTY) ;
-    }
-
-    /**
-     * Get the arjuna context from the message context.
-     * @param messageContext The message context.
-     * @return The arjuna context.
-     */
-    public static ArjunaContext getContext(final MessageContext messageContext)
-    {
-        final ArjunaContext current = (ArjunaContext)messageContext.getProperty(ARJUNA_CONTEXT_PROPERTY) ;
-        if (current != null)
-        {
-            return current ;
-        }
-        final ArjunaContext newContext = new ArjunaContext() ;
-        messageContext.setProperty(ARJUNA_CONTEXT_PROPERTY, newContext) ;
-        return newContext ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/InstanceIdentifier.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/InstanceIdentifier.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/InstanceIdentifier.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,161 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.wsarj;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.stax.ElementContent;
-import com.arjuna.webservices.stax.NamedElement;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-
-/**
- * Representation of an InstanceIdentifier element.
- * @author kevin
- */
-public class InstanceIdentifier extends ElementContent
-{
-    /**
-     * The instance identifier.
-     */
-    private String instanceIdentifier ;
-    
-    /**
-     * Default constructor.
-     */
-    public InstanceIdentifier()
-    {
-    }
-    
-    /**
-     * Construct an instance identifier with the specific identifier
-     * @param instanceIdentifier The instance identifier.
-     */
-    public InstanceIdentifier(final String instanceIdentifier)
-    {
-        this.instanceIdentifier = instanceIdentifier ;
-    }
-    
-    /**
-     * Construct the InstanceIdentifier from the input stream.
-     * @param in The input stream.
-     * @throws XMLStreamException for parsing errors.
-     */
-    public InstanceIdentifier(final XMLStreamReader in)
-        throws XMLStreamException
-    {
-        parse(in) ;
-    }
-    
-    /**
-     * Add the element.
-     * @param in The current input stream.
-     * @param elementName The qualified element name.
-     * @message com.arjuna.webservices.wsarj.InstanceIdentifier_1 [com.arjuna.webservices.wsarj.InstanceIdentifier_1] - InstanceIdentifier elements cannot have embedded elements.
-     */
-    protected void putElement(final XMLStreamReader in,
-        final QName elementName)
-        throws XMLStreamException
-    {
-        throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.InstanceIdentifier_1")) ;
-    }
-    
-    /**
-     * Set the text value of this element.
-     * @param in The current input stream.
-     * @param value The text value of this element.
-     */
-    protected void putValue(final XMLStreamReader in, final String value)
-        throws XMLStreamException
-    {
-        instanceIdentifier = value ;
-    }
-    
-    /**
-     * Set the instance identifier of this element.
-     * @param instanceIdentifier The instance identifier of the element.
-     */
-    public void setInstanceIdentifier(final String instanceIdentifier)
-    {
-        this.instanceIdentifier = instanceIdentifier ;
-    }
-    
-    /**
-     * Get the instance identifier of this element.
-     * @return The instance identifier of the element or null if not set.
-     */
-    public String getInstanceIdentifier()
-    {
-        return instanceIdentifier ;
-    }
-    
-    /**
-     * Write the child content of the element.
-     * @param out The output stream.
-     */
-    protected void writeChildContent(final XMLStreamWriter out)
-        throws XMLStreamException
-    {
-        out.writeCharacters(instanceIdentifier) ;
-    }
-    
-    /**
-     * Is the configuration of this element valid?
-     * @return true if valid, false otherwise.
-     */
-    public boolean isValid()
-    {
-        return (instanceIdentifier != null) && (instanceIdentifier.trim().length() > 0)
-            && super.isValid() ;
-    }
-    
-    /**
-     * Get a string representation of this instance identifier.
-     * @return the string representation.
-     */
-    public String toString()
-    {
-        return (instanceIdentifier != null ? instanceIdentifier : "") ;
-    }
-    
-    /**
-     * Set the identifier on the endpoint reference.
-     * @param endpointReference The endpoint reference.
-     * @param identifier The identifier.
-     */
-    public static void setEndpointInstanceIdentifier(final EndpointReferenceType endpointReference, final String identifier)
-    {
-        setEndpointInstanceIdentifier(endpointReference, new InstanceIdentifier(identifier)) ;
-    }
-    
-    /**
-     * Set the identifier on the endpoint reference.
-     * @param endpointReference The endpoint reference.
-     * @param instanceIdentifier The identifier.
-     */
-    public static void setEndpointInstanceIdentifier(final EndpointReferenceType endpointReference, final InstanceIdentifier instanceIdentifier)
-    {
-        endpointReference.addReferenceParameter(new NamedElement(ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME, instanceIdentifier)) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinator.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,159 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.wsc;
-
-import java.io.IOException;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.wsaddr.AddressingContext;
-import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.webservices.wscoor.CreateCoordinationContextResponseType;
-import com.arjuna.webservices.wscoor.client.ActivationCoordinatorClient;
-import com.arjuna.webservices.wscoor.processors.ActivationRequesterCallback;
-import com.arjuna.webservices.wscoor.processors.ActivationRequesterProcessor;
-
-/**
- * Wrapper around low level Activation Coordinator messaging.
- * @author kevin
- */
-public class ActivationCoordinator
-{
-    /**
-     * Create the coordination context.
-     * @param activationCoordinatorURI The URI of the activation coordinator.
-     * @param messageID The messageID to use.
-     * @param coordinationTypeURI The coordination type.
-     * @param expires The expiry time or null.
-     * @param currentContext The currnt context or null.
-     * @return The coordination context.
-     * @throws InvalidCreateParametersException if the create parameters are invalid.
-     * @throws SoapFault for errors during processing.
-     * 
-     * @message com.arjuna.wsc.ActivationCoordinator_1 [com.arjuna.wsc.ActivationCoordinator_1] - Callback execution failed
-     * @message com.arjuna.wsc.ActivationCoordinator_2 [com.arjuna.wsc.ActivationCoordinator_2] - Callback wasn't triggered
-     */
-    public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI,
-        final String messageID, final String coordinationTypeURI, final Long expires,
-        final CoordinationContextType currentContext)
-        throws InvalidCreateParametersException, SoapFault
-    {
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(activationCoordinatorURI, messageID) ;
-        
-        final AttributedUnsignedIntType expiresValue = (expires == null ? null : new AttributedUnsignedIntType(expires.longValue())) ;
-        final RequestCallback callback = new RequestCallback() ;
-        final ActivationRequesterProcessor activationRequester = ActivationRequesterProcessor.getRequester() ;
-        activationRequester.registerCallback(messageID, callback) ;
-        try
-        {
-            ActivationCoordinatorClient.getClient().sendCreateCoordination(addressingContext,
-                    coordinationTypeURI, expiresValue, null) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final IOException ioe)
-        {
-            throw new SoapFault(ioe) ;
-        }
-        finally
-        {
-            activationRequester.removeCallback(messageID) ;
-        }
-        
-        if (callback.hasFailed())
-        {
-            throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.ActivationCoordinator_1")) ;
-        }
-        else if (!callback.hasTriggered())
-        {
-            throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.ActivationCoordinator_2")) ;
-        }
-        
-        final CreateCoordinationContextResponseType response = callback.getCreateCoordinationContextResponse() ;
-        if (response != null)
-        {
-            return response.getCoordinationContext() ;
-        }
-        final SoapFault soapFault = callback.getSoapFault() ;
-        if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(soapFault.getSubcode()))
-        {
-            throw new InvalidCreateParametersException(soapFault.getReason()) ;
-        }
-        throw soapFault ;
-    }
-    
-    /**
-     * The request callback.
-     * @author kevin
-     */
-    private static final class RequestCallback extends ActivationRequesterCallback
-    {
-        /**
-         * The response.
-         */
-        private CreateCoordinationContextResponseType createCoordinationContextResponse ;
-        /**
-         * The SOAP fault.
-         */
-        private SoapFault soapFault ;
-        
-        /**
-         * A create coordination context response.
-         * @param createCoordinationContextResponse The response.
-         * @param addressingContext The current addressing context.
-         */
-        public void createCoordinationContextResponse(final CreateCoordinationContextResponseType createCoordinationContextResponse,
-            final AddressingContext addressingContext)
-        {
-            this.createCoordinationContextResponse = createCoordinationContextResponse ;
-        }
-
-        /**
-         * A SOAP fault response.
-         * @param soapFault The SOAP fault response.
-         * @param addressingContext The current addressing context.
-         */
-        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext)
-        {
-            this.soapFault = soapFault ;
-        }
-        
-        /**
-         * Get the create coordination context response.
-         * @return The create coordination context response.
-         */
-        CreateCoordinationContextResponseType getCreateCoordinationContextResponse()
-        {
-            return createCoordinationContextResponse ;
-        }
-        
-        /**
-         * Get the SOAP fault.
-         * @return The SOAP fault or null.
-         */
-        SoapFault getSoapFault()
-        {
-            return soapFault ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,69 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * ContextFactory.java
- */
-
-package com.arjuna.wsc;
-
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-public interface ContextFactory
-{
-    /**
-     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
-     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
-     * protocol identifiers.
-     *
-     * @param coordinationTypeURI the coordination type uri
-     */
-	
-    public void install(final String coordinationTypeURI);
-
-    /**
-     * Creates a coordination context.
-     *
-     * @param coordinationTypeURI the coordination type uri
-     * @param expires the expire date/time for the returned context, can be null
-     * @param currentContext the current coordination context, can be null
-     *
-     * @return the created coordination context
-     *
-     * @throws InvalidCreateParametersException if a parameter passed is invalid
-     *         this activity identifier
-     */
-	
-    public CoordinationContextType create(final String coordinationTypeURI,
-            final Long expires, final CoordinationContextType currentContext)
-        throws InvalidCreateParametersException;
-
-    /**
-     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
-     * times if the context factory is removed from multiple context factory mappers or from the same context factory
-     * mapper with different coordination type uris.
-     *
-     * @param coordinationTypeURI the coordination type uri
-     */
-	
-    public void uninstall(final String coordinationTypeURI);
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactoryMapper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactoryMapper.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactoryMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,165 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * ContextFactoryMapper.java
- */
-
-package com.arjuna.wsc;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The context factory mapper.
- * @author kevin
- */
-public class ContextFactoryMapper
-{
-    /**
-     * The factory singleton.
-     */
-    private static final ContextFactoryMapper FACTORY = new ContextFactoryMapper() ;
-    
-    /**
-     * The context factory map.
-     */
-    private final Map contextFactoryMap = new HashMap() ;
-    /**
-     * The subordinate context factory mapper.
-     */
-    private ContextFactoryMapper subordinateContextFactoryMapper ;
-    /**
-     * The default context factory.
-     */
-    private ContextFactory defaultContextFactory ;
-    
-    /**
-     * Get the context factory mapper singleton.
-     * @return The context factory mapper singleton.
-     */
-    public static ContextFactoryMapper getFactory()
-    {
-        return FACTORY ;
-    }
-    
-    /**
-     * Default constructor
-     */
-    protected ContextFactoryMapper()
-    {
-    }
-    
-    /**
-     * Add a context factory for the specified coordination type.
-     * @param coordinationTypeURI The coordination type.
-     * @param contextFactory The context factory.
-     */
-    public void addContextFactory(final String coordinationTypeURI, final ContextFactory contextFactory)
-    {
-        synchronized(contextFactoryMap)
-        {
-            contextFactoryMap.put(coordinationTypeURI, contextFactory) ;
-        }
-        contextFactory.install(coordinationTypeURI) ;
-    }
-
-    /**
-     * Get the context factory for the specified coordination type.
-     * @param coordinationTypeURI The coordination type.
-     * @return The context factory.
-     */
-    public ContextFactory getContextFactory(final String coordinationTypeURI)
-    {
-        final Object localContextFactory ;
-        synchronized(contextFactoryMap)
-        {
-            localContextFactory = contextFactoryMap.get(coordinationTypeURI) ;
-        }
-        if (localContextFactory != null)
-        {
-            return (ContextFactory)localContextFactory ;
-        }
-        if (subordinateContextFactoryMapper != null)
-        {
-            final ContextFactory subordinateContextFactory = subordinateContextFactoryMapper.getContextFactory(coordinationTypeURI) ;
-            if (subordinateContextFactory != null)
-            {
-                return subordinateContextFactory ;
-            }
-        }
-        return defaultContextFactory ;
-    }
-
-    /**
-     * Remove the context factory for the specified coordination type.
-     * @param coordinationTypeURI The coordination type.
-     */
-    public void removeContextFactory(final String coordinationTypeURI)
-    {
-        final Object localContextFactory ;
-        synchronized(contextFactoryMap)
-        {
-            localContextFactory = contextFactoryMap.remove(coordinationTypeURI) ;
-        }
-        if (localContextFactory != null)
-        {
-            ((ContextFactory)localContextFactory).uninstall(coordinationTypeURI) ;
-        }
-    }
-
-    /**
-     * Get the subordinate coordination factory mapper.
-     * @return The subordinate coordination factory mapper.
-     */
-    public ContextFactoryMapper getSubordinateContextFactoryMapper()
-    {
-        return subordinateContextFactoryMapper ;
-    }
-
-    /**
-     * Set a subordinate coordination factory mapper.
-     * @param subordinateContextFactoryMapper The subordinate coordination factory mapper.
-     */
-    public void setSubordinateContextFactoryMapper(final ContextFactoryMapper subordinateContextFactoryMapper)
-    {
-        this.subordinateContextFactoryMapper = subordinateContextFactoryMapper ;
-    }
-
-    /**
-     * Get the default coordination factory.
-     * @return The default coordination factory.
-     */
-    public ContextFactory getDefaultContextFactory()
-    {
-        return defaultContextFactory ;
-    }
-
-    /**
-     * Set the default coordination factory.
-     * @param defaultContextFactory The default coordination factory.
-     */
-    public void setDefaultContextFactory(final ContextFactory defaultContextFactory)
-    {
-        this.defaultContextFactory = defaultContextFactory ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/Registrar.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/Registrar.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/Registrar.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,71 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * Registrar.java
- */
-
-package com.arjuna.wsc;
-
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-
-public interface Registrar
-{
-    /**
-     * Called when a registrar is added to a register mapper. This method will be called multiple times if the
-     * registrar is added to multiple register mappers or to the same register mapper with different protocol
-     * identifiers.
-     *
-     * @param protocolIdentifier the protocol identifier
-     */
-    public void install(final String protocolIdentifier);
-
-    /**
-     * Registers the interest of participant in a particular protocol.
-     *
-     * @param participantProtocolService the port reference of the participant protocol service
-     * @param protocolIdentifier the protocol identifier
-     * @param instanceIdentifier the instance identifier, this may be null
-     *
-     * @return the port reference of the coordinator protocol service
-     *
-     * @throws AlreadyRegisteredException if the participant is already registered for this coordination protocol under
-     *         this activity identifier
-     * @throws InvalidProtocolException if the coordination protocol is not supported
-     * @throws InvalidStateException if the state of the coordinator no longer allows registration for this
-     *         coordination protocol
-     * @throws NoActivityException if the actvity does not exist
-     */
-    public EndpointReferenceType register(final EndpointReferenceType participantProtocolService,
-        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
-        throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException;
-
-    /**
-     * Called when a registrar is removed from a register mapper. This method will be called multiple times if the
-     * registrar is removed from multiple register mappers or from the same register mapper with different protocol
-     * identifiers.
-     *
-     * @param protocolIdentifier the protocol identifier
-     */
-    public void uninstall(final String protocolIdentifier);
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrarMapper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrarMapper.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrarMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,109 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * RegistrarMapper.java
- */
-
-package com.arjuna.wsc;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The registrar mapper.
- * @author kevin
- */
-public class RegistrarMapper
-{
-    /**
-     * The factory singleton.
-     */
-    private static final RegistrarMapper FACTORY = new RegistrarMapper() ;
-    
-    /**
-     * The registrar map.
-     */
-    private final Map registrarMap = new HashMap() ;
-    
-    /**
-     * Get the registrar mapper singleton.
-     * @return The registrar mapper singleton.
-     */
-    public static RegistrarMapper getFactory()
-    {
-        return FACTORY ;
-    }
-    
-    /**
-     * Default constructor
-     */
-    protected RegistrarMapper()
-    {
-    }
-    
-    /**
-     * Add a registrar for the specified protocol identifier.
-     * @param protocolIdentifier The protocol identifier.
-     * @param registrar The registrar.
-     */
-    public void addRegistrar(final String protocolIdentifier, final Registrar registrar)
-    {
-        synchronized(registrarMap)
-        {
-            registrarMap.put(protocolIdentifier, registrar) ;
-        }
-        registrar.install(protocolIdentifier) ;
-    }
-
-    /**
-     * Get the registrar for the specified protocol identifier.
-     * @param protocolIdentifier The protocol identifier.
-     * @return The registrar.
-     */
-    public Registrar getRegistrar(final String protocolIdentifier)
-    {
-        final Object localRegistrar ;
-        synchronized(registrarMap)
-        {
-            localRegistrar = registrarMap.get(protocolIdentifier) ;
-        }
-        return (Registrar)localRegistrar ;
-    }
-
-    /**
-     * Remove the registrar for the specified protocol identifier.
-     * @param protocolIdentifier The protocol identifier.
-     */
-    public void removeRegistrar(final String protocolIdentifier)
-    {
-        final Object localRegistrar ;
-        synchronized(registrarMap)
-        {
-            localRegistrar = registrarMap.remove(protocolIdentifier) ;
-        }
-        if (localRegistrar != null)
-        {
-            ((Registrar)localRegistrar).uninstall(protocolIdentifier) ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinator.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,177 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.wsc;
-
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.logging.WSCLogger;
-import com.arjuna.webservices.wsaddr.AddressingContext;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.webservices.wscoor.RegisterResponseType;
-import com.arjuna.webservices.wscoor.client.RegistrationCoordinatorClient;
-import com.arjuna.webservices.wscoor.processors.RegistrationRequesterCallback;
-import com.arjuna.webservices.wscoor.processors.RegistrationRequesterProcessor;
-
-
-/**
- * Wrapper around low level Registration Coordinator messaging.
- * @author kevin
- */
-public class RegistrationCoordinator
-{
-    /**
-     * Register the participant in the protocol.
-     * @param coordinationContext The current coordination context
-     * @param messageID The messageID to use.
-     * @param participantProtocolService The participant protocol service.
-     * @param protocolIdentifier The protocol identifier.
-     * @return The endpoint reference of the coordinator protocol service.
-     * @throws AlreadyRegisteredException If the participant is already registered. 
-     * @throws InvalidProtocolException If the protocol is unsupported.
-     * @throws InvalidStateException If the state is invalid
-     * @throws NoActivityException If there is to activity context active.
-     * @throws SoapFault for errors during processing.
-     * 
-     * @message com.arjuna.wsc.RegistrationCoordinator_1 [com.arjuna.wsc.RegistrationCoordinator_1] - Callback execution failed
-     * @message com.arjuna.wsc.RegistrationCoordinator_2 [com.arjuna.wsc.RegistrationCoordinator_2] - Callback wasn't triggered
-     */
-    public static EndpointReferenceType register(final CoordinationContextType coordinationContext,
-        final String messageID, final EndpointReferenceType participantProtocolService,
-        final String protocolIdentifier)
-        throws AlreadyRegisteredException, InvalidProtocolException,
-            InvalidStateException, NoActivityException, SoapFault
-    {
-        final EndpointReferenceType endpointReference = coordinationContext.getRegistrationService() ;
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(endpointReference, messageID) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final RegistrationRequesterProcessor registrationRequester = RegistrationRequesterProcessor.getRequester() ;
-        registrationRequester.registerCallback(messageID, callback) ;
-        try
-        {
-            RegistrationCoordinatorClient.getClient().sendRegister(addressingContext, protocolIdentifier, participantProtocolService) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final IOException ioe)
-        {
-            throw new SoapFault(ioe) ;
-        }
-        finally
-        {
-            registrationRequester.removeCallback(messageID) ;
-        }
-        
-        if (callback.hasFailed())
-        {
-            throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.RegistrationCoordinator_1")) ;
-        }
-        else if (!callback.hasTriggered())
-        {
-            throw new SoapFault(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.RegistrationCoordinator_2")) ;
-        }
-        
-        final RegisterResponseType response = callback.getRegisterResponse() ;
-        if (response != null)
-        {
-            return response.getCoordinatorProtocolService() ;
-        }
-        final SoapFault soapFault = callback.getSoapFault() ;
-        final QName subcode = soapFault.getSubcode() ;
-        if (CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME.equals(subcode))
-        {
-            throw new AlreadyRegisteredException(soapFault.getReason()) ;
-        }
-        else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode))
-        {
-            throw new InvalidProtocolException(soapFault.getReason()) ;
-        }
-        else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode))
-        {
-            throw new InvalidStateException(soapFault.getReason()) ;
-        }
-        else if (CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME.equals(subcode))
-        {
-            throw new NoActivityException(soapFault.getReason()) ;
-        }
-        throw soapFault ;
-    }
-    
-    /**
-     * The request callback.
-     * @author kevin
-     */
-    private static final class RequestCallback extends RegistrationRequesterCallback
-    {
-        /**
-         * The response.
-         */
-        private RegisterResponseType registerResponse ;
-        /**
-         * The SOAP fault.
-         */
-        private SoapFault soapFault ;
-        
-        /**
-         * A register response.
-         * @param registerResponse The response.
-         * @param addressingContext The current addressing context.
-         */
-        public void registerResponse(final RegisterResponseType registerResponse,
-            final AddressingContext addressingContext)
-        {
-            this.registerResponse = registerResponse ;
-        }
-
-        /**
-         * A SOAP fault response.
-         * @param soapFault The SOAP fault response.
-         * @param addressingContext The current addressing context.
-         */
-        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext)
-        {
-            this.soapFault = soapFault ;
-        }
-        
-        /**
-         * Get the create coordination context response.
-         * @return The create coordination context response.
-         */
-        RegisterResponseType getRegisterResponse()
-        {
-            return registerResponse ;
-        }
-        
-        /**
-         * Get the SOAP fault.
-         * @return The SOAP fault or null.
-         */
-        SoapFault getSoapFault()
-        {
-            return soapFault ;
-        }
-    }
-}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/BodyHandler.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/BodyHandler.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/BodyHandler.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/BodyHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.soap.SoapDetails;
+
+/**
+ * Interface for body handlers.
+ * @author kevin
+ */
+public interface BodyHandler
+{
+    /**
+     * Handle the body element.
+     * @param soapDetails The SOAP details.
+     * @param context The current message context.
+     * @param responseContext The response message context.
+     * @param action The transport SOAP action.
+     * @param in The current stream reader.
+     * @throws XMLStreamException for parsing errors.
+     * @throws SoapFault for processing errors.
+     * @return The response elements or null if one way.
+     */
+    public SoapBody invoke(final SoapDetails soapDetails,
+        final MessageContext context, final MessageContext responseContext,
+        final String action, final XMLStreamReader in)
+        throws XMLStreamException, SoapFault ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HandlerRegistry.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HandlerRegistry.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HandlerRegistry.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HandlerRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,174 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.util.InsertionOrderSet;
+
+/**
+ * The handler registry for a service.
+ * @author kevin
+ */
+public class HandlerRegistry
+{
+    /**
+     * The header handlers for the service.
+     */
+    private final Map headerHandlers = new HashMap() ;
+    /**
+     * The unmodifiable version of the header handlers.
+     */
+    private final Map unmodifiableHeaderHandlers = Collections.unmodifiableMap(headerHandlers) ;
+    /**
+     * The body handlers for the service.
+     */
+    private final Map bodyHandlers = new HashMap() ;
+    /**
+     * The handler for SOAP faults.
+     */
+    private BodyHandler faultHandler ;
+    /**
+     * The interceptor handlers for the service.
+     */
+    private final Set interceptorHandlers = new InsertionOrderSet() ;
+    /**
+     * The unmodifiable version of the interceptor handlers.
+     */
+    private final Set unmodifiableInterceptorHandlers = Collections.unmodifiableSet(interceptorHandlers) ;
+    
+    /**
+     * Register the header handler against the specified qualified name.
+     * @param headerName The qualified name of the header.
+     * @param handler The header handler.
+     */
+    public void registerHeaderHandler(final QName headerName, final HeaderHandler handler)
+    {
+        headerHandlers.put(headerName, handler) ;
+    }
+
+    /**
+     * Remove the header handler for the specified qualified name.
+     * @param headerName The qualified name of the header.
+     */
+    public void removeHeaderHandler(final QName headerName)
+    {
+        headerHandlers.remove(headerName) ;
+    }
+
+    /**
+     * Get the header handler associated with the specified header name.
+     * @param headerName The name of the header.
+     * @return The header handler or null if not recognised.
+     */
+    public HeaderHandler getHeaderHandler(final QName headerName)
+    {
+        return (HeaderHandler)headerHandlers.get(headerName) ;
+    }
+    
+    /**
+     * Get the header handler map.
+     * @return The header handler map.
+     */
+    public Map getHeaderHandlers()
+    {
+        return unmodifiableHeaderHandlers ;
+    }
+    
+    /**
+     * Register the body handler against the specified qualified name.
+     * @param bodyName The qualified name of the body.
+     * @param handler The body handler.
+     */
+    public void registerBodyHandler(final QName bodyName, final BodyHandler handler)
+    {
+        bodyHandlers.put(bodyName, handler) ;
+    }
+    
+    /**
+     * Remove the body handler for the specified qualified name.
+     * @param bodyName The qualified name of the body.
+     */
+    public void removeBodyHandler(final QName bodyName)
+    {
+        bodyHandlers.remove(bodyName) ;
+    }
+
+    /**
+     * Get the body handler associated with the specified body name.
+     * @param bodyName The name of the body.
+     * @return The body handler or null if not recognised.
+     */
+    public BodyHandler getBodyHandler(final QName bodyName)
+    {
+        return (BodyHandler)bodyHandlers.get(bodyName) ;
+    }
+    
+    /**
+     * Register a handler to process SOAP faults.
+     * @param faultHandler The fault handler.
+     */
+    public void registerFaultHandler(final BodyHandler faultHandler)
+    {
+        this.faultHandler = faultHandler ;
+    }
+    
+    /**
+     * Get the fault handler.
+     * @return The fault handler.
+     */
+    public BodyHandler getFaultHandler()
+    {
+        return faultHandler ;
+    }
+    
+    /**
+     * Register the specified interceptor handler
+     * @param interceptorHandler The interceptor handler.
+     */
+    public void registerInterceptorHandler(final InterceptorHandler interceptorHandler)
+    {
+        interceptorHandlers.add(interceptorHandler) ;
+    }
+    
+    /**
+     * Remove the specified interceptor handler
+     * @param interceptorHandler The interceptor handler.
+     */
+    public void removeInterceptorHandler(final InterceptorHandler interceptorHandler)
+    {
+        interceptorHandlers.remove(interceptorHandler) ;
+    }
+    
+    /**
+     * Get the interceptor handlers.
+     * @return the interceptor handlers.
+     */
+    public Set getInterceptorHandlers()
+    {
+        return unmodifiableInterceptorHandlers ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HeaderHandler.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/HeaderHandler.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HeaderHandler.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/HeaderHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,71 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.soap.SoapDetails;
+
+/**
+ * Interface for header handlers.
+ * @author kevin
+ */
+public interface HeaderHandler
+{
+    /**
+     * Handle the header element.
+     * @param in The current streamreader.
+     * @param context The current message context.
+     * @throws XMLStreamException for parsing errors.
+     * @throws SoapFault for processing errors.
+     */
+    public void invoke(final XMLStreamReader in, final MessageContext context)
+        throws XMLStreamException, SoapFault ;
+    
+    /**
+     * Write the header element in a response.
+     * @param out The output stream.
+     * @param headerElementName The name of the header element.
+     * @param context The current message context.
+     * @param soapDetails The SOAP details.
+     * @throws XMLStreamException 
+     */
+    public void writeContent(final XMLStreamWriter out, final QName headerElementName,
+        final MessageContext context, final SoapDetails soapDetails)
+        throws XMLStreamException ;
+    
+    /**
+     * Validate headers after processing.
+     * @param context The current message context.
+     * @throws SoapFault for validation errors.
+     */
+    public void headerValidate(final MessageContext context)
+        throws SoapFault ;
+    
+    /**
+     * Notification of a subsequent header processing fault.
+     * @param context The current message context.
+     */
+    public void headerFaultNotification(final MessageContext context) ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorChain.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorChain.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorChain.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorChain.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,51 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.soap.SoapDetails;
+
+/**
+ * Interface for the interceptor chain.
+ * @author kevin
+ */
+public interface InterceptorChain
+{
+    /**
+     * Invoke the next interceptor in the chain.
+     * @param soapService The SOAP service being called.
+     * @param soapDetails The SOAP details.
+     * @param context The current message context.
+     * @param responseContext The response message context.
+     * @param action The transport SOAP action.
+     * @param in The current stream reader.
+     * @throws XMLStreamException for parsing errors.
+     * @throws SoapFault for processing errors.
+     * @return The response elements or null if one way.
+     */
+    public SoapBody invokeNext(final SoapService soapService,
+        final SoapDetails soapDetails, final MessageContext context,
+        final MessageContext responseContext, final String action,
+        final XMLStreamReader in)
+        throws XMLStreamException, SoapFault ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorHandler.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/InterceptorHandler.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorHandler.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/InterceptorHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,51 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.soap.SoapDetails;
+
+/**
+ * Interface for interceptors handlers.
+ * @author kevin
+ */
+public interface InterceptorHandler
+{
+    /**
+     * Invoke the interceptor.
+     * @param chain The interceptor chain.
+     * @param soapService The SOAP service being called.
+     * @param soapDetails The SOAP details.
+     * @param context The current message context.
+     * @param responseContext The response message context.
+     * @param action The transport SOAP action.
+     * @param in The current stream reader.
+     * @throws XMLStreamException for parsing errors.
+     * @throws SoapFault for processing errors.
+     * @return The response elements or null if one way.
+     */
+    public SoapBody invoke(final InterceptorChain chain, final SoapService soapService,
+        final SoapDetails soapDetails, final MessageContext context, final MessageContext responseContext,
+        final String action, final XMLStreamReader in)
+        throws XMLStreamException, SoapFault ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/MessageContext.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/MessageContext.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/MessageContext.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/MessageContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,98 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The context of a SOAP message.
+ * @author kevin
+ */
+public class MessageContext
+{
+    /**
+     * The properties associated with the current context.
+     */
+    private Map properties ;
+    /**
+     * The message scheme.
+     */
+    private String scheme ;
+    
+    /**
+     * The default constructor.
+     */
+    public MessageContext()
+    {
+    }
+    
+    /**
+     * Set the property in the message context. 
+     * @param key The property key.
+     * @param value The property value.
+     */
+    public void setProperty(final Object key, final Object value)
+    {
+        getPropertyMap().put(key, value) ;
+    }
+    
+    /**
+     * Get the property from the message context
+     * @param key The property key.
+     * @return The property value or null if not set.
+     */
+    public Object getProperty(final Object key)
+    {
+        return (properties == null ? null : properties.get(key)) ;
+    }
+    
+    /**
+     * Get the message scheme.
+     * @return The message scheme.
+     */
+    public String getScheme()
+    {
+        return scheme ;
+    }
+    
+    /**
+     * Set the message scheme.
+     * @param scheme The message scheme.
+     */
+    public void setScheme(final String scheme)
+    {
+        this.scheme = scheme ;
+    }
+    
+    /**
+     * Get the property map.
+     * @return The property map.
+     */
+    private Map getPropertyMap()
+    {
+        if (properties == null)
+        {
+            properties = new HashMap() ;
+        }
+        return properties ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapBody.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapBody.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapBody.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapBody.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,102 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import com.arjuna.webservices.stax.NamedElement;
+
+/**
+ * Class representing a SOAP body
+ * @author kevin
+ */
+public class SoapBody
+{
+    /**
+     * The SOAP body contents.
+     */
+    private NamedElement contents ;
+    /**
+     * The associated action.
+     */
+    private String action ;
+    
+    /**
+     * Default constructor. 
+     */
+    public SoapBody()
+    {
+    }
+    
+    /**
+     * Construct a SOAP body with the specified contents and action.
+     * @param contents The SOAP body contents.
+     */
+    public SoapBody(final NamedElement contents)
+    {
+        this(contents, null) ;
+    }
+    
+    /**
+     * Construct a SOAP body with the specified contents and action.
+     * @param contents The SOAP body contents.
+     * @param action The SOAP body action.
+     */
+    public SoapBody(final NamedElement contents, final String action)
+    {
+        this.contents = contents ;
+        this.action = action ;
+    }
+    
+    /**
+     * Get the SOAP body contents.
+     * @return The SOAP body contents.
+     */
+    public NamedElement getContents()
+    {
+        return contents ;
+    }
+    
+    /**
+     * Set the SOAP body contents.
+     * @param contents The SOAP body contents.
+     */
+    public void setContents(final NamedElement contents)
+    {
+        this.contents = contents ;
+    }
+    
+    /**
+     * Get the body action.
+     * @return The body action.
+     */
+    public String getAction()
+    {
+        return action ;
+    }
+    
+    /**
+     * Set the body action.
+     * @param action The body action.
+     */
+    public void setAction(final String action)
+    {
+        this.action = action ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapClient.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapClient.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.io.IOException;
+
+
+/**
+ * Interface for soap client processors.
+ * @author kevin
+ */
+public interface SoapClient
+{
+    /**
+     * Invoke a request on a service.
+     * @param request The request object.
+     * @param url The destination URL.
+     * @return The response object.
+     * @throws SoapFault For errors processing the request.
+     * @throws IOException for processing errors.
+     */
+    public SoapMessage invoke(final SoapMessage request, final String url)
+        throws SoapFault, IOException ;
+    
+    /**
+     * Invoke a one way request on a service.
+     * @param request The request object.
+     * @param url The destination URL.
+     * @throws SoapFault For errors processing the request.
+     * @throws IOException for processing errors.
+     */
+    public void invokeOneWay(final SoapMessage request, final String url)
+        throws SoapFault, IOException ;
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapFault10.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapFault10.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapFault10.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,233 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+
+package com.arjuna.webservices;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.stax.NamedElement;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.StringWriter;
+
+/**
+ * IMplementtaion of SoapFault used by WSCOOR1.0 classes
+ */
+public class SoapFault10 extends SoapFault
+{
+    /**
+     * The detailElement element.
+     */
+    private NamedElement detailElement;
+    /**
+     * The header elements.
+     */
+    private NamedElement[] headerElements ;
+    /**
+     * Default constructor.
+     */
+    public SoapFault10()
+    {
+        super();
+    }
+
+    /**
+     * Construct a SOAP fault based on a throwable.
+     * @param th The throwable.
+     */
+    public SoapFault10(final Throwable th)
+    {
+        super(th);
+    }
+
+    /**
+     * Construct a SOAP header fault based on a throwable.
+     * @param th The throwable.
+     * @param headerElements The header elements.
+     */
+    public SoapFault10(final Throwable th, final NamedElement[] headerElements)
+    {
+        super(th);
+        this.headerElements = headerElements;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param subcode The fault subcode.
+     * @param reason The fault reason.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType, final QName subcode, final String reason)
+    {
+        super(soapFaultType, subcode, reason) ;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param subcode The fault subcode.
+     * @param reason The fault reason.
+     * @param headerElements The header elements.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType, final QName subcode, final String reason, final NamedElement[] headerElements)
+    {
+        super(soapFaultType, subcode, reason, null);
+        this.headerElements = headerElements ;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param subcode The fault subcode.
+     * @param reason The fault reason.
+     * @param detailElement The fault detailElement.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType, final QName subcode, final String reason, final NamedElement detailElement)
+    {
+        super(soapFaultType, subcode, reason, getDetailString(detailElement)) ;
+        this.detailElement = detailElement;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param reason The fault reason.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType, final String reason)
+    {
+        this(soapFaultType, null, reason, null, null) ;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param reason The fault reason.
+     * @param detailElement The fault detailElement.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType,
+        final String reason, final NamedElement detailElement)
+    {
+        this(soapFaultType, null, reason, detailElement, null) ;
+    }
+
+    /**
+     * Create a custom SOAP fault.
+     * @param soapFaultType the soap fault type.
+     * @param subcode The fault subcode.
+     * @param reason The fault reason.
+     * @param detailElement The fault detailElement.
+     * @param headerElements The fault header elements.
+     */
+    public SoapFault10(final SoapFaultType soapFaultType, final QName subcode,
+        final String reason, final NamedElement detailElement, final NamedElement[] headerElements)
+    {
+        this.soapFaultType = soapFaultType ;
+        this.subcode = subcode ;
+        this.reason = reason ;
+        this.detailElement = detailElement;
+        this.headerElements = headerElements ;
+    }
+
+    /**
+     * Get the SOAP fault detailElement.
+     * @return The SOAP fault detailElement.
+     */
+    public NamedElement getDetailElement()
+    {
+        return detailElement;
+    }
+
+    /**
+     * Set the SOAP fault detailElement.
+     * @param detailElement The SOAP fault detailElement.
+     */
+    public void setDetailElement(final NamedElement detailElement)
+    {
+        this.detailElement = detailElement;
+        setDetail(getDetailString(detailElement));
+    }
+
+    /**
+     * Get the SOAP fault header elements.
+     * @return The SOAP fault header elements.
+     */
+    public NamedElement[] getHeaderElements()
+    {
+        return headerElements ;
+    }
+
+    /**
+     * Set the SOAP fault header elements.
+     * @param headerElements The SOAP fault header elements.
+     */
+    public void setHeaderElements(final NamedElement[] headerElements)
+    {
+        this.headerElements = headerElements ;
+    }
+
+    /**
+     * return a String representing the supplied detail element
+     * @param detailElement
+     * @return
+     */
+
+    private static String getDetailString(NamedElement detailElement)
+    {
+        XMLOutputFactory factory = getFactory();
+        if (factory != null) {
+            try {
+                StringWriter stringWriter = new StringWriter();
+                XMLStreamWriter xmlWriter = factory.createXMLStreamWriter(stringWriter);
+                detailElement.getElementContent().writeContent(xmlWriter);
+                xmlWriter.close();
+                return stringWriter.toString();
+            } catch (XMLStreamException e) {
+            }
+        }
+
+        return "";
+    }
+
+    /**
+     * helper to safely initialise and return a static xml output factory variable
+     * @return the factory
+     */
+    private static synchronized XMLOutputFactory getFactory()
+    {
+        if (factory == null) {
+            try {
+                factory = XMLOutputFactory.newInstance();
+            } catch (FactoryConfigurationError e) {
+                // TODO log error here
+            }
+        }
+        return null;
+    }
+
+    /**
+     * xml output factory used to create XMLStreamWriters when converting detail elements to strings
+     */
+    private static XMLOutputFactory factory;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessage.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessage.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessage.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,70 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import com.arjuna.webservices.soap.SoapDetails;
+
+/**
+ * Interface representing a SOAP response.
+ * @author kevin
+ */
+public interface SoapMessage
+{
+    /**
+     * Does the response represent a fault?
+     * @return true if a fault, false otherwise.
+     */
+    public boolean isFault() ;
+    /**
+     * Get the action URI for the response.
+     * @return The action URI for the response.
+     */
+    public String getAction() ;
+    
+    /**
+     * Output the response to the output stream.
+     * @param writer The output writer.
+     * @throws IOException If errors occur during output.
+     */
+    public void output(final Writer writer)
+        throws IOException ;
+    
+    /**
+     * Get the SOAP details associated with the message.
+     * @return The SOAP details.
+     */
+    public SoapDetails getSoapDetails() ;
+    
+    /**
+     * Get the SOAP service associated with the message.
+     * @return The SOAP service or null if not known.
+     */
+    public SoapService getSoapService() ;
+    
+    /**
+     * Get the message context associated with this message.
+     * @return The message context or null if not known.
+     */
+    public MessageContext getMessageContext() ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessageLogging.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapMessageLogging.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessageLogging.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapMessageLogging.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,103 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class providing SOAP message logging.
+ * @author kevin
+ */
+public class SoapMessageLogging
+{
+    /**
+     * The thread local message log.
+     */
+    private static final ThreadLocal MESSAGE_LOG = new ThreadLocal() ;
+    /**
+     * The thread local message log enabled flag.
+     */
+    private static final ThreadLocal MESSAGE_LOG_ENABLED = new ThreadLocal() {
+        protected Object initialValue() { return Boolean.FALSE; }
+    };
+    
+    /**
+     * Clear the log for the current thread.
+     */
+    public static void clearThreadLog()
+    {
+        MESSAGE_LOG.set(null) ;
+    }
+    
+    /**
+     * Get the thread log.
+     * @return The thread log.
+     */
+    public static String[] getThreadLog()
+    {
+        final Object value = MESSAGE_LOG.get() ;
+        if (value == null)
+        {
+            return null ;
+        }
+        final List list = (List)value ;
+        return (String[]) list.toArray(new String[list.size()]) ;
+    }
+    
+    /**
+     * Append a message to the thread log.
+     * @param message The thread message to append.
+     */
+    public static void appendThreadLog(final String message)
+    {
+        final Object value = MESSAGE_LOG.get() ;
+        final List list ;
+        if (value == null)
+        {
+            list = new ArrayList() ;
+            MESSAGE_LOG.set(list) ;
+        }
+        else
+        {
+            list = (List)value ;
+        }
+        list.add(message) ;
+    }
+    
+    /**
+     * Is the thread logging enabled?
+     * @return true if enabled, false otherwise.
+     */
+    public static boolean isThreadLogEnabled()
+    {
+        return ((Boolean)MESSAGE_LOG_ENABLED.get()).booleanValue() ;
+    }
+    
+    /**
+     * Set the thread log enable flag.
+     * @param isEnabled True if enabled, false otherwise.
+     */
+    public static void setThreadLogEnabled(final boolean isEnabled)
+    {
+        MESSAGE_LOG_ENABLED.set(isEnabled ? Boolean.TRUE : Boolean.FALSE) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapProcessor.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapProcessor.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,44 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.io.IOException;
+import java.io.Reader;
+
+/**
+ * Interface for soap version processors.
+ * @author kevin
+ */
+public interface SoapProcessor
+{
+    /**
+     * Process the input stream and generate a response.
+     * @param messageContext The message context for the request.
+     * @param responseMessageContext The message context for the response.
+     * @param action The transport SOAP action.
+     * @param reader The input reader.
+     * @return The SOAP response.
+     * @throws IOException For errors reading the input stream.
+     */
+    public SoapMessage process(final MessageContext messageContext, final MessageContext responseMessageContext,
+        final String action, final Reader reader)
+        throws IOException ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapRegistry.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapRegistry.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapRegistry.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.util.Iterator;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * The registry of SOAP service providers, SOAP services and SOAP clients .
+ * @author kevin
+ */
+public class SoapRegistry
+{
+    /**
+     * The registry singleton.
+     */
+    private static final SoapRegistry REGISTRY = new SoapRegistry() ;
+    
+    /**
+     * The SOAP service provider registry.
+     */
+    private final Map soapServiceProviderRegistry = new TreeMap() ;
+    /**
+     * The SOAP service registry.
+     */
+    private final Map soapServiceRegistry = new TreeMap() ;
+    /**
+     * The SOAP client registry.
+     */
+    private final Map soapClientRegistry = new TreeMap() ;
+    
+    /**
+     * Get the service registry.
+     * @return The service registry.
+     */
+    public static SoapRegistry getRegistry()
+    {
+        return REGISTRY ;
+    }
+    
+    /**
+     * Register the specified service.
+     * @param scheme The service scheme.
+     * @param provider The service provider.
+     */
+    public void registerSoapServiceProvider(final String scheme, final SoapServiceEndpointProvider provider)
+    {
+        synchronized(soapServiceProviderRegistry)
+        {
+            soapServiceProviderRegistry.put(scheme, provider) ;
+        }
+    }
+    
+    /**
+     * Remove the specified service.
+     * @param scheme The service scheme.
+     */
+    public void removeSoapServiceProvider(final String scheme)
+    {
+        synchronized(soapServiceProviderRegistry)
+        {
+            soapServiceProviderRegistry.remove(scheme) ;
+        }
+    }
+    
+    /**
+     * Register the specified client.
+     * @param scheme The client scheme.
+     * @param client The client.
+     */
+    public void registerSoapClient(final String scheme, final SoapClient client)
+    {
+        synchronized(soapClientRegistry)
+        {
+            soapClientRegistry.put(scheme, client) ;
+        }
+    }
+
+    /**
+     * Get the SOAP client for the specified scheme.
+     * @param scheme The addressing scheme.
+     * @return The SOAP client or null if not known.
+     */
+    public SoapClient getSoapClient(final String scheme)
+    {
+        synchronized(soapClientRegistry)
+        {
+            return (SoapClient)soapClientRegistry.get(scheme) ;
+        }
+    }
+    
+    /**
+     * Remove the specified client.
+     * @param scheme The client scheme.
+     */
+    public void removeSoapClient(final String scheme)
+    {
+        synchronized(soapClientRegistry)
+        {
+            soapClientRegistry.remove(scheme) ;
+        }
+    }
+    
+    /**
+     * Register the specified service.
+     * @param serviceName The unique name of the service.
+     * @param soapService The service instance.
+     */
+    public void registerSoapService(final String serviceName, final SoapService soapService)
+    {
+        synchronized(soapServiceRegistry)
+        {
+            soapServiceRegistry.put(serviceName, soapService) ;
+        }
+    }
+
+    /**
+     * Get the SOAP service for the specified service.
+     * @param serviceName The name of the service.
+     * @return The SOAP service or null if not known.
+     */
+    public SoapService getSoapService(final String serviceName)
+    {
+        synchronized(soapServiceRegistry)
+        {
+            return (SoapService)soapServiceRegistry.get(serviceName) ;
+        }
+    }
+    
+    /**
+     * Remove the specified service.
+     * @param serviceName The unique name of the service.
+     */
+    public void removeSoapService(final String serviceName)
+    {
+        synchronized(soapServiceRegistry)
+        {
+            soapServiceRegistry.remove(serviceName) ;
+        }
+    }
+    
+    /**
+     * Get the service URI.
+     * @param scheme The addressing scheme.
+     * @param serviceName The service name.
+     * @return The service URI or null if not registered.
+     */
+    public String getServiceURI(final String scheme, final String serviceName)
+    {
+        final SoapServiceEndpointProvider soapServiceProvider ;
+        synchronized(soapServiceRegistry)
+        {
+            soapServiceProvider = (SoapServiceEndpointProvider)soapServiceProviderRegistry.get(scheme) ;
+        }
+        if (soapServiceProvider != null)
+        {
+            return soapServiceProvider.getServiceURI(scheme, serviceName) ;
+        }
+        return null ;
+    }
+    
+    /**
+     * Get the service URI.
+     * @param serviceName The service name.
+     * @return The service URI or null if not registered.
+     */
+    public String getServiceURI(final String serviceName)
+    {
+        synchronized(soapServiceRegistry)
+        {
+            final Iterator entryIter = soapServiceProviderRegistry.entrySet().iterator() ;
+            while(entryIter.hasNext())
+            {
+                final Map.Entry entry = (Map.Entry)entryIter.next() ;
+                final String entryScheme = (String)entry.getKey() ;
+                final SoapServiceEndpointProvider soapServiceProvider = (SoapServiceEndpointProvider)entry.getValue() ;
+                final String uri = soapServiceProvider.getServiceURI(entryScheme, serviceName) ;
+                if (uri != null)
+                {
+                    return uri ;
+                }
+            }
+        }
+        return null ;
+    }
+    
+    /**
+     * Get the service URI.
+     * @param messageContext The message context.
+     * @param serviceName The service name.
+     * @return The service URI or null if not registered.
+     */
+    public String getServiceURI(final MessageContext messageContext, final String serviceName)
+    {
+        final String scheme = messageContext.getScheme() ;
+        final SoapServiceEndpointProvider soapServiceProvider ;
+        synchronized(soapServiceRegistry)
+        {
+            soapServiceProvider = (SoapServiceEndpointProvider)soapServiceProviderRegistry.get(scheme) ;
+        }
+        if (soapServiceProvider != null)
+        {
+            return soapServiceProvider.getServiceURI(messageContext, serviceName) ;
+        }
+        else
+        {
+            return null ;
+        }
+    }
+    
+    /**
+     * Get the scheme from a URL.
+     * @param url The URL.
+     * @return The scheme.
+     */
+    public String getScheme(final String url)
+    {
+        final int separatorIndex = url.indexOf(':') ;
+        if (separatorIndex >= 0)
+        {
+            return url.substring(0, separatorIndex) ;
+        }
+        else
+        {
+            return url ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapService.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapService.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,147 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.soap.Soap11Details;
+import com.arjuna.webservices.soap.Soap12Details;
+import com.arjuna.webservices.soap.SoapDetails;
+import com.arjuna.webservices.soap.SoapParser;
+import com.arjuna.webservices.soap.SoapProcessorImpl;
+
+/**
+ * Class responsible for handling SOAP services.
+ * @author kevin
+ */
+public class SoapService
+{
+    /**
+     * The soap 1.1 processor.
+     */
+    private final SoapProcessor soap11Processor = new SoapProcessorImpl(this, new Soap11Details()) ;
+    /**
+     * The soap 1.2 processor.
+     */
+    private final SoapProcessor soap12Processor = new SoapProcessorImpl(this, new Soap12Details()) ;
+    
+    /**
+     * The registry of handlers associated with this service.
+     */
+    private final HandlerRegistry handlerRegistry ;
+    
+    /**
+     * Initialise the SOAP service.
+     * @param handlerRegistry The handler registry for this service.
+     */
+    public SoapService(final HandlerRegistry handlerRegistry)
+    {
+        this.handlerRegistry = handlerRegistry ;
+    }
+
+    /**
+     * Get the header handler associated with the specified header name.
+     * @param headerName The name of the header.
+     * @return The header handler or null if not recognised.
+     */
+    public HeaderHandler getHeaderHandler(final QName headerName)
+    {
+        return handlerRegistry.getHeaderHandler(headerName) ;
+    }
+    
+    /**
+     * Get the header handlers.
+     * @return The header handlers.
+     */
+    public Map getHeaderHandlers()
+    {
+        return handlerRegistry.getHeaderHandlers() ;
+    }
+
+    /**
+     * Get the body handler associated with the specified body name.
+     * @param bodyName The name of the body.
+     * @return The body handler or null if not recognised.
+     */
+    public BodyHandler getBodyHandler(final QName bodyName)
+    {
+        return handlerRegistry.getBodyHandler(bodyName) ;
+    }
+
+    /**
+     * Get the fault handler for the service.
+     * @return The fault handler for the service.
+     */
+    public BodyHandler getFaultHandler()
+    {
+        return handlerRegistry.getFaultHandler() ;
+    }
+    
+    /**
+     * Get the interceptor handlers.
+     * @return The interceptor handlers.
+     */
+    public Set getInterceptorHandlers()
+    {
+        return handlerRegistry.getInterceptorHandlers() ;
+    }
+
+    /**
+     * Return the SOAP 1.1 processor.
+     * @return The SOAP 1.1 processor.
+     */
+    public SoapProcessor getSOAP11Processor()
+    {
+        return soap11Processor ;
+    }
+
+    /**
+     * Return the SOAP 1.2 processor.
+     * @return The SOAP 1.2 processor.
+     */
+    public SoapProcessor getSOAP12Processor()
+    {
+        return soap12Processor ;
+    }
+
+    /**
+     * Handle the processing of the SOAP request.
+     * @param messageContext The current message context.
+     * @param messageResponseContext The current message response context.
+     * @param action The transport SOAP action.
+     * @param streamReader The XML stream reader.
+     * @param soapDetails The SOAP details.
+     * @return The SOAP response.
+     * @throws XMLStreamException For XML parsing errors.
+     * @throws SoapFault For SOAP processing errors.
+     */
+    public SoapBody parse(final MessageContext messageContext, final MessageContext messageResponseContext,
+        final String action, final XMLStreamReader streamReader, final SoapDetails soapDetails)
+        throws XMLStreamException, SoapFault
+    {
+        return SoapParser.parse(messageContext, messageResponseContext, action, streamReader, this, soapDetails) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapServiceEndpointProvider.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/SoapServiceEndpointProvider.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapServiceEndpointProvider.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/SoapServiceEndpointProvider.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,45 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices;
+
+/**
+ * The interface for a SOAP service endpoint provider.
+ * @author kevin
+ */
+public interface SoapServiceEndpointProvider
+{
+    /**
+     * Get the URI of a service supported by this endpoint provider.
+     * @param messageContext The message context.
+     * @param serviceName The service name.
+     * @return The service URI or null if not known.
+     */
+    public String getServiceURI(final MessageContext messageContext,
+        final String serviceName) ;
+    
+    /**
+     * Get the URI of a service supported by this endpoint provider.
+     * @param scheme The addressing scheme of the endpoint provider.
+     * @param serviceName The service name.
+     * @return The service URI or null if not known.
+     */
+    public String getServiceURI(final String scheme, final String serviceName) ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/adapters (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/adapters)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/base/handlers (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/base/handlers)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/base/policy (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/base/policy)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap11Details.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap11Details.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap11Details.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap11Details.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,479 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import java.text.MessageFormat;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.AnyElement;
+import com.arjuna.webservices.stax.ElementContent;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.util.QNameHelper;
+import com.arjuna.webservices.util.StreamHelper;
+
+
+/**
+ * The class implementing SOAP 1.1 specific processing.
+ * @author kevin
+ */
+public class Soap11Details implements SoapDetails
+{
+    /**
+     * The SOAP 1.1 namespace.
+     */
+    private static final String NAMESPACE_URI = "http://schemas.xmlsoap.org/soap/envelope/" ;
+    /**
+     * The SOAP 1.1 local name of the role attribute.
+     */
+    private static final String ROLE_LOCAL_NAME = "actor" ;
+    /**
+     * The qualified SOAP 1.1 role attribute. 
+     */
+    private final static QName QNAME_ATTRIBUTE_ROLE = getQName(ROLE_LOCAL_NAME) ;
+    /**
+     * The SOAP 1.1 next role.
+     */
+    private static final String NEXT_ROLE = NAMESPACE_URI + "http://schemas.xmlsoap.org/soap/actor/next" ;
+    /**
+     * The SOAP 1.1 last role.
+     */
+    private static final String LAST_ROLE = null ;
+    /**
+     * The SOAP 1.1 must understand value.
+     */
+    private final static String MUST_UNDERSTAND_VALUE = "1" ;
+    
+    /**
+     * The qualified SOAP 1.1 MustUnderstand name.
+     */
+    private final static QName QNAME_MUST_UNDERSTAND = getQName("mustUnderstand") ;
+    /**
+     * The qualified SOAP 1.1 Fault name. 
+     */
+    private final static QName QNAME_FAULT = getQName("Fault") ;
+    /**
+     * The qualified SOAP 1.1 faultcode name. 
+     */
+    private final static QName QNAME_FAULTCODE = new QName("faultcode") ;
+    /**
+     * The qualified SOAP 1.1 faultstring name. 
+     */
+    private final static QName QNAME_FAULTSTRING = new QName("faultstring") ;
+    /**
+     * The qualified SOAP 1.1 faultactor name. 
+     */
+    private final static QName QNAME_FAULTACTOR = new QName("faultactor") ;
+    /**
+     * The qualified SOAP 1.1 detail name. 
+     */
+    private final static QName QNAME_DETAIL = new QName("detail") ;
+    
+    /**
+     * The Fault Code for version mismatch.
+     */
+    private final static QName FAULT_CODE_VERSION_MISMATCH = getQName("VersionMismatch") ;
+    /**
+     * The Fault Code for must understand.
+     */
+    private final static QName FAULT_CODE_MUST_UNDERSTAND = getQName("MustUnderstand") ;
+    /**
+     * The Fault Code for sender.
+     */
+    private final static QName FAULT_CODE_SENDER = getQName("Client") ;
+    /**
+     * The Fault Code for receiver.
+     */
+    private final static QName FAULT_CODE_RECEIVER = getQName("Server") ;
+    
+    /**
+     * Get the SOAP version.
+     * @return The SOAP version
+     */
+    public String getVersion()
+    {
+        return SOAP_11_VERSION ;
+    }
+    
+    /**
+     * Get the SOAP namespace URI.
+     * @return The SOAP namespace URI.
+     */
+    public String getNamespaceURI()
+    {
+        return NAMESPACE_URI ;
+    }
+    
+    /**
+     * Get the local name of the role attribute.
+     * @return The role local name,
+     */
+    public String getRoleLocalName()
+    {
+        return ROLE_LOCAL_NAME ;
+    }
+    
+    /**
+     * Get the qualified name of the role attribute.
+     * @return The role qualified name,
+     */
+    public QName getRoleQName()
+    {
+        return QNAME_ATTRIBUTE_ROLE ;
+    }
+    
+    /**
+     * Get the SOAP name for the next role.
+     * @return The name of the next role.
+     */
+    public String getNextRole()
+    {
+        return NEXT_ROLE ;
+    }
+    
+    /**
+     * Get the SOAP name for the last role.
+     * @return The name of the last role.
+     */
+    public String getLastRole()
+    {
+        return LAST_ROLE ;
+    }
+    
+    /**
+     * Get the qualified SOAP Fault element name.
+     * @return The qualified SOAP Fault name.
+     */
+    public QName getFaultName()
+    {
+        return QNAME_FAULT ;
+    }
+    
+    /**
+     * Get the qualified name of the must understand attribute.
+     * @return The must understand qualified name.
+     */
+    public QName getMustUnderstandQName()
+    {
+        return QNAME_MUST_UNDERSTAND ;
+    }
+    
+    /**
+     * Get the value of the must understand attribute.
+     * @return The must understand value.
+     */
+    public String getMustUnderstandValue()
+    {
+        return MUST_UNDERSTAND_VALUE ;
+    }
+    
+    /**
+     * Write SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFaultHeaders(streamWriter, soapFault, false) ;
+    }
+    
+    /**
+     * Write a SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFault(streamWriter, soapFault, false) ;
+    }
+    
+    /**
+     * Write a header SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFaultHeaders(streamWriter, soapFault, true) ;
+    }
+    
+    /**
+     * Write a header SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFault(streamWriter, soapFault, true) ;
+    }
+    
+    /**
+     * Parse a SOAP fault from the stream.
+     * @param streamReader The input stream.
+     * @return The soap fault.
+     * @throws XMLStreamException For errors during reading.
+     * 
+     * @message com.arjuna.webservices.soap.Soap11Details_1 [com.arjuna.webservices.soap.Soap11Details_1] - Unexpected start element: {0}
+     */
+    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        final SoapFault10 soapFault = new SoapFault10() ;
+        
+        // faultcode processing
+        StreamHelper.checkNextStartTag(streamReader, QNAME_FAULTCODE) ;
+        final TextElement codeElement = new TextElement(streamReader) ;
+        final QName code = QNameHelper.toQName(streamReader.getNamespaceContext(), codeElement.getText()) ;
+        if (!NAMESPACE_URI.equals(code.getNamespaceURI()))
+        {
+            soapFault.setSoapFaultType(SoapFaultType.FAULT_SENDER) ;
+            soapFault.setSubcode(code) ;
+        }
+        else
+        {
+            soapFault.setSoapFaultType(getSoapFaultType(code)) ;
+        }
+        
+        // faultstring processing
+        StreamHelper.checkNextStartTag(streamReader, QNAME_FAULTSTRING) ;
+        final TextElement reasonElement = new TextElement(streamReader) ;
+        soapFault.setReason(reasonElement.getText()) ;
+        if (StreamHelper.checkParentFinished(streamReader))
+        {
+            return soapFault ;
+        }
+        
+        // faultactor if present
+        if (QNAME_FAULTACTOR.equals(streamReader.getName()))
+        {
+            final TextElement roleElement = new TextElement(streamReader) ;
+            soapFault.setRole(roleElement.getText()) ;
+            if (StreamHelper.checkParentFinished(streamReader))
+            {
+                return soapFault ;
+            }
+        }
+        
+        // detail if present
+        if (QNAME_DETAIL.equals(streamReader.getName()))
+        {
+            soapFault.setDetailElement(new NamedElement(null, new AnyElement(streamReader))) ;
+            if (StreamHelper.checkParentFinished(streamReader))
+            {
+                return soapFault ;
+            }
+        }
+        
+        final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap11Details_1") ;
+        final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+        throw new XMLStreamException(message) ;
+    }
+
+    /**
+     * Get the headers passed with a MustUnderstand fault.
+     * @param headerName The name of the header that cannot be processed.
+     * @return The headers or null if none required.
+     */
+    public NamedElement[] getMustUnderstandHeaders(final QName headerName)
+    {
+        return null ;
+    }
+    
+    /**
+     * Write SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @param isHeaderFault true if the SOAP fault is generated during header processing.
+     * @throws XMLStreamException For errors during writing.
+     */
+    private void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
+        throws XMLStreamException
+    {
+        final NamedElement[] headerElements = ((SoapFault10)soapFault).getHeaderElements() ;
+        final int numHeaderElements = (headerElements == null ? 0 : headerElements.length) ;
+        for(int count = 0 ; count < numHeaderElements ; count++)
+        {
+            final NamedElement namedElement = headerElements[count] ;
+            final QName headerElementName = namedElement.getName() ;
+            final String namespaceURI = StreamHelper.writeStartElement(streamWriter, headerElementName) ;
+            namedElement.getElementContent().writeContent(streamWriter) ;
+            StreamHelper.writeEndElement(streamWriter, headerElementName.getPrefix(), namespaceURI) ;
+        }
+        
+        // Detail output
+        if (isHeaderFault)
+        {
+            final NamedElement detail = ((SoapFault10)soapFault).getDetailElement() ;
+            if (detail != null)
+            {
+            		final QName detailName = detail.getName() ;
+            		if (detailName != null)
+            		{
+                    final String namespaceURI = StreamHelper.writeStartElement(streamWriter, detailName) ;
+                    detail.getElementContent().writeContent(streamWriter) ;
+                    StreamHelper.writeEndElement(streamWriter, detailName.getPrefix(), namespaceURI) ;
+            		}
+            }
+        }
+    }
+    
+    /**
+     * Write a SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @param isHeaderFault true if the SOAP fault is generated during header processing.
+     * @throws XMLStreamException For errors during writing.
+     */
+    private void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
+        throws XMLStreamException
+    {
+        final String namespaceURI = StreamHelper.writeStartElement(streamWriter, QNAME_FAULT) ;
+        
+        final QName faultCode ;
+        final QName subcode = soapFault.getSubcode() ;
+        if (subcode != null)
+        {
+            faultCode = soapFault.getSubcode() ;
+        }
+        else
+        {
+            faultCode = getSoapFaultCodeQName(soapFault) ;
+        }
+        
+        final String faultCodeNamespaceURI = QNameHelper.getNormalisedValue(faultCode.getNamespaceURI()) ;
+        
+        if (faultCodeNamespaceURI.length() > 0)
+        {
+            StreamHelper.writeNamespace(streamWriter, faultCode.getPrefix(), faultCodeNamespaceURI) ;
+        }
+        
+        // faultcode output
+        StreamHelper.writeStartElement(streamWriter, QNAME_FAULTCODE) ;
+        StreamHelper.writeQualifiedName(streamWriter, faultCode) ;
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        
+        // faultstring output
+        StreamHelper.writeStartElement(streamWriter, QNAME_FAULTSTRING) ;
+        streamWriter.writeCharacters(soapFault.getReason()) ;
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        
+        // faultactor output
+        final String faultactor = soapFault.getRole() ;
+        if (faultactor != null)
+        {
+            StreamHelper.writeStartElement(streamWriter, QNAME_FAULTACTOR) ;
+            streamWriter.writeCharacters(faultactor) ;
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+        }
+        
+        // Detail output
+        if (!isHeaderFault)
+        {
+            final NamedElement detail = ((SoapFault10)soapFault).getDetailElement() ;
+            if (detail != null)
+            {
+                StreamHelper.writeStartElement(streamWriter, QNAME_DETAIL) ;
+                final ElementContent detailContent = detail.getElementContent() ;
+                detailContent.writeContent(streamWriter) ;
+                StreamHelper.writeEndElement(streamWriter, null, null) ;
+            }
+        }
+        
+        StreamHelper.writeEndElement(streamWriter, QNAME_FAULT.getPrefix(), namespaceURI) ;
+    }
+    
+    /**
+     * Get the code qualified name for the SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @return The qualified name.
+     */
+    private QName getSoapFaultCodeQName(final SoapFault soapFault)
+    {
+        final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
+        if (soapFaultType == SoapFaultType.FAULT_SENDER)
+        {
+            return FAULT_CODE_SENDER ;
+        }
+        else if (soapFaultType == SoapFaultType.FAULT_RECEIVER)
+        {
+            return FAULT_CODE_RECEIVER ;
+        }
+        else if (soapFaultType == SoapFaultType.FAULT_MUST_UNDERSTAND)
+        {
+            return FAULT_CODE_MUST_UNDERSTAND ;
+        }
+        else
+        {
+            return FAULT_CODE_VERSION_MISMATCH ;
+        }
+    }
+
+    /**
+     * Get the SOAP fault type corresponding to the qualified name.
+     * @param code The qualified name.
+     * @return The soap fault type.
+     */
+    private SoapFaultType getSoapFaultType(final QName code)
+    {
+        if (FAULT_CODE_SENDER.equals(code))
+        {
+            return SoapFaultType.FAULT_SENDER ;
+        }
+        else if (FAULT_CODE_RECEIVER.equals(code))
+        {
+            return SoapFaultType.FAULT_RECEIVER ;
+        }
+        else if (FAULT_CODE_MUST_UNDERSTAND.equals(code))
+        {
+            return SoapFaultType.FAULT_MUST_UNDERSTAND ;
+        }
+        else
+        {
+            return SoapFaultType.FAULT_VERSION_MISMATCH ;
+        }
+    }
+
+    /**
+     * Convenience for generating SOAP qualified names.
+     * @param localName The local name.
+     * @return The qualified name.
+     */
+    private static QName getQName(final String localName)
+    {
+        return new QName(NAMESPACE_URI, localName, SoapConstants.SOAP_PREFIX) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap12Details.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/Soap12Details.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap12Details.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/Soap12Details.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,577 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import java.text.MessageFormat;
+import java.util.Locale;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.AnyElement;
+import com.arjuna.webservices.stax.ElementContent;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.stax.TextElement;
+import com.arjuna.webservices.util.QNameHelper;
+import com.arjuna.webservices.util.StreamHelper;
+
+
+/**
+ * The class implementing SOAP 1.2 specific processing.
+ * @author kevin
+ * 
+ * @message com.arjuna.webservices.soap.Soap12Details_1 [com.arjuna.webservices.soap.Soap12Details_1] - Unexpected start element: {0}
+ */
+public class Soap12Details implements SoapDetails
+{
+    /**
+     * The SOAP 1.2 namespace.
+     */
+    private final static String NAMESPACE_URI = "http://www.w3.org/2003/05/soap-envelope" ;
+    /**
+     * The SOAP 1.2 local name of the role attribute.
+     */
+    private static final String ROLE_LOCAL_NAME = "role" ;
+    /**
+     * The qualified SOAP 1.2 role attribute. 
+     */
+    private final static QName QNAME_ATTRIBUTE_ROLE = getQName(ROLE_LOCAL_NAME) ;
+    /**
+     * The SOAP 1.2 next role.
+     */
+    private final static String NEXT_ROLE = NAMESPACE_URI + "/role/next" ;
+    /**
+     * The SOAP 1.2 none role.
+     */
+    private final static String NONE_ROLE = NAMESPACE_URI + "/role/none" ;
+    /**
+     * The SOAP 1.2 last role.
+     */
+    private final static String LAST_ROLE = NAMESPACE_URI + "/role/ultimateReceiver" ;
+    /**
+     * The SOAP 1.2 must understand value.
+     */
+    private final static String MUST_UNDERSTAND_VALUE = "true" ;
+    
+    /**
+     * The qualified SOAP 1.2 MustUnderstand name.
+     */
+    private final static QName QNAME_MUST_UNDERSTAND = getQName("mustUnderstand") ;
+    /**
+     * The qualified SOAP 1.2 Fault name. 
+     */
+    private final static QName QNAME_FAULT = getQName("Fault") ;
+    /**
+     * The qualified SOAP 1.2 Code name. 
+     */
+    private final static QName QNAME_CODE = getQName("Code") ;
+    /**
+     * The qualified SOAP 1.2 Reason name. 
+     */
+    private final static QName QNAME_REASON = getQName("Reason") ;
+    /**
+     * The qualified SOAP 1.2 Node name. 
+     */
+    private final static QName QNAME_NODE = getQName("Node") ;
+    /**
+     * The qualified SOAP 1.2 Role name. 
+     */
+    private final static QName QNAME_ROLE = getQName("Role") ;
+    /**
+     * The qualified SOAP 1.2 Detail name. 
+     */
+    private final static QName QNAME_DETAIL = getQName("Detail") ;
+    /**
+     * The qualified SOAP 1.2 Value name. 
+     */
+    private final static QName QNAME_VALUE = getQName("Value") ;
+    /**
+     * The qualified SOAP 1.2 Subcode name. 
+     */
+    private final static QName QNAME_SUBCODE = getQName("Subcode") ;
+    /**
+     * The qualified SOAP 1.2 Text name. 
+     */
+    private final static QName QNAME_TEXT = getQName("Text") ;
+    /**
+     * The qualified SOAP 1.2 NotUnderstood name.
+     */
+    private final static QName QNAME_NOT_UNDERSTOOD = getQName("NotUnderstood") ;
+    
+    /**
+     * The XML Lang attribute.
+     */
+    private final static QName QNAME_XML_LANG = new QName("http://www.w3.org/XML/1998/namespace", "lang", "xml") ;
+    
+    /**
+     * The Fault Code for version mismatch.
+     */
+    private final static QName FAULT_CODE_VERSION_MISMATCH = getQName("VersionMismatch") ;
+    /**
+     * The Fault Code for must understand.
+     */
+    private final static QName FAULT_CODE_MUST_UNDERSTAND = getQName("MustUnderstand") ;
+    /**
+     * The Fault Code for data encoding unknown.
+     */
+    private final static QName FAULT_CODE_DATA_ENCODING_UNKNOWN = getQName("DataEncodingUnknown") ;
+    /**
+     * The Fault Code for sender.
+     */
+    private final static QName FAULT_CODE_SENDER = getQName("Sender") ;
+    /**
+     * The Fault Code for receiver.
+     */
+    private final static QName FAULT_CODE_RECEIVER = getQName("Receiver") ;
+    
+    /**
+     * Get the SOAP version.
+     * @return The SOAP version
+     */
+    public String getVersion()
+    {
+        return SOAP_12_VERSION ;
+    }
+    
+    /**
+     * Get the SOAP namespace URI.
+     * @return The SOAP namespace URI.
+     */
+    public String getNamespaceURI()
+    {
+        return NAMESPACE_URI ;
+    }
+    
+    /**
+     * Get the local name of the role attribute.
+     * @return The role local name,
+     */
+    public String getRoleLocalName()
+    {
+        return ROLE_LOCAL_NAME ;
+    }
+    
+    /**
+     * Get the qualified name of the role attribute.
+     * @return The role qualified name,
+     */
+    public QName getRoleQName()
+    {
+        return QNAME_ATTRIBUTE_ROLE ;
+    }
+    
+    /**
+     * Get the SOAP name for the next role.
+     * @return The name of the next role.
+     */
+    public String getNextRole()
+    {
+        return NEXT_ROLE ;
+    }
+    
+    /**
+     * Get the SOAP name for the none role.
+     * @return The name of the none role.
+     */
+    public String getNoneRole()
+    {
+        return NONE_ROLE ;
+    }
+    
+    /**
+     * Get the SOAP name for the last role.
+     * @return The name of the last role.
+     */
+    public String getLastRole()
+    {
+        return LAST_ROLE ;
+    }
+    
+    /**
+     * Get the qualified SOAP Fault element name.
+     * @return The qualified SOAP Fault name.
+     */
+    public QName getFaultName()
+    {
+        return QNAME_FAULT ;
+    }
+    
+    /**
+     * Get the qualified name of the must understand attribute.
+     * @return The must understand qualified name,
+     */
+    public QName getMustUnderstandQName()
+    {
+        return QNAME_MUST_UNDERSTAND ;
+    }
+    
+    /**
+     * Get the value of the must understand attribute.
+     * @return The must understand value.
+     */
+    public String getMustUnderstandValue()
+    {
+        return MUST_UNDERSTAND_VALUE ;
+    }
+    
+    /**
+     * Write SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFaultHeaders(streamWriter, soapFault, false) ;
+    }
+    
+    /**
+     * Write a SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFault(streamWriter, soapFault, false) ;
+    }
+    
+    /**
+     * Write a header SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFaultHeaders(streamWriter, soapFault, true) ;
+    }
+    
+    /**
+     * Write a header SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException
+    {
+        writeSoapFault(streamWriter, soapFault, true) ;
+    }
+    
+    /**
+     * Parse a SOAP fault from the stream.
+     * @param streamReader The input stream.
+     * @return The SOAP fault.
+     * @throws XMLStreamException For errors during reading.
+     */
+    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+            final SoapFault10 soapFault = new SoapFault10() ;
+            
+            // Code processing
+            StreamHelper.checkNextStartTag(streamReader, QNAME_CODE) ;
+            StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
+            final TextElement codeElement = new TextElement(streamReader) ;
+            final QName code = QNameHelper.toQName(streamReader.getNamespaceContext(), codeElement.getText()) ;
+            soapFault.setSoapFaultType(getSoapFaultType(code)) ;
+            if (!StreamHelper.checkParentFinished(streamReader))
+            {
+                StreamHelper.checkTag(streamReader, QNAME_SUBCODE) ;
+                StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
+                final TextElement subcodeElement = new TextElement(streamReader) ;
+                soapFault.setSubcode(QNameHelper.toQName(streamReader.getNamespaceContext(), subcodeElement.getText())) ;
+                if (!StreamHelper.checkParentFinished(streamReader))
+                {
+                    StreamHelper.checkTag(streamReader, QNAME_SUBCODE) ;
+                    StreamHelper.checkNextStartTag(streamReader, QNAME_VALUE) ;
+                    final TextElement subSubcodeElement = new TextElement(streamReader) ;
+                    soapFault.setSubSubcode(QNameHelper.toQName(streamReader.getNamespaceContext(), subSubcodeElement.getText())) ;
+                    if (!StreamHelper.checkParentFinished(streamReader))
+                    {
+                        // Throw away any subcodes as we only support two level.
+                        new AnyElement(streamReader) ;
+                        if (!StreamHelper.checkParentFinished(streamReader))
+                        {
+                            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
+                            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                            throw new XMLStreamException(message) ;
+                        }
+                    }
+                    if (!StreamHelper.checkParentFinished(streamReader))
+                    {
+                        final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
+                        final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                        throw new XMLStreamException(message) ;
+                    }
+                }
+                if (!StreamHelper.checkParentFinished(streamReader))
+                {
+                    final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                    throw new XMLStreamException(message) ;
+                }
+            }
+            
+            // Reason processing
+            StreamHelper.checkNextStartTag(streamReader, QNAME_REASON) ;
+            StreamHelper.checkNextStartTag(streamReader, QNAME_TEXT) ;
+            final TextElement reasonElement = new TextElement(streamReader) ;
+            soapFault.setReason(reasonElement.getText()) ;
+            if (!StreamHelper.checkParentFinished(streamReader))
+            {
+                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
+                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                throw new XMLStreamException(message) ;
+            }
+            if (StreamHelper.checkParentFinished(streamReader))
+            {
+                return soapFault ;
+            }
+            
+            // Node if present
+            if (QNAME_NODE.equals(streamReader.getName()))
+            {
+                final TextElement nodeElement = new TextElement(streamReader) ;
+                soapFault.setNode(nodeElement.getText()) ;
+                if (StreamHelper.checkParentFinished(streamReader))
+                {
+                    return soapFault ;
+                }
+            }
+            // Role if present
+            if (QNAME_ROLE.equals(streamReader.getName()))
+            {
+                final TextElement roleElement = new TextElement(streamReader) ;
+                soapFault.setRole(roleElement.getText()) ;
+                if (StreamHelper.checkParentFinished(streamReader))
+                {
+                    return soapFault ;
+                }
+            }
+            
+            // Detail if present
+            if (QNAME_DETAIL.equals(streamReader.getName()))
+            {
+                soapFault.setDetailElement(new NamedElement(null, new AnyElement(streamReader))) ;
+                if (StreamHelper.checkParentFinished(streamReader))
+                {
+                    return soapFault ;
+                }
+            }
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.Soap12Details_1") ;
+            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+            throw new XMLStreamException(message) ;
+    }
+
+    /**
+     * Get the headers passed with a MustUnderstand fault.
+     * @param headerName The name of the header that cannot be processed.
+     * @return The headers or null if none required.
+     */
+    public NamedElement[] getMustUnderstandHeaders(final QName headerName)
+    {
+        final ElementContent notUnderstoodElement = new SoapNotUnderstoodType(headerName) ;
+        final NamedElement header = new NamedElement(QNAME_NOT_UNDERSTOOD, notUnderstoodElement) ;
+        return new NamedElement[] {header} ;
+    }
+    
+    /**
+     * Write SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @param isHeaderFault true if the SOAP fault is generated during header processing.
+     * @throws XMLStreamException For errors during writing.
+     */
+    private void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
+        throws XMLStreamException
+    {
+        final NamedElement[] headerElements = ((SoapFault10)soapFault).getHeaderElements() ;
+        final int numHeaderElements = (headerElements == null ? 0 : headerElements.length) ;
+        for(int count = 0 ; count < numHeaderElements ; count++)
+        {
+            final NamedElement namedElement = headerElements[count] ;
+            final QName headerElementName = namedElement.getName() ;
+            final String namespaceURI = StreamHelper.writeStartElement(streamWriter, headerElementName) ;
+            namedElement.getElementContent().writeContent(streamWriter) ;
+            StreamHelper.writeEndElement(streamWriter, headerElementName.getPrefix(), namespaceURI) ;
+        }
+    }
+    
+    /**
+     * Write a SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The SOAP fault.
+     * @param isHeaderFault true if the SOAP fault is generated during header processing.
+     * @throws XMLStreamException For errors during writing.
+     */
+    private void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault, final boolean isHeaderFault)
+        throws XMLStreamException
+    {
+        final String namespaceURI = StreamHelper.writeStartElement(streamWriter, QNAME_FAULT) ;
+        
+        // Code output
+        StreamHelper.writeStartElement(streamWriter, QNAME_CODE) ;
+        
+        StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
+        StreamHelper.writeQualifiedName(streamWriter, getSoapFaultCodeQName(soapFault)) ;
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        
+        final QName subcode = soapFault.getSubcode() ;
+        if (subcode != null)
+        {
+            StreamHelper.writeStartElement(streamWriter, QNAME_SUBCODE) ;
+            StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
+            StreamHelper.writeQualifiedName(streamWriter, subcode) ;
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+            
+            final QName subSubcode = soapFault.getSubSubcode() ;
+            if (subSubcode != null)
+            {
+                StreamHelper.writeStartElement(streamWriter, QNAME_SUBCODE) ;
+                StreamHelper.writeStartElement(streamWriter, QNAME_VALUE) ;
+                StreamHelper.writeQualifiedName(streamWriter, subSubcode) ;
+                StreamHelper.writeEndElement(streamWriter, null, null) ;
+                StreamHelper.writeEndElement(streamWriter, null, null) ;
+            }
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+        }
+        
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        
+        // Reason output
+        StreamHelper.writeStartElement(streamWriter, QNAME_REASON) ;
+        StreamHelper.writeStartElement(streamWriter, QNAME_TEXT) ;
+        StreamHelper.writeAttribute(streamWriter, QNAME_XML_LANG, Locale.getDefault().getLanguage()) ;
+        streamWriter.writeCharacters(soapFault.getReason()) ;
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        StreamHelper.writeEndElement(streamWriter, null, null) ;
+        
+        // Node output
+        final String node = soapFault.getNode() ;
+        if (node != null)
+        {
+            StreamHelper.writeStartElement(streamWriter, QNAME_NODE) ;
+            streamWriter.writeCharacters(node) ;
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+        }
+        
+        // Role output
+        final String role = soapFault.getNode() ;
+        if (role != null)
+        {
+            StreamHelper.writeStartElement(streamWriter, QNAME_ROLE) ;
+            streamWriter.writeCharacters(role) ;
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+        }
+        
+        // Detail output
+        final NamedElement detail = ((SoapFault10)soapFault).getDetailElement() ;
+        if (detail != null)
+        {
+            StreamHelper.writeStartElement(streamWriter, QNAME_DETAIL) ;
+            final ElementContent detailContent = detail.getElementContent() ;
+            detailContent.writeContent(streamWriter) ;
+            StreamHelper.writeEndElement(streamWriter, null, null) ;
+        }
+        
+        StreamHelper.writeEndElement(streamWriter, QNAME_FAULT.getPrefix(), namespaceURI) ;
+    }
+    
+    /**
+     * Get the code qualified name for the SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @return The qualified name.
+     */
+    private QName getSoapFaultCodeQName(final SoapFault soapFault)
+    {
+        final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
+        if (soapFaultType == SoapFaultType.FAULT_SENDER)
+        {
+            return FAULT_CODE_SENDER ;
+        }
+        else if (soapFaultType == SoapFaultType.FAULT_RECEIVER)
+        {
+            return FAULT_CODE_RECEIVER ;
+        }
+        else if (soapFaultType == SoapFaultType.FAULT_MUST_UNDERSTAND)
+        {
+            return FAULT_CODE_MUST_UNDERSTAND ;
+        }
+        else if (soapFaultType == SoapFaultType.FAULT_VERSION_MISMATCH)
+        {
+            return FAULT_CODE_VERSION_MISMATCH ;
+        }
+        else
+        {
+            return FAULT_CODE_DATA_ENCODING_UNKNOWN ;
+        }
+    }
+
+    /**
+     * Get the SOAP fault type corresponding to the qualified name.
+     * @param code The qualified name.
+     * @return The soap fault type.
+     */
+    private SoapFaultType getSoapFaultType(final QName code)
+    {
+        if (FAULT_CODE_SENDER.equals(code))
+        {
+            return SoapFaultType.FAULT_SENDER ;
+        }
+        else if (FAULT_CODE_RECEIVER.equals(code))
+        {
+            return SoapFaultType.FAULT_RECEIVER ;
+        }
+        else if (FAULT_CODE_MUST_UNDERSTAND.equals(code))
+        {
+            return SoapFaultType.FAULT_MUST_UNDERSTAND ;
+        }
+        else if (FAULT_CODE_VERSION_MISMATCH.equals(code))
+        {
+            return SoapFaultType.FAULT_VERSION_MISMATCH ;
+        }
+        else
+        {
+            return SoapFaultType.FAULT_DATA_ENCODING_UNKNOWN ;
+        }
+    }
+    
+    /**
+     * Convenience for generating SOAP qualified names.
+     * @param localName The local name.
+     * @return The qualified name.
+     */
+    private static QName getQName(final String localName)
+    {
+        return new QName(NAMESPACE_URI, localName, SoapConstants.SOAP_PREFIX) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapBodyMessage.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapBodyMessage.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapBodyMessage.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapBodyMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,128 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.util.StreamHelper;
+
+/**
+ * SOAP message representing a normal message.
+ * @author kevin
+ */
+public class SoapBodyMessage extends SoapMessageBase
+{
+    /**
+     * The SOAP body.
+     */
+    private final SoapBody soapBody ;
+    
+    /**
+     * Construct the SOAP body message.
+     * @param soapBody The SOAP body.
+     * @param soapService The SOAP service.
+     * @param messageContext The message context.
+     */
+    public SoapBodyMessage(final SoapBody soapBody, final SoapService soapService,
+        final MessageContext messageContext)
+    {
+        this(soapBody, null, soapService, messageContext) ;
+    }
+    
+    /**
+     * Construct the SOAP body message.
+     * @param soapBody The SOAP body.
+     * @param soapDetails The SOAP service details.
+     * @param soapService The SOAP service.
+     * @param messageContext The message context.
+     */
+    public SoapBodyMessage(final SoapBody soapBody, final SoapDetails soapDetails,
+       final SoapService soapService, final MessageContext messageContext)
+    {
+        super(soapDetails, soapService, messageContext) ;
+        this.soapBody = soapBody ;
+    }
+
+    /**
+     * Does the message represent a fault?
+     * @return true if a fault, false otherwise.
+     */
+    public boolean isFault()
+    {
+        return false ;
+    }
+    
+    /**
+     * Get the SOAP body.
+     * @return The SOAP body.
+     */
+    public SoapBody getSoapBody()
+    {
+        return soapBody ;
+    }
+    
+    /**
+     * Get the action URI for the message.
+     * @return The action URI for the message.
+     */
+    public String getAction()
+    {
+        return soapBody.getAction() ;
+    }
+    
+    /**
+     * Write the headers specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected void writeMessageHeaders(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        // No headers to write.
+    }
+    
+    /**
+     * Write the body specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected void writeMessageBody(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        if (soapBody != null)
+        {
+            final NamedElement bodyElement = soapBody.getContents() ;
+            if (bodyElement != null)
+            {
+                final QName bodyElementName = bodyElement.getName() ;
+                final String namespaceURI = StreamHelper.writeStartElement(streamWriter, bodyElementName) ;
+                bodyElement.getElementContent().writeContent(streamWriter) ;
+                StreamHelper.writeEndElement(streamWriter, bodyElementName.getPrefix(), namespaceURI) ;
+            }
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapConstants.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapConstants.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapConstants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapConstants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+/**
+ * Common constants for SOAP.
+ * @author kevin
+ */
+public interface SoapConstants
+{
+    /**
+     * The local name for a SOAP envelope.
+     */
+    public String SOAP_ENVELOPE_NAME = "Envelope" ;
+    /**
+     * The local name for a SOAP header.
+     */
+    public String SOAP_HEADER_NAME = "Header" ;
+    /**
+     * The local name for a SOAP body.
+     */
+    public String SOAP_BODY_NAME = "Body" ;
+    /**
+     * The local name for a SOAP mustUnderstand attribute.
+     */
+    public String SOAP_MUST_UNDERSTAND_NAME = "mustUnderstand" ;
+    /**
+     * The prefix for SOAP elements.
+     */
+    public String SOAP_PREFIX = "soap" ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapDetails.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapDetails.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapDetails.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapDetails.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,152 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.stax.NamedElement;
+
+/**
+ * The interface representing SOAP specific processing.
+ * @author kevin
+ */
+public interface SoapDetails
+{
+    /**
+     * The version string for SOAP 1.1.
+     */
+    public static String SOAP_11_VERSION = "1.1" ;
+    
+    /**
+     * The version string for SOAP 1.2.
+     */
+    public static String SOAP_12_VERSION = "1.2" ;
+    
+    /**
+     * Get the SOAP version.
+     * @return The SOAP version
+     */
+    public String getVersion() ;
+    
+    /**
+     * Get the SOAP namespace URI.
+     * @return The SOAP namespace URI.
+     */
+    public String getNamespaceURI() ;
+    
+    /**
+     * Get the local name of the role attribute.
+     * @return The role local name,
+     */
+    public String getRoleLocalName() ;
+    
+    /**
+     * Get the qualified name of the role attribute.
+     * @return The role qualified name,
+     */
+    public QName getRoleQName() ;
+    
+    /**
+     * Get the SOAP name for the next role.
+     * @return The name of the next role.
+     */
+    public String getNextRole() ;
+    
+    /**
+     * Get the SOAP name for the last role.
+     * @return The name of the last role.
+     */
+    public String getLastRole() ;
+    
+    /**
+     * Get the qualified SOAP Fault element name.
+     * @return The qualified SOAP Fault name.
+     */
+    public QName getFaultName() ;
+    
+    /**
+     * Get the qualified name of the must understand attribute.
+     * @return The must understand qualified name.
+     */
+    public QName getMustUnderstandQName() ;
+    
+    /**
+     * Get the value of the must understand attribute.
+     * @return The must understand value.
+     */
+    public String getMustUnderstandValue() ;
+    
+    /**
+     * Write SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException ;
+    
+    /**
+     * Write a SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException ;
+    
+    /**
+     * Write a header SOAP fault headers to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFaultHeaders(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException ;
+    
+    /**
+     * Write a header SOAP fault to the stream.
+     * @param streamWriter The output stream.
+     * @param soapFault The soap fault.
+     * @throws XMLStreamException For errors during writing.
+     */
+    public void writeHeaderSoapFault(final XMLStreamWriter streamWriter, final SoapFault soapFault)
+        throws XMLStreamException ;
+    
+    /**
+     * Parse a SOAP fault from the stream.
+     * @param streamReader The input stream.
+     * @return The soap fault.
+     * @throws XMLStreamException For errors during reading.
+     */
+    public SoapFault parseSoapFault(final XMLStreamReader streamReader)
+        throws XMLStreamException ;
+
+    /**
+     * Get the headers passed with a MustUnderstand fault.
+     * @param headerName The name of the header that cannot be processed.
+     * @return The headers or null if none required.
+     */
+    public NamedElement[] getMustUnderstandHeaders(final QName headerName) ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapFaultMessage.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapFaultMessage.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapFaultMessage.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapFaultMessage.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,127 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapService;
+
+/**
+ * SOAP message representing a fault.
+ * @author kevin
+ */
+public class SoapFaultMessage extends SoapMessageBase
+{
+    /**
+     * The message SOAP fault.
+     */
+    private final SoapFault soapFault ;
+    
+    /**
+     * Construct a SOAP fault message.
+     * @param soapFault The SOAP fault.
+     * @param soapDetails The SOAP service details.
+     */
+    public SoapFaultMessage(final SoapFault soapFault, final SoapDetails soapDetails)
+    {
+        this(soapFault, soapDetails, null, null) ;
+    }
+    
+    /**
+     * Construct a SOAP service fault message.
+     * @param soapFault The SOAP fault.
+     * @param soapDetails The SOAP service details.
+     * @param soapService The SOAP service.
+     * @param messageContext The message context.
+     */
+    public SoapFaultMessage(final SoapFault soapFault, final SoapDetails soapDetails,
+        final SoapService soapService, final MessageContext messageContext)
+    {
+        super(soapDetails, soapService, messageContext) ;
+        this.soapFault = soapFault ;
+    }
+    
+    /**
+     * Does the message represent a fault?
+     * @return true if a fault, false otherwise.
+     */
+    public boolean isFault()
+    {
+        return true ;
+    }
+    
+    /**
+     * Get the SOAP fault.
+     * @return The SOAP fault.
+     */
+    public SoapFault getSoapFault()
+    {
+        return soapFault ;
+    }
+    
+    /**
+     * Get the action URI for the message.
+     * @return The action URI for the message.
+     */
+    public String getAction()
+    {
+        return soapFault.getAction() ;
+    }
+    
+    /**
+     * Write the headers specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected void writeMessageHeaders(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        if (getSoapService() != null)
+        {
+            getSoapDetails().writeSoapFaultHeaders(streamWriter, soapFault) ;
+        }
+        else
+        {
+            getSoapDetails().writeHeaderSoapFaultHeaders(streamWriter, soapFault) ;
+        }
+    }
+    
+    /**
+     * Write the body specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected void writeMessageBody(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        if (getSoapService() != null)
+        {
+            getSoapDetails().writeSoapFault(streamWriter, soapFault) ;
+        }
+        else
+        {
+            getSoapDetails().writeHeaderSoapFault(streamWriter, soapFault) ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapMessageBase.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapMessageBase.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapMessageBase.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapMessageBase.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,209 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.HeaderHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapMessage;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.util.StreamHelper;
+
+abstract class SoapMessageBase implements SoapMessage
+{
+    /**
+     * The SOAP details for this service.
+     */
+    private final SoapDetails soapDetails ;
+    /**
+     * The SOAP service.
+     */
+    private final SoapService soapService ;
+    /**
+     * The message context.
+     */
+    private final MessageContext messageContext ;
+
+    /**
+     * Construct the SOAP message base.
+     * @param soapDetails The SOAP details.
+     * @param soapService The SOAP service.
+     * @param messageContext The message context.
+     */
+    protected SoapMessageBase(final SoapDetails soapDetails, final SoapService soapService,
+        final MessageContext messageContext)
+    {
+        this.soapDetails = (soapDetails == null ? new Soap11Details() : soapDetails) ;
+        this.soapService = soapService ;
+        this.messageContext = messageContext ;
+    }
+    
+    /**
+     * Get the action URI for the message.
+     * @return The action URI for the message.
+     */
+    public abstract String getAction() ;
+    
+    /**
+     * Output the message to the output stream.
+     * @param writer The output writer.
+     * @throws IOException If errors occur during output.
+     */
+    public void output(final Writer writer)
+        throws IOException
+    {
+        try
+        {
+            final XMLStreamWriter xmlWriter = SoapUtils.getXMLStreamWriter(writer);
+
+            writeEnvelope(xmlWriter);
+            xmlWriter.flush();
+        }
+        catch (final XMLStreamException xmlse)
+        {
+            throw new IOException(xmlse.toString()) ;
+        }
+    }
+    
+    /**
+     * Output the envelope to the stream writer.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException If errors occur during output.
+     */
+    private void writeEnvelope(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        final QName envelopeName = getQualifiedName(SoapConstants.SOAP_ENVELOPE_NAME) ;
+        final String envNamespace = StreamHelper.writeStartElement(streamWriter, envelopeName) ;
+        
+        writeHeaders(streamWriter) ;
+        writeBody(streamWriter) ;
+        
+        StreamHelper.writeEndElement(streamWriter, envelopeName.getPrefix(), envNamespace) ;
+    }
+    
+    /**
+     * Output the headers to the stream writer.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException If errors occur during output.
+     */
+    private void writeHeaders(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        final QName headerName = getQualifiedName(SoapConstants.SOAP_HEADER_NAME) ;
+        final String headerNamespace = StreamHelper.writeStartElement(streamWriter, headerName) ;
+        
+        writeMessageHeaders(streamWriter) ;
+        
+        if (soapService != null)
+        {
+            final Map headerHandlers = soapService.getHeaderHandlers() ;
+            final Iterator headerHandlerEntryIterator = headerHandlers.entrySet().iterator() ;
+            while(headerHandlerEntryIterator.hasNext())
+            {
+                final Map.Entry entry = (Map.Entry)headerHandlerEntryIterator.next() ;
+                final QName headerHandlerName = (QName)entry.getKey() ;
+                final HeaderHandler headerHandler = (HeaderHandler)entry.getValue() ;
+                headerHandler.writeContent(streamWriter, headerHandlerName, messageContext, soapDetails) ;
+            }
+        }
+        
+        StreamHelper.writeEndElement(streamWriter, headerName.getPrefix(), headerNamespace) ;
+    }
+    
+    /**
+     * Output the body to the stream writer.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException If errors occur during output.
+     */
+    private void writeBody(final XMLStreamWriter streamWriter)
+        throws XMLStreamException
+    {
+        final QName bodyName = getQualifiedName(SoapConstants.SOAP_BODY_NAME) ;
+        final String bodyNamespace = StreamHelper.writeStartElement(streamWriter, bodyName) ;
+        
+        writeMessageBody(streamWriter) ;
+        
+        StreamHelper.writeEndElement(streamWriter, bodyName.getPrefix(), bodyNamespace) ;
+    }
+    
+    /**
+     * Get the SOAP qualified name.
+     * @param localName The local name.
+     * @return The SOAP qualified name.
+     */
+    protected QName getQualifiedName(final String localName)
+    {
+        return new QName(soapDetails.getNamespaceURI(), localName,
+            SoapConstants.SOAP_PREFIX) ;
+    }
+    
+    /**
+     * Get the SOAP details associated with this message.
+     * @return The SOAP details.
+     */
+    public SoapDetails getSoapDetails()
+    {
+        return soapDetails ;
+    }
+    
+    /**
+     * Get the SOAP service associated with this message.
+     * @return The SOAP service or null if not known.
+     */
+    public SoapService getSoapService()
+    {
+        return soapService ;
+    }
+    
+    /**
+     * Get the message context associated with this message.
+     * @return The message context or null if not known.
+     */
+    public MessageContext getMessageContext()
+    {
+        return messageContext ;
+    }
+    
+    /**
+     * Write the headers specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected abstract void writeMessageHeaders(final XMLStreamWriter streamWriter)
+        throws XMLStreamException ;
+    
+    /**
+     * Write the body specific to the message.
+     * @param streamWriter The stream writer.
+     * @throws XMLStreamException For errors during writing.
+     */
+    protected abstract void writeMessageBody(final XMLStreamWriter streamWriter)
+        throws XMLStreamException ;
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapNotUnderstoodType.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapNotUnderstoodType.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapNotUnderstoodType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapNotUnderstoodType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,144 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.ElementContent;
+import com.arjuna.webservices.util.QNameHelper;
+import com.arjuna.webservices.util.StreamHelper;
+
+/**
+ * Representation of the NotUnderstood header element.
+ * @author kevin
+ */
+public class SoapNotUnderstoodType extends ElementContent
+{
+    /**
+     * The local name of the qname.
+     */
+    private static final String QNAME_LOCAL_NAME = "qname" ;
+    /**
+     * The qualified name of the qname.
+     */
+    private static final QName QNAME_NAME = new QName(QNAME_LOCAL_NAME) ;
+        
+    /**
+     * The value of the qName.
+     */
+    private QName qName ;
+    
+    /**
+     * Construct the NotUnderstood type.
+     * @param qName The header qualified name.
+     */
+    public SoapNotUnderstoodType(final QName qName)
+    {
+        this.qName = qName ;
+    }
+    
+    /**
+     * Construct the NotUnderstood from the input stream.
+     * @param in The input stream.
+     * @throws XMLStreamException for parsing errors.
+     */
+    public SoapNotUnderstoodType(final XMLStreamReader in)
+        throws XMLStreamException
+    {
+        parse(in) ;
+    }
+    
+    /**
+     * Add the element.
+     * @param in The current input stream.
+     * @param elementName The qualified element name.
+     * @message com.arjuna.webservices.soap.SoapNotUnderstoodType_1 [com.arjuna.webservices.soap.SoapNotUnderstoodType_1] - NotUnderstood elements cannot have embedded elements.
+     */
+    protected void putElement(final XMLStreamReader in,
+        final QName elementName)
+        throws XMLStreamException
+    {
+        throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapNotUnderstoodType_1")) ;
+    }
+    
+    /**
+     * Add the attribute value.
+     * @param in The current input stream.
+     * @param attributeName The qualified attribute name.
+     * @param attributeValue The qualified attibute value.
+     */
+    protected void putAttribute(final XMLStreamReader in,
+        final QName attributeName, final String attributeValue)
+        throws XMLStreamException
+    {
+        final String namespaceURI = attributeName.getNamespaceURI() ;
+        if (((namespaceURI == null) || (namespaceURI.length() == 0)) &&
+            QNAME_LOCAL_NAME.equals(attributeName.getLocalPart()))
+        {
+            setQName(QNameHelper.toQName(in.getNamespaceContext(), attributeValue)) ;
+        }
+        else
+        {
+            super.putAttribute(in, attributeName, attributeValue) ;
+        }
+    }
+    
+    /**
+     * Set the qName of this element.
+     * @param qName The qName of the element.
+     */
+    public void setQName(final QName qName)
+    {
+        this.qName = qName ;
+    }
+    
+    /**
+     * Get the qName of this element.
+     * @return The qName of the element or null if not set.
+     */
+    public QName getQName()
+    {
+        return qName ;
+    }
+    
+    /**
+     * Write the attributes of the element.
+     * @param out The output stream.
+     */
+    protected void writeAttributes(final XMLStreamWriter out)
+        throws XMLStreamException
+    {
+        StreamHelper.writeAttribute(out, QNAME_NAME, qName) ;
+    }
+    
+    /**
+     * Is the configuration of this element valid?
+     * @return true if valid, false otherwise.
+     */
+    public boolean isValid()
+    {
+        return (qName != null) && super.isValid() ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapParser.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapParser.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapParser.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapParser.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,362 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.BodyHandler;
+import com.arjuna.webservices.HeaderHandler;
+import com.arjuna.webservices.InterceptorChain;
+import com.arjuna.webservices.InterceptorHandler;
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.SoapService;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.ElementConsumer;
+import com.arjuna.webservices.util.StreamHelper;
+
+/**
+ * Utility class for SOAP parsing.
+ * @author kevin
+ */
+public class SoapParser
+{
+    /**
+     * Handle the processing of the SOAP request.
+     * @param messageContext The current message context.
+     * @param messageResponseContext The current message response context.
+     * @param action The transport SOAP action.
+     * @param streamReader The XML stream reader.
+     * @param soapService The SOAP service.
+     * @param soapDetails The SOAP details.
+     * @return The SOAP response.
+     * @throws XMLStreamException For XML parsing errors.
+     * @throws SoapFault For SOAP processing errors.
+     * 
+     * @message com.arjuna.webservices.soap.SoapParser_1 [com.arjuna.webservices.soap.SoapParser_1] - Unexpected element: {0}
+     * @message com.arjuna.webservices.soap.SoapParser_2 [com.arjuna.webservices.soap.SoapParser_2] - Unexpected body element: {0}
+     */
+    public static SoapBody parse(final MessageContext messageContext, final MessageContext messageResponseContext,
+        final String action, final XMLStreamReader streamReader, final SoapService soapService,
+        final SoapDetails soapDetails)
+        throws XMLStreamException, SoapFault
+    {
+        StreamHelper.skipToStartElement(streamReader) ;
+        if (!(SoapConstants.SOAP_ENVELOPE_NAME.equals(streamReader.getLocalName()) &&
+            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI())))
+        {
+            throw new SoapFault10(SoapFaultType.FAULT_VERSION_MISMATCH,
+                streamReader.getName().toString()) ;
+        }
+        
+        StreamHelper.skipToNextStartElement(streamReader) ;
+        
+        if (SoapConstants.SOAP_HEADER_NAME.equals(streamReader.getLocalName()) &&
+            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI()))
+        {
+            handleHeaders(messageContext, streamReader, soapService, soapDetails) ;
+            streamReader.require(XMLStreamConstants.END_ELEMENT,
+                soapDetails.getNamespaceURI(), SoapConstants.SOAP_HEADER_NAME) ;
+            StreamHelper.skipToNextStartElement(streamReader) ;
+        }
+        
+        if (!(SoapConstants.SOAP_BODY_NAME.equals(streamReader.getLocalName()) &&
+            soapDetails.getNamespaceURI().equals(streamReader.getNamespaceURI())))
+        {
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_1") ;
+            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+            throw new SoapFault10(SoapFaultType.FAULT_SENDER, message) ;
+        }
+        
+        StreamHelper.skipToNextStartElement(streamReader) ;
+        final QName bodyName = streamReader.getName() ;
+        final BodyHandler bodyHandler ;
+        final BodyHandler namedBodyHandler = soapService.getBodyHandler(bodyName) ;
+        if (namedBodyHandler == null)
+        {
+            if (!bodyName.equals(soapDetails.getFaultName()))
+            {
+                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_2") ;
+                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                throw new SoapFault10(SoapFaultType.FAULT_SENDER, message) ;
+            }
+            bodyHandler = soapService.getFaultHandler() ;
+        }
+        else
+        {
+            bodyHandler = namedBodyHandler ;
+        }
+        
+        final Set interceptorHandlers = soapService.getInterceptorHandlers() ;
+        try
+        {
+            if (interceptorHandlers.size() > 0)
+            {
+                final Iterator interceptorHandlerIter = interceptorHandlers.iterator() ;
+                InterceptorChain interceptorChain = new InterceptorBodyHandler(bodyHandler) ;
+                do
+                {
+                    final InterceptorHandler handler = (InterceptorHandler)interceptorHandlerIter.next();
+                    interceptorChain = new InterceptorChainHandler(interceptorChain, handler) ;
+                }
+                while (interceptorHandlerIter.hasNext()) ;
+                
+                return interceptorChain.invokeNext(soapService, soapDetails, messageContext, messageResponseContext, action, streamReader) ;
+            }
+            else
+            {
+                return bodyHandler.invoke(soapDetails, messageContext, messageResponseContext, action, streamReader) ;
+            }
+        }
+        catch (final SoapFault sf)
+        {
+            throw sf ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SoapFault10(th) ;
+        }
+    }
+    
+    /**
+     * Handle the processing of the headers.
+     * @param messageContext The current message context.
+     * @param streamReader The XML stream reader.
+     * @param soapService The SOAP service.
+     * @param soapDetails The SOAP details.
+     * @throws XMLStreamException For XML parsing errors.
+     * @throws SoapFault For SOAP processing errors. 
+     */
+    private static void handleHeaders(final MessageContext messageContext, final XMLStreamReader streamReader,
+            final SoapService soapService, final SoapDetails soapDetails)
+        throws XMLStreamException, SoapFault
+    {
+        boolean finished = false ;
+        final LinkedList handlers = new LinkedList() ;
+        try
+        {
+            do
+            {
+                streamReader.nextTag() ;
+                if (streamReader.isEndElement())
+                {
+                    finished = true ;
+                }
+                else
+                {
+                    final String role = streamReader.getAttributeValue(soapDetails.getNamespaceURI(), soapDetails.getRoleLocalName()) ;
+                    if ((role == null) || role.equals(soapDetails.getLastRole()) ||
+                        role.equals(soapDetails.getNextRole()))
+                    {
+                        final QName headerName = streamReader.getName() ;
+                        final HeaderHandler headerHandler = soapService.getHeaderHandler(headerName) ;
+                        if (headerHandler == null)
+                        {
+                            checkMustUnderstand(streamReader, soapDetails) ;
+                            ElementConsumer.consume(streamReader) ;
+                        }
+                        else
+                        {
+                            headerHandler.invoke(streamReader, messageContext) ;
+                            handlers.add(headerHandler) ;
+                        }
+                        streamReader.require(XMLStreamConstants.END_ELEMENT,
+                                headerName.getNamespaceURI(), headerName.getLocalPart()) ;
+                    }
+                    else
+                    {
+                        ElementConsumer.consume(streamReader) ;
+                    }
+                }
+            }
+            while(!finished) ;
+            
+            final Map headerHandlers = soapService.getHeaderHandlers() ;
+            final Iterator headerHandlerIter = headerHandlers.values().iterator() ;
+            while(headerHandlerIter.hasNext())
+            {
+                final HeaderHandler handler = (HeaderHandler)headerHandlerIter.next() ;
+                handler.headerValidate(messageContext) ;
+            }
+        }
+        catch (final Throwable th)
+        {
+            final int numHandlers = handlers.size() ;
+            if (numHandlers > 0)
+            {
+                final ListIterator listIterator = handlers.listIterator(numHandlers) ;
+                do
+                {
+                    final HeaderHandler headerHandler = (HeaderHandler)listIterator.previous() ;
+                    headerHandler.headerFaultNotification(messageContext) ;
+                }
+                while(listIterator.hasPrevious()) ;
+            }
+            
+            if (th instanceof XMLStreamException)
+            {
+                throw (XMLStreamException)th ;
+            }
+            else if (th instanceof SoapFault)
+            {
+                final SoapFault soapFault = (SoapFault)th ;
+                soapFault.setHeaderFault(true) ;
+                throw soapFault ;
+            }
+            else if (th instanceof RuntimeException)
+            {
+                throw (RuntimeException)th ;
+            }
+            else
+            {
+                throw (Error)th ;
+            }
+        }
+    }
+    
+    /**
+     * Check the existence of the must understand parameter.
+     * @param streamReader
+     * @param soapDetails
+     * @throws XMLStreamException
+     * @throws SoapFault
+     * 
+     * @message com.arjuna.webservices.soap.SoapParser_3 [com.arjuna.webservices.soap.SoapParser_3] - Did not understand header: {0}
+     */
+    private static void checkMustUnderstand(final XMLStreamReader streamReader, final SoapDetails soapDetails)
+        throws XMLStreamException, SoapFault
+    {
+        final String mustUnderstand = streamReader.getAttributeValue(soapDetails.getNamespaceURI(),
+            SoapConstants.SOAP_MUST_UNDERSTAND_NAME) ;
+        if ((mustUnderstand != null) && ("1".equals(mustUnderstand) || "true".equalsIgnoreCase(mustUnderstand)))
+        {
+            final QName headerName = streamReader.getName() ;
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.soap.SoapParser_3") ;
+            final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+            final SoapFault10 soapFault = new SoapFault10(SoapFaultType.FAULT_MUST_UNDERSTAND, message) ;
+            soapFault.setHeaderElements(soapDetails.getMustUnderstandHeaders(headerName)) ;
+            throw soapFault ;
+        }
+    }
+    
+    /**
+     * The interceptor chain for processing the terminal body handler.
+     * @author kevin
+     */
+    private static class InterceptorBodyHandler implements InterceptorChain
+    {
+        /**
+         * The body handler.
+         */
+        private final BodyHandler bodyHandler ;
+        
+        /**
+         * Construct the interceptor body handler.
+         * @param bodyHandler The body handler.
+         */
+        InterceptorBodyHandler(final BodyHandler bodyHandler)
+        {
+            this.bodyHandler = bodyHandler ;
+        }
+        
+        /**
+         * Invoke the next interceptor in the chain.
+         * @param soapService The SOAP service being called.
+         * @param soapDetails The SOAP details.
+         * @param context The current message context.
+         * @param responseContext The response message context.
+         * @param action The transport SOAP action.
+         * @param in The current stream reader.
+         * @throws XMLStreamException for parsing errors.
+         * @throws SoapFault for processing errors.
+         * @return The response elements or null if one way.
+         */
+        public SoapBody invokeNext(final SoapService soapService,
+            final SoapDetails soapDetails, final MessageContext context,
+            final MessageContext responseContext, final String action,
+            final XMLStreamReader in)
+            throws XMLStreamException, SoapFault
+        {
+            return bodyHandler.invoke(soapDetails, context, responseContext, action, in) ;
+        }
+    }
+    
+    /**
+     * The interceptor chain for processing interceptor handlers.
+     * @author kevin
+     */
+    private static class InterceptorChainHandler implements InterceptorChain
+    {
+        /**
+         * The interceptor chain handler.
+         */
+        private final InterceptorChain interceptorChain ;
+        /**
+         * The interceptor handler.
+         */
+        private final InterceptorHandler interceptorHandler ;
+        
+        /**
+         * Construct the interceptor chain handler.
+         * @param interceptorChain The interceptor chain handler.
+         * @param interceptorHandler The interceptor handler.
+         */
+        InterceptorChainHandler(final InterceptorChain interceptorChain, final InterceptorHandler interceptorHandler)
+        {
+            this.interceptorChain = interceptorChain ;
+            this.interceptorHandler = interceptorHandler ;
+        }
+        
+        /**
+         * Invoke the next interceptor in the chain.
+         * @param soapService The SOAP service being called.
+         * @param soapDetails The SOAP details.
+         * @param context The current message context.
+         * @param responseContext The response message context.
+         * @param action The transport SOAP action.
+         * @param in The current stream reader.
+         * @throws XMLStreamException for parsing errors.
+         * @throws SoapFault for processing errors.
+         * @return The response elements or null if one way.
+         */
+        public SoapBody invokeNext(final SoapService soapService,
+            final SoapDetails soapDetails, final MessageContext context,
+            final MessageContext responseContext, final String action,
+            final XMLStreamReader in)
+            throws XMLStreamException, SoapFault
+        {
+            return interceptorHandler.invoke(interceptorChain, soapService, soapDetails, context, responseContext, action, in) ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapProcessorImpl.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/soap/SoapProcessorImpl.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/soap/SoapProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,100 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.soap;
+
+import java.io.IOException;
+import java.io.Reader;
+
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.SoapBody;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapMessage;
+import com.arjuna.webservices.SoapProcessor;
+import com.arjuna.webservices.SoapService;
+
+/**
+ * The SOAP processor implementation.
+ * @author kevin
+ */
+public class SoapProcessorImpl implements SoapProcessor
+{
+    /**
+     * The SOAP service associated with this processor.
+     */
+    private final SoapService soapService ;
+    /**
+     * The SOAP details associated with this processor.
+     */
+    private final SoapDetails soapDetails ;
+    
+    /**
+     * Create the SOAP processor for the specific SOAP service and details.
+     * @param soapService The SOAP service.
+     * @param soapDetails The SOAP details.
+     */
+    public SoapProcessorImpl(final SoapService soapService, final SoapDetails soapDetails)
+    {
+        this.soapService = soapService ;
+        this.soapDetails = soapDetails ;
+    }
+    
+    /**
+     * Process the input stream and generate a response.
+     * @param messageContext The message context for the request.
+     * @param messageResponseContext The message context for the response.
+     * @param action The transport SOAP action.
+     * @param reader The input reader.
+     * @return The SOAP response.
+     * @throws IOException For errors reading the input stream.
+     */
+    public SoapMessage process(final MessageContext messageContext, final MessageContext messageResponseContext, final String action, final Reader reader)
+    {
+        try
+        {
+            final XMLStreamReader streamReader = SoapUtils.getXMLStreamReader(reader) ;
+            final SoapBody response = soapService.parse(messageContext, messageResponseContext, action, streamReader, soapDetails) ;
+            if (response == null)
+            {
+                return null ;
+            }
+            
+            return new SoapBodyMessage(response, soapDetails, soapService, messageResponseContext) ;
+        }
+        catch (final SoapFault sf)
+        {
+            if (sf.isHeaderFault())
+            {
+                return new SoapFaultMessage(sf, soapDetails, null, messageContext) ;
+            }
+            else
+            {
+                return new SoapFaultMessage(sf, soapDetails, soapService, messageResponseContext) ;
+            }
+        }
+        catch (final Throwable th)
+        {
+            return new SoapFaultMessage(new SoapFault10(th), soapDetails) ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/stax (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/stax)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/transport)

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/transport/http/HttpClient.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -37,6 +37,7 @@
 
 import com.arjuna.webservices.MessageContext;
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.SoapMessage;
 import com.arjuna.webservices.SoapMessageLogging;
@@ -75,7 +76,7 @@
         final SoapMessage response = invokeRequest(request, url) ;
         if (response == null)
         {
-            throw new SoapFault(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_1")) ;
+            throw new SoapFault10(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_1")) ;
         }
         return response ;
     }
@@ -114,7 +115,7 @@
         }
         catch (final MalformedURLException murle)
         {
-            throw new SoapFault(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_2")) ;
+            throw new SoapFault10(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_2")) ;
         }
         
         final boolean threadLogEnabled = SoapMessageLogging.isThreadLogEnabled() ;
@@ -136,7 +137,7 @@
         }
         catch (final ClassCastException cce)
         {
-            throw new SoapFault(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_3")) ;
+            throw new SoapFault10(SoapFaultType.FAULT_SENDER, WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_3")) ;
         }
         
         httpURLConnection.setDoOutput(true) ;
@@ -199,7 +200,7 @@
         {
             final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.transport.http.HttpClient_4") ;
             final String message = MessageFormat.format(pattern, new Object[] {new Integer(responseCode)}) ;
-            throw new SoapFault(SoapFaultType.FAULT_SENDER, message) ;
+            throw new SoapFault10(SoapFaultType.FAULT_SENDER, message) ;
         }
         
         final String fullResponseContentType = httpURLConnection.getContentType() ;

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClientInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/transport/http/HttpClientInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpClientInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -25,6 +25,7 @@
 
 import com.arjuna.webservices.SoapClient;
 import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Context listener used to initialise the HTTP clients.
@@ -38,10 +39,14 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final SoapClient client = new HttpClient() ;
-        soapRegistry.registerSoapClient(HttpUtils.HTTP_SCHEME, client) ;
-        soapRegistry.registerSoapClient(HttpUtils.HTTPS_SCHEME, client) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               final SoapClient client = new HttpClient() ;
+               soapRegistry.registerSoapClient(HttpUtils.HTTP_SCHEME, client) ;
+               soapRegistry.registerSoapClient(HttpUtils.HTTPS_SCHEME, client) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/transport/http/HttpServiceMultiplexorServlet.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -39,6 +39,7 @@
 import com.arjuna.webservices.SoapService;
 import com.arjuna.webservices.SoapServiceEndpointProvider;
 import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Servlet handling SOAP requests over HTTP.
@@ -376,13 +377,25 @@
     private void config(final ServletConfig servletConfig)
         throws ServletException
     {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapServiceProvider(HttpUtils.HTTP_SCHEME, this) ;
-        soapRegistry.registerSoapServiceProvider(HttpUtils.HTTPS_SCHEME, this) ;
-        
+        final HttpServiceMultiplexorServlet servlet = this;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapServiceProvider(HttpUtils.HTTP_SCHEME, servlet) ;
+               soapRegistry.registerSoapServiceProvider(HttpUtils.HTTPS_SCHEME, servlet) ;
+           }
+        };
+
+        // must do this before we close the callback list because some of the other callbacks depend upon and
+        // we don't want to introduce a race
+
         baseHttpURI = processURI(servletConfig.getInitParameter("BaseHttpURI")) ;
         baseHttpsURI = processURI(servletConfig.getInitParameter("BaseHttpsURI")) ;
         
+        // this is the last WSC callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10);
+
         final String logPacketValue = servletConfig.getInitParameter("LogPackets") ;
         if (logPacketValue != null)
         {

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/StreamHelper.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/util/StreamHelper.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/StreamHelper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/util/StreamHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,381 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.util;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.ElementContent;
+
+/**
+ * Helper class for Stream operations.
+ * @author kevin
+ * 
+ * @message com.arjuna.webservices.util.StreamHelper_1 [com.arjuna.webservices.util.StreamHelper_1] - Unexpected end element: {0}
+ * @message com.arjuna.webservices.util.StreamHelper_2 [com.arjuna.webservices.util.StreamHelper_2] - Unexpected end of document reached
+ * @message com.arjuna.webservices.util.StreamHelper_3 [com.arjuna.webservices.util.StreamHelper_3] - Unexpected start element: {0}
+ */
+public class StreamHelper
+{
+    /**
+     * Pseudo namespace used to unbind a prefix.
+     */
+    private static final String UNBOUND_NAMESPACE = "http://www.arjuna.com/stax/parsing/unboundnamespace" ;
+    
+    /**
+     * Write a start element with appropriate namespace declarations if necessary
+     * @param out The output stream.
+     * @param elementName The element name.
+     * @return The previous namespace if written, null otherwise.
+     * @throws XMLStreamException for errors during writing.
+     */
+    public static String writeStartElement(final XMLStreamWriter out, final QName elementName)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(elementName.getNamespaceURI()) ;
+        final String localName = elementName.getLocalPart() ;
+        
+        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
+        
+        if (writeNamespace)
+        {
+            final String prefix = QNameHelper.getNormalisedValue(elementName.getPrefix()) ;
+            final String origNamespace = QNameHelper.getNormalisedValue(namespaceContext.getNamespaceURI(prefix)) ;
+            if (prefix.length() == 0)
+            {
+                out.setDefaultNamespace(namespaceURI) ;
+                out.writeStartElement(namespaceURI, localName) ;
+                out.writeDefaultNamespace(namespaceURI) ;
+            }
+            else
+            {
+                out.setPrefix(prefix, namespaceURI) ;
+                out.writeStartElement(namespaceURI, localName) ;
+                out.writeNamespace(prefix, namespaceURI) ;
+            }
+            return origNamespace ;
+        }
+        else
+        {
+            out.writeStartElement(namespaceURI, localName) ;
+            return null ;
+        }
+    }
+    
+    /**
+     * Write an end element removing the namespace binding if necessary
+     * @param out The output stream.
+     * @param prefix The element prefix.
+     * @param namespaceURI The previous binding for the prefix.
+     * @throws XMLStreamException for errors during writing.
+     */
+    public static void writeEndElement(final XMLStreamWriter out, final String prefix,
+        final String namespaceURI)
+        throws XMLStreamException
+    {
+        out.writeEndElement() ;
+        if (namespaceURI != null)
+        {
+            final String resetNamespace = (namespaceURI.length() == 0 ? UNBOUND_NAMESPACE : namespaceURI) ;
+            
+            if (prefix.length() == 0)
+            {
+                out.setDefaultNamespace(resetNamespace) ;
+            }
+            else
+            {
+                out.setPrefix(prefix, resetNamespace) ;
+            }
+        }
+    }
+    
+    /**
+     * Write the element to the stream.
+     * @param out The output stream.
+     * @param elementName The name of the element.
+     * @param elementContent The element contents.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeElement(final XMLStreamWriter out, final QName elementName,
+        final ElementContent elementContent)
+        throws XMLStreamException
+    {
+        final String origNamespace = writeStartElement(out, elementName) ;
+        elementContent.writeContent(out) ;
+        writeEndElement(out, elementName.getPrefix(), origNamespace) ;
+    }
+
+    /**
+     * Write the attributes to the stream.
+     * @param out The output stream.
+     * @param attributes The attributes.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttributes(final XMLStreamWriter out, final Map attributes)
+        throws XMLStreamException
+    {
+        final Set entrySet = attributes.entrySet() ;
+        final Iterator entryIter = entrySet.iterator() ;
+        while(entryIter.hasNext())
+        {
+            final Map.Entry entry = (Map.Entry)entryIter.next() ;
+            final QName name = (QName)entry.getKey() ;
+            final Object value = entry.getValue() ;
+            writeAttribute(out, name, value) ;
+        }
+    }
+    
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final Object attributeValue)
+        throws XMLStreamException
+    {
+        if (attributeValue instanceof QName)
+        {
+            writeAttribute(out, attributeName, (QName)attributeValue) ;
+        }
+        else
+        {
+            writeAttribute(out, attributeName, attributeValue.toString()) ;
+        }
+    }
+    
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value as a QName.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final QName attributeValue)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(attributeValue.getNamespaceURI()) ;
+        if (namespaceURI.length() == 0)
+        {
+            writeAttribute(out, attributeName, attributeValue.getLocalPart()) ;
+        }
+        else
+        {
+            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
+            
+            if (origPrefix == null)
+            {
+                final String prefix = QNameHelper.getNormalisedValue(attributeValue.getPrefix()) ;
+                writeNamespace(out, prefix, namespaceURI) ;
+                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(attributeValue)) ;
+            }
+            else
+            {
+                // KEV must handle clashes with default namespace
+                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(origPrefix, attributeValue.getLocalPart())) ;
+            }
+        }
+    }
+    
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final String attributeValue)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(attributeName.getNamespaceURI()) ;
+        final String localName = attributeName.getLocalPart() ;
+        
+        if (namespaceURI.length() == 0)
+        {
+            out.writeAttribute(localName, attributeValue) ;
+        }
+        else
+        {
+            // KEV must handle clashes with default namespace
+            final String prefix = QNameHelper.getNormalisedValue(attributeName.getPrefix()) ;
+            writeNamespace(out, prefix, namespaceURI) ;
+            out.writeAttribute(namespaceURI, localName, attributeValue) ;
+        }
+    }
+    
+    /**
+     * Write the QName to the stream as text.
+     * @param out The output stream.
+     * @param qName The qualified name.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeQualifiedName(final XMLStreamWriter out, final QName qName)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(qName.getNamespaceURI()) ;
+        
+        if (namespaceURI.length() == 0)
+        {
+            out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
+        }
+        else
+        {
+            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
+            
+            if (origPrefix == null)
+            {
+                final String prefix = QNameHelper.getNormalisedValue(qName.getPrefix()) ;
+                writeNamespace(out, prefix, namespaceURI) ;
+                out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
+            }
+            else
+            {
+                // KEV must handle clashes with default namespace
+                out.writeCharacters(QNameHelper.toQualifiedName(origPrefix, qName.getLocalPart())) ;
+            }
+        }
+    }
+    
+    /**
+     * Write the namespace if necessary.
+     * @param out The output stream.
+     * @param prefix The namespace prefix.
+     * @param namespaceURI The namespaceURI.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeNamespace(final XMLStreamWriter out, final String prefix, final String namespaceURI)
+        throws XMLStreamException
+    {
+        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+            
+        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
+        if (writeNamespace)
+        {
+            out.setPrefix(prefix, namespaceURI) ;
+            out.writeNamespace(prefix, namespaceURI) ;
+        }
+    }
+
+    /**
+     * Make sure the stream is at the start of the next element.
+     * @param streamReader The current stream reader.
+     * @throws XMLStreamException For parsing errors.
+     */
+    public static void skipToNextStartElement(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        if (streamReader.hasNext())
+        {
+            streamReader.nextTag() ;
+            if (streamReader.isEndElement())
+            {
+                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_1") ;
+                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                throw new XMLStreamException(message) ;
+            }
+        }
+        else
+        {
+            throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
+        }
+    }
+
+    /**
+     * Make sure the stream is at the start of an element.
+     * @param streamReader The current stream reader.
+     * @throws XMLStreamException For parsing errors.
+     */
+    public static void skipToStartElement(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        while (!streamReader.isStartElement())
+        {
+            if (streamReader.hasNext())
+            {
+                streamReader.next() ;
+            }
+            else
+            {
+                throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
+            }
+        }
+    }
+
+    /**
+     * Check the next start tag is as expected.
+     * @param streamReader The stream reader.
+     * @param expected The expected qualified name.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static void checkNextStartTag(final XMLStreamReader streamReader, final QName expected)
+        throws XMLStreamException
+    {
+        skipToNextStartElement(streamReader) ;
+        checkTag(streamReader, expected) ;
+    }
+    
+    /**
+     * Compare the element tag with the expected qualified name.
+     * @param streamReader The current stream reader.
+     * @param expected The expected qualified name.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static void checkTag(final XMLStreamReader streamReader, final QName expected)
+        throws XMLStreamException
+    {
+        final QName elementName = streamReader.getName() ;
+        if (!expected.equals(elementName))
+        {
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_3") ;
+            final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
+            throw new XMLStreamException(message) ;
+        }
+    }
+
+    /**
+     * Check to see if the parent element is finished.
+     * @param streamReader The stream reader.
+     * @return true if it is finished, false otherwise.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static boolean checkParentFinished(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        return (streamReader.nextTag() == XMLStreamConstants.END_ELEMENT) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005 (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr2005)

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/AddressingContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr2005/AddressingContext.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/AddressingContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -32,6 +32,7 @@
 
 import com.arjuna.webservices.MessageContext;
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.logging.WSCLogger;
 import com.arjuna.webservices.stax.AnyContentSupport;
 import com.arjuna.webservices.stax.NamedElement;
@@ -405,13 +406,13 @@
                 soapFaultHeaders.add(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_RELATES_TO, relationship)) ;
             }
         }
-        final NamedElement[] currentHeaders = soapFault.getHeaderElements() ;
+        final NamedElement[] currentHeaders = ((SoapFault10)soapFault).getHeaderElements() ;
         final int numHeaderElements = (currentHeaders == null ? 0 : currentHeaders.length) ;
         for(int count = 0 ; count < numHeaderElements ; count++)
         {
             soapFaultHeaders.add(currentHeaders[count]) ;
         }
-        soapFault.setHeaderElements((NamedElement[]) soapFaultHeaders.toArray(new NamedElement[soapFaultHeaders.size()])) ;
+        ((SoapFault10)soapFault).setHeaderElements((NamedElement[]) soapFaultHeaders.toArray(new NamedElement[soapFaultHeaders.size()])) ;
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/handlers/AddressingInterceptorHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsaddr2005/handlers/AddressingInterceptorHandler.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsaddr2005/handlers/AddressingInterceptorHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -33,6 +33,7 @@
 import com.arjuna.webservices.MessageContext;
 import com.arjuna.webservices.SoapBody;
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.SoapService;
 import com.arjuna.webservices.logging.WSCLogger;
@@ -191,7 +192,7 @@
                                     final AnyElement detail = new AnyElement() ;
                                     detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_IRI, responseAddressingContext.getTo())) ;
                                     final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
-                                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_DESTINATION_UNREACHABLE,
+                                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_DESTINATION_UNREACHABLE,
                                         "Destination unreachable", detailElement) ;
                                     soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
                                     throw soapFault ;
@@ -238,7 +239,7 @@
                             }
                             catch (final IOException ioe)
                             {
-                                throw new SoapFault(ioe) ;
+                                throw new SoapFault10(ioe) ;
                             }
                         }
                         return null ;
@@ -299,15 +300,13 @@
         }
         catch (final Throwable th)
         {
-            throw new SoapFault(th) ;
+            throw new SoapFault10(th) ;
         }
     }
     
     /**
      * Generate a SOAP fault for a duplicate addressing header.
      * @param context The message context.
-     * @param headerName The qualified name of the header.
-     * @param header The contents of the header.
      * @return The SOAP fault.
      */
     protected SoapFault initialiseMissingActionSoapFault(final MessageContext context)
@@ -316,7 +315,7 @@
         detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(AddressingConstants.WSA_ELEMENT_QNAME_ACTION))) ;
         
         final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
-        final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_MESSAGING_ADDRESSING_HEADER_REQUIRED,
+        final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_MESSAGING_ADDRESSING_HEADER_REQUIRED,
             "Missing Addressing Header", detailElement) ;
         soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;
         soapFault.setHeaderFault(true) ;
@@ -339,7 +338,7 @@
         detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER_QNAME, new AttributedQNameType(headerName))) ;
         detail.putAnyContent(new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_PROBLEM_HEADER, problemHeader)) ;
         final NamedElement detailElement = new NamedElement(AddressingConstants.WSA_ELEMENT_QNAME_FAULT_DETAIL, detail) ;
-        final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_ADDRESSING_HEADER,
+        final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_ADDRESSING_HEADER,
             "Duplicate Addressing Header", detailElement) ;
         soapFault.setSubSubcode(AddressingConstants.WSA_FAULT_CODE_QNAME_INVALID_CARDINALITY) ;
         soapFault.setAction(AddressingConstants.WSA_ACTION_FAULT) ;

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/ArjunaContext.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/ArjunaContext.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/ArjunaContext.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/ArjunaContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,174 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.wsarj;
+
+import java.text.MessageFormat;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.MessageContext;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.AnyContentSupport;
+import com.arjuna.webservices.util.StreamHelper;
+
+/**
+ * The arjuna context.
+ * @author kevin
+ */
+public class ArjunaContext extends AnyContentSupport
+{
+    /**
+     * The key used for the arjuna context within a message exchange.
+     */
+    private static final byte[] ARJUNA_CONTEXT_PROPERTY = new byte[0] ;
+    
+    /**
+     * The InstanceIdentifier header.
+     */
+    private InstanceIdentifier instanceIdentifier ;
+    
+    /**
+     * Default constructor.
+     */
+    private ArjunaContext()
+    {
+    }
+    
+    /**
+     * Construct an arjuna context from the input stream.
+     * N.B. This method is for testing purposes only.
+     * 
+     * @param in The input stream.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public ArjunaContext(final XMLStreamReader in)
+        throws XMLStreamException
+    {
+        parse(in) ;
+    }
+    
+    /**
+     * Get the instance identifier.
+     * @return The instance identifier.
+     */
+    public InstanceIdentifier getInstanceIdentifier()
+    {
+        return instanceIdentifier ;
+    }
+    
+    /**
+     * Set the instance identifier.
+     * @param instanceIdentifier The instance identifier.
+     */
+    public void setInstanceIdentifier(final InstanceIdentifier instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+    
+    /**
+     * Write the content of the context to the stream.
+     * @param out The current output stream.
+     * @message com.arjuna.webservices.wsarj.ArjunaContext_1 [com.arjuna.webservices.wsarj.ArjunaContext_1] - Arjuna context is not valid
+     */
+    public void writeChildContent(final XMLStreamWriter out)
+        throws XMLStreamException
+    {
+       if (!isValid())
+       {
+           throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_1")) ;
+       }
+       
+       StreamHelper.writeElement(out, ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME, instanceIdentifier) ;
+       
+       super.writeChildContent(out) ;
+    }
+
+    /**
+     * Add the element.
+     * @param in The current input stream.
+     * @param elementName The qualified element name.
+     * @message com.arjuna.webservices.wsarj.ArjunaContext_2 [com.arjuna.webservices.wsarj.ArjunaContext_2] - Unexpected element name: {0}
+     */
+    protected void putElement(final XMLStreamReader in,
+        final QName elementName)
+        throws XMLStreamException
+    {
+        if (ArjunaConstants.WSARJ_ATTRIBUTE_NAMESPACE.equals(elementName.getNamespaceURI()))
+        {
+            final String localPart = elementName.getLocalPart() ;
+            if (ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER.equals(localPart))
+            {
+                setInstanceIdentifier(new InstanceIdentifier(in)) ;
+            }
+            else
+            {
+                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_2") ;
+                final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
+                throw new XMLStreamException(message) ;
+            }
+        }
+        else
+        {
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.ArjunaContext_2") ;
+            final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
+            throw new XMLStreamException(message) ;
+        }
+    }
+    
+    /**
+     * Is the configuration of this element valid?
+     * @return true if valid, false otherwise.
+     */
+    public boolean isValid()
+    {
+        return ((instanceIdentifier != null) && instanceIdentifier.isValid()) ;
+    }
+
+    /**
+     * Get the arjuna context from the message context if present.
+     * @param messageContext The message context.
+     * @return The arjuna context or null if not present.
+     */
+    public static ArjunaContext getCurrentContext(final MessageContext messageContext)
+    {
+        return (ArjunaContext)messageContext.getProperty(ARJUNA_CONTEXT_PROPERTY) ;
+    }
+
+    /**
+     * Get the arjuna context from the message context.
+     * @param messageContext The message context.
+     * @return The arjuna context.
+     */
+    public static ArjunaContext getContext(final MessageContext messageContext)
+    {
+        final ArjunaContext current = (ArjunaContext)messageContext.getProperty(ARJUNA_CONTEXT_PROPERTY) ;
+        if (current != null)
+        {
+            return current ;
+        }
+        final ArjunaContext newContext = new ArjunaContext() ;
+        messageContext.setProperty(ARJUNA_CONTEXT_PROPERTY, newContext) ;
+        return newContext ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/InstanceIdentifier.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/InstanceIdentifier.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/InstanceIdentifier.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/InstanceIdentifier.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,161 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.wsarj;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.stax.ElementContent;
+import com.arjuna.webservices.stax.NamedElement;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+
+/**
+ * Representation of an InstanceIdentifier element.
+ * @author kevin
+ */
+public class InstanceIdentifier extends ElementContent
+{
+    /**
+     * The instance identifier.
+     */
+    private String instanceIdentifier ;
+    
+    /**
+     * Default constructor.
+     */
+    public InstanceIdentifier()
+    {
+    }
+    
+    /**
+     * Construct an instance identifier with the specific identifier
+     * @param instanceIdentifier The instance identifier.
+     */
+    public InstanceIdentifier(final String instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+    
+    /**
+     * Construct the InstanceIdentifier from the input stream.
+     * @param in The input stream.
+     * @throws XMLStreamException for parsing errors.
+     */
+    public InstanceIdentifier(final XMLStreamReader in)
+        throws XMLStreamException
+    {
+        parse(in) ;
+    }
+    
+    /**
+     * Add the element.
+     * @param in The current input stream.
+     * @param elementName The qualified element name.
+     * @message com.arjuna.webservices.wsarj.InstanceIdentifier_1 [com.arjuna.webservices.wsarj.InstanceIdentifier_1] - InstanceIdentifier elements cannot have embedded elements.
+     */
+    protected void putElement(final XMLStreamReader in,
+        final QName elementName)
+        throws XMLStreamException
+    {
+        throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsarj.InstanceIdentifier_1")) ;
+    }
+    
+    /**
+     * Set the text value of this element.
+     * @param in The current input stream.
+     * @param value The text value of this element.
+     */
+    protected void putValue(final XMLStreamReader in, final String value)
+        throws XMLStreamException
+    {
+        instanceIdentifier = value ;
+    }
+    
+    /**
+     * Set the instance identifier of this element.
+     * @param instanceIdentifier The instance identifier of the element.
+     */
+    public void setInstanceIdentifier(final String instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+    
+    /**
+     * Get the instance identifier of this element.
+     * @return The instance identifier of the element or null if not set.
+     */
+    public String getInstanceIdentifier()
+    {
+        return instanceIdentifier ;
+    }
+    
+    /**
+     * Write the child content of the element.
+     * @param out The output stream.
+     */
+    protected void writeChildContent(final XMLStreamWriter out)
+        throws XMLStreamException
+    {
+        out.writeCharacters(instanceIdentifier) ;
+    }
+    
+    /**
+     * Is the configuration of this element valid?
+     * @return true if valid, false otherwise.
+     */
+    public boolean isValid()
+    {
+        return (instanceIdentifier != null) && (instanceIdentifier.trim().length() > 0)
+            && super.isValid() ;
+    }
+    
+    /**
+     * Get a string representation of this instance identifier.
+     * @return the string representation.
+     */
+    public String toString()
+    {
+        return (instanceIdentifier != null ? instanceIdentifier : "") ;
+    }
+    
+    /**
+     * Set the identifier on the endpoint reference.
+     * @param endpointReference The endpoint reference.
+     * @param identifier The identifier.
+     */
+    public static void setEndpointInstanceIdentifier(final EndpointReferenceType endpointReference, final String identifier)
+    {
+        setEndpointInstanceIdentifier(endpointReference, new InstanceIdentifier(identifier)) ;
+    }
+    
+    /**
+     * Set the identifier on the endpoint reference.
+     * @param endpointReference The endpoint reference.
+     * @param instanceIdentifier The identifier.
+     */
+    public static void setEndpointInstanceIdentifier(final EndpointReferenceType endpointReference, final InstanceIdentifier instanceIdentifier)
+    {
+        endpointReference.addReferenceParameter(new NamedElement(ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME, instanceIdentifier)) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/handler (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/handler)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/policy (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/policy)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wsarj/processor (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wsarj/processor)

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor)

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor/server/ActivationCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -29,6 +29,7 @@
 import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
 import com.arjuna.webservices.wscoor.CoordinationConstants;
 import com.arjuna.webservices.wscoor.policy.ActivationCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Activation Coordinator service
@@ -42,16 +43,20 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Activation coordinator.
-        ActivationCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Activation coordinator.
+               ActivationCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR,
+                   new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationRequesterInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor/server/ActivationRequesterInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/ActivationRequesterInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -29,6 +29,7 @@
 import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
 import com.arjuna.webservices.wscoor.CoordinationConstants;
 import com.arjuna.webservices.wscoor.policy.ActivationRequesterPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Activation Requester service
@@ -42,16 +43,20 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Activation coordinator.
-        ActivationRequesterPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(CoordinationConstants.SERVICE_ACTIVATION_REQUESTER,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Activation coordinator.
+               ActivationRequesterPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(CoordinationConstants.SERVICE_ACTIVATION_REQUESTER,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor/server/RegistrationCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wscoor.CoordinationConstants;
 import com.arjuna.webservices.wscoor.policy.RegistrationCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Registration Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Registration coordinator.
-        RegistrationCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Registration coordinator.
+               RegistrationCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationRequesterInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/wscoor/server/RegistrationRequesterInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/webservices/wscoor/server/RegistrationRequesterInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -29,6 +29,7 @@
 import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
 import com.arjuna.webservices.wscoor.CoordinationConstants;
 import com.arjuna.webservices.wscoor.policy.RegistrationRequesterPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Registration Requester service
@@ -42,16 +43,20 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Registration coordinator.
-        RegistrationRequesterPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(CoordinationConstants.SERVICE_REGISTRATION_REQUESTER,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Registration coordinator.
+               RegistrationRequesterPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(CoordinationConstants.SERVICE_REGISTRATION_REQUESTER,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ActivationCoordinator.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,160 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc;
+
+import java.io.IOException;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.CreateCoordinationContextResponseType;
+import com.arjuna.webservices.wscoor.client.ActivationCoordinatorClient;
+import com.arjuna.webservices.wscoor.processors.ActivationRequesterCallback;
+import com.arjuna.webservices.wscoor.processors.ActivationRequesterProcessor;
+
+/**
+ * Wrapper around low level Activation Coordinator messaging.
+ * @author kevin
+ */
+public class ActivationCoordinator
+{
+    /**
+     * Create the coordination context.
+     * @param activationCoordinatorURI The URI of the activation coordinator.
+     * @param messageID The messageID to use.
+     * @param coordinationTypeURI The coordination type.
+     * @param expires The expiry time or null.
+     * @param currentContext The currnt context or null.
+     * @return The coordination context.
+     * @throws InvalidCreateParametersException if the create parameters are invalid.
+     * @throws SoapFault for errors during processing.
+     * 
+     * @message com.arjuna.wsc.ActivationCoordinator_1 [com.arjuna.wsc.ActivationCoordinator_1] - Callback execution failed
+     * @message com.arjuna.wsc.ActivationCoordinator_2 [com.arjuna.wsc.ActivationCoordinator_2] - Callback wasn't triggered
+     */
+    public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI,
+        final String messageID, final String coordinationTypeURI, final Long expires,
+        final CoordinationContextType currentContext)
+        throws InvalidCreateParametersException, SoapFault
+    {
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(activationCoordinatorURI, messageID) ;
+        
+        final AttributedUnsignedIntType expiresValue = (expires == null ? null : new AttributedUnsignedIntType(expires.longValue())) ;
+        final RequestCallback callback = new RequestCallback() ;
+        final ActivationRequesterProcessor activationRequester = ActivationRequesterProcessor.getRequester() ;
+        activationRequester.registerCallback(messageID, callback) ;
+        try
+        {
+            ActivationCoordinatorClient.getClient().sendCreateCoordination(addressingContext,
+                    coordinationTypeURI, expiresValue, null) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final IOException ioe)
+        {
+            throw new SoapFault10(ioe) ;
+        }
+        finally
+        {
+            activationRequester.removeCallback(messageID) ;
+        }
+        
+        if (callback.hasFailed())
+        {
+            throw new SoapFault10(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.ActivationCoordinator_1")) ;
+        }
+        else if (!callback.hasTriggered())
+        {
+            throw new SoapFault10(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.ActivationCoordinator_2")) ;
+        }
+        
+        final CreateCoordinationContextResponseType response = callback.getCreateCoordinationContextResponse() ;
+        if (response != null)
+        {
+            return response.getCoordinationContext() ;
+        }
+        final SoapFault soapFault = callback.getSoapFault() ;
+        if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(soapFault.getSubcode()))
+        {
+            throw new InvalidCreateParametersException(soapFault.getReason()) ;
+        }
+        throw soapFault ;
+    }
+    
+    /**
+     * The request callback.
+     * @author kevin
+     */
+    private static final class RequestCallback extends ActivationRequesterCallback
+    {
+        /**
+         * The response.
+         */
+        private CreateCoordinationContextResponseType createCoordinationContextResponse ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        
+        /**
+         * A create coordination context response.
+         * @param createCoordinationContextResponse The response.
+         * @param addressingContext The current addressing context.
+         */
+        public void createCoordinationContextResponse(final CreateCoordinationContextResponseType createCoordinationContextResponse,
+            final AddressingContext addressingContext)
+        {
+            this.createCoordinationContextResponse = createCoordinationContextResponse ;
+        }
+
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault response.
+         * @param addressingContext The current addressing context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+        {
+            this.soapFault = soapFault ;
+        }
+        
+        /**
+         * Get the create coordination context response.
+         * @return The create coordination context response.
+         */
+        CreateCoordinationContextResponseType getCreateCoordinationContextResponse()
+        {
+            return createCoordinationContextResponse ;
+        }
+        
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault or null.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,69 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * ContextFactory.java
+ */
+
+package com.arjuna.wsc;
+
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+public interface ContextFactory
+{
+    /**
+     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
+     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
+     * protocol identifiers.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+	
+    public void install(final String coordinationTypeURI);
+
+    /**
+     * Creates a coordination context.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     * @param expires the expire date/time for the returned context, can be null
+     * @param currentContext the current coordination context, can be null
+     *
+     * @return the created coordination context
+     *
+     * @throws InvalidCreateParametersException if a parameter passed is invalid
+     *         this activity identifier
+     */
+	
+    public CoordinationContextType create(final String coordinationTypeURI,
+            final Long expires, final CoordinationContextType currentContext)
+        throws InvalidCreateParametersException;
+
+    /**
+     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
+     * times if the context factory is removed from multiple context factory mappers or from the same context factory
+     * mapper with different coordination type uris.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+	
+    public void uninstall(final String coordinationTypeURI);
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactoryMapper.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/ContextFactoryMapper.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactoryMapper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ContextFactoryMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,165 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * ContextFactoryMapper.java
+ */
+
+package com.arjuna.wsc;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The context factory mapper.
+ * @author kevin
+ */
+public class ContextFactoryMapper
+{
+    /**
+     * The factory singleton.
+     */
+    private static final ContextFactoryMapper FACTORY = new ContextFactoryMapper() ;
+    
+    /**
+     * The context factory map.
+     */
+    private final Map contextFactoryMap = new HashMap() ;
+    /**
+     * The subordinate context factory mapper.
+     */
+    private ContextFactoryMapper subordinateContextFactoryMapper ;
+    /**
+     * The default context factory.
+     */
+    private ContextFactory defaultContextFactory ;
+    
+    /**
+     * Get the context factory mapper singleton.
+     * @return The context factory mapper singleton.
+     */
+    public static ContextFactoryMapper getFactory()
+    {
+        return FACTORY ;
+    }
+    
+    /**
+     * Default constructor
+     */
+    protected ContextFactoryMapper()
+    {
+    }
+    
+    /**
+     * Add a context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     * @param contextFactory The context factory.
+     */
+    public void addContextFactory(final String coordinationTypeURI, final ContextFactory contextFactory)
+    {
+        synchronized(contextFactoryMap)
+        {
+            contextFactoryMap.put(coordinationTypeURI, contextFactory) ;
+        }
+        contextFactory.install(coordinationTypeURI) ;
+    }
+
+    /**
+     * Get the context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     * @return The context factory.
+     */
+    public ContextFactory getContextFactory(final String coordinationTypeURI)
+    {
+        final Object localContextFactory ;
+        synchronized(contextFactoryMap)
+        {
+            localContextFactory = contextFactoryMap.get(coordinationTypeURI) ;
+        }
+        if (localContextFactory != null)
+        {
+            return (ContextFactory)localContextFactory ;
+        }
+        if (subordinateContextFactoryMapper != null)
+        {
+            final ContextFactory subordinateContextFactory = subordinateContextFactoryMapper.getContextFactory(coordinationTypeURI) ;
+            if (subordinateContextFactory != null)
+            {
+                return subordinateContextFactory ;
+            }
+        }
+        return defaultContextFactory ;
+    }
+
+    /**
+     * Remove the context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     */
+    public void removeContextFactory(final String coordinationTypeURI)
+    {
+        final Object localContextFactory ;
+        synchronized(contextFactoryMap)
+        {
+            localContextFactory = contextFactoryMap.remove(coordinationTypeURI) ;
+        }
+        if (localContextFactory != null)
+        {
+            ((ContextFactory)localContextFactory).uninstall(coordinationTypeURI) ;
+        }
+    }
+
+    /**
+     * Get the subordinate coordination factory mapper.
+     * @return The subordinate coordination factory mapper.
+     */
+    public ContextFactoryMapper getSubordinateContextFactoryMapper()
+    {
+        return subordinateContextFactoryMapper ;
+    }
+
+    /**
+     * Set a subordinate coordination factory mapper.
+     * @param subordinateContextFactoryMapper The subordinate coordination factory mapper.
+     */
+    public void setSubordinateContextFactoryMapper(final ContextFactoryMapper subordinateContextFactoryMapper)
+    {
+        this.subordinateContextFactoryMapper = subordinateContextFactoryMapper ;
+    }
+
+    /**
+     * Get the default coordination factory.
+     * @return The default coordination factory.
+     */
+    public ContextFactory getDefaultContextFactory()
+    {
+        return defaultContextFactory ;
+    }
+
+    /**
+     * Set the default coordination factory.
+     * @param defaultContextFactory The default coordination factory.
+     */
+    public void setDefaultContextFactory(final ContextFactory defaultContextFactory)
+    {
+        this.defaultContextFactory = defaultContextFactory ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/Registrar.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/Registrar.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/Registrar.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/Registrar.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,71 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * Registrar.java
+ */
+
+package com.arjuna.wsc;
+
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+
+public interface Registrar
+{
+    /**
+     * Called when a registrar is added to a register mapper. This method will be called multiple times if the
+     * registrar is added to multiple register mappers or to the same register mapper with different protocol
+     * identifiers.
+     *
+     * @param protocolIdentifier the protocol identifier
+     */
+    public void install(final String protocolIdentifier);
+
+    /**
+     * Registers the interest of participant in a particular protocol.
+     *
+     * @param participantProtocolService the port reference of the participant protocol service
+     * @param protocolIdentifier the protocol identifier
+     * @param instanceIdentifier the instance identifier, this may be null
+     *
+     * @return the port reference of the coordinator protocol service
+     *
+     * @throws AlreadyRegisteredException if the participant is already registered for this coordination protocol under
+     *         this activity identifier
+     * @throws InvalidProtocolException if the coordination protocol is not supported
+     * @throws InvalidStateException if the state of the coordinator no longer allows registration for this
+     *         coordination protocol
+     * @throws NoActivityException if the actvity does not exist
+     */
+    public EndpointReferenceType register(final EndpointReferenceType participantProtocolService,
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+        throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException;
+
+    /**
+     * Called when a registrar is removed from a register mapper. This method will be called multiple times if the
+     * registrar is removed from multiple register mappers or from the same register mapper with different protocol
+     * identifiers.
+     *
+     * @param protocolIdentifier the protocol identifier
+     */
+    public void uninstall(final String protocolIdentifier);
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrarMapper.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrarMapper.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrarMapper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrarMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,109 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * RegistrarMapper.java
+ */
+
+package com.arjuna.wsc;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The registrar mapper.
+ * @author kevin
+ */
+public class RegistrarMapper
+{
+    /**
+     * The factory singleton.
+     */
+    private static final RegistrarMapper FACTORY = new RegistrarMapper() ;
+    
+    /**
+     * The registrar map.
+     */
+    private final Map registrarMap = new HashMap() ;
+    
+    /**
+     * Get the registrar mapper singleton.
+     * @return The registrar mapper singleton.
+     */
+    public static RegistrarMapper getFactory()
+    {
+        return FACTORY ;
+    }
+    
+    /**
+     * Default constructor
+     */
+    protected RegistrarMapper()
+    {
+    }
+    
+    /**
+     * Add a registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     * @param registrar The registrar.
+     */
+    public void addRegistrar(final String protocolIdentifier, final Registrar registrar)
+    {
+        synchronized(registrarMap)
+        {
+            registrarMap.put(protocolIdentifier, registrar) ;
+        }
+        registrar.install(protocolIdentifier) ;
+    }
+
+    /**
+     * Get the registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     * @return The registrar.
+     */
+    public Registrar getRegistrar(final String protocolIdentifier)
+    {
+        final Object localRegistrar ;
+        synchronized(registrarMap)
+        {
+            localRegistrar = registrarMap.get(protocolIdentifier) ;
+        }
+        return (Registrar)localRegistrar ;
+    }
+
+    /**
+     * Remove the registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     */
+    public void removeRegistrar(final String protocolIdentifier)
+    {
+        final Object localRegistrar ;
+        synchronized(registrarMap)
+        {
+            localRegistrar = registrarMap.remove(protocolIdentifier) ;
+        }
+        if (localRegistrar != null)
+        {
+            ((Registrar)localRegistrar).uninstall(protocolIdentifier) ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrationCoordinator.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/RegistrationCoordinator.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrationCoordinator.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/RegistrationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,178 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc;
+
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.webservices.wscoor.RegisterResponseType;
+import com.arjuna.webservices.wscoor.client.RegistrationCoordinatorClient;
+import com.arjuna.webservices.wscoor.processors.RegistrationRequesterCallback;
+import com.arjuna.webservices.wscoor.processors.RegistrationRequesterProcessor;
+
+
+/**
+ * Wrapper around low level Registration Coordinator messaging.
+ * @author kevin
+ */
+public class RegistrationCoordinator
+{
+    /**
+     * Register the participant in the protocol.
+     * @param coordinationContext The current coordination context
+     * @param messageID The messageID to use.
+     * @param participantProtocolService The participant protocol service.
+     * @param protocolIdentifier The protocol identifier.
+     * @return The endpoint reference of the coordinator protocol service.
+     * @throws AlreadyRegisteredException If the participant is already registered. 
+     * @throws InvalidProtocolException If the protocol is unsupported.
+     * @throws InvalidStateException If the state is invalid
+     * @throws NoActivityException If there is to activity context active.
+     * @throws SoapFault for errors during processing.
+     * 
+     * @message com.arjuna.wsc.RegistrationCoordinator_1 [com.arjuna.wsc.RegistrationCoordinator_1] - Callback execution failed
+     * @message com.arjuna.wsc.RegistrationCoordinator_2 [com.arjuna.wsc.RegistrationCoordinator_2] - Callback wasn't triggered
+     */
+    public static EndpointReferenceType register(final CoordinationContextType coordinationContext,
+        final String messageID, final EndpointReferenceType participantProtocolService,
+        final String protocolIdentifier)
+        throws AlreadyRegisteredException, InvalidProtocolException,
+            InvalidStateException, NoActivityException, SoapFault
+    {
+        final EndpointReferenceType endpointReference = coordinationContext.getRegistrationService() ;
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(endpointReference, messageID) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final RegistrationRequesterProcessor registrationRequester = RegistrationRequesterProcessor.getRequester() ;
+        registrationRequester.registerCallback(messageID, callback) ;
+        try
+        {
+            RegistrationCoordinatorClient.getClient().sendRegister(addressingContext, protocolIdentifier, participantProtocolService) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final IOException ioe)
+        {
+            throw new SoapFault10(ioe) ;
+        }
+        finally
+        {
+            registrationRequester.removeCallback(messageID) ;
+        }
+        
+        if (callback.hasFailed())
+        {
+            throw new SoapFault10(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.RegistrationCoordinator_1")) ;
+        }
+        else if (!callback.hasTriggered())
+        {
+            throw new SoapFault10(SoapFaultType.FAULT_RECEIVER, null, WSCLogger.log_mesg.getString("com.arjuna.wsc.RegistrationCoordinator_2")) ;
+        }
+        
+        final RegisterResponseType response = callback.getRegisterResponse() ;
+        if (response != null)
+        {
+            return response.getCoordinatorProtocolService() ;
+        }
+        final SoapFault soapFault = callback.getSoapFault() ;
+        final QName subcode = soapFault.getSubcode() ;
+        if (CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME.equals(subcode))
+        {
+            throw new AlreadyRegisteredException(soapFault.getReason()) ;
+        }
+        else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode))
+        {
+            throw new InvalidProtocolException(soapFault.getReason()) ;
+        }
+        else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode))
+        {
+            throw new InvalidStateException(soapFault.getReason()) ;
+        }
+        else if (CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME.equals(subcode))
+        {
+            throw new NoActivityException(soapFault.getReason()) ;
+        }
+        throw soapFault ;
+    }
+    
+    /**
+     * The request callback.
+     * @author kevin
+     */
+    private static final class RequestCallback extends RegistrationRequesterCallback
+    {
+        /**
+         * The response.
+         */
+        private RegisterResponseType registerResponse ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        
+        /**
+         * A register response.
+         * @param registerResponse The response.
+         * @param addressingContext The current addressing context.
+         */
+        public void registerResponse(final RegisterResponseType registerResponse,
+            final AddressingContext addressingContext)
+        {
+            this.registerResponse = registerResponse ;
+        }
+
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault response.
+         * @param addressingContext The current addressing context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext)
+        {
+            this.soapFault = soapFault ;
+        }
+        
+        /**
+         * Get the create coordination context response.
+         * @return The create coordination context response.
+         */
+        RegisterResponseType getRegisterResponse()
+        {
+            return registerResponse ;
+        }
+        
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault or null.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging (from rev 19476, labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/messaging)

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorImpl.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/ActivationCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -21,6 +21,7 @@
 package com.arjuna.wsc.messaging;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.logging.WSCLogger;
 import com.arjuna.webservices.wsaddr.AddressingContext;
@@ -73,7 +74,7 @@
                 catch (final InvalidCreateParametersException invalidCreateParametersException)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME,
                         WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl_1")) ;
                     ActivationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
@@ -85,7 +86,7 @@
                         WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl_2", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     ActivationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
                 }
@@ -98,7 +99,7 @@
                     WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl_3", new Object[] {coordinationType}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME,
                     WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl_1")) ;
                 ActivationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
             }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorImpl.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/RegistrationCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -21,6 +21,7 @@
 package com.arjuna.wsc.messaging;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.logging.WSCLogger;
 import com.arjuna.webservices.wsaddr.AddressingContext;
@@ -82,7 +83,7 @@
                 catch (final AlreadyRegisteredException alreadyRegisteredException)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME,
                         WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_1")) ;
                     RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
@@ -90,7 +91,7 @@
                 catch (final InvalidProtocolException invalidProtocolException)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME,
                         WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_2")) ;
                     RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
@@ -98,7 +99,7 @@
                 catch (final InvalidStateException InvalidStateException)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME,
                         WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_3")) ;
                     RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
@@ -106,7 +107,7 @@
                 catch (final NoActivityException noActivityException)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME,
                         WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_4")) ;
                     RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
@@ -118,7 +119,7 @@
                         WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_5", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
                     return ;
                 }
@@ -131,7 +132,7 @@
                     WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_6", new Object[] {protocolIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME,
                     WSCLogger.log_mesg.getString("com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl_2")) ;
                 RegistrationRequesterClient.getClient().sendSoapFault(faultAddressingContext, soapFault) ;
             }

Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/deploy/CoordinationInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/wsc/messaging/deploy/CoordinationInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/messaging/deploy/CoordinationInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -27,6 +27,7 @@
 import com.arjuna.webservices.wscoor.processors.RegistrationCoordinatorProcessor;
 import com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl;
 import com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Initialise the coordination services.
@@ -40,8 +41,12 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        ActivationCoordinatorProcessor.setCoordinator(new ActivationCoordinatorProcessorImpl()) ;
-        RegistrationCoordinatorProcessor.setCoordinator(new RegistrationCoordinatorProcessorImpl()) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSC10) {
+           public void run() {
+               ActivationCoordinatorProcessor.setCoordinator(new ActivationCoordinatorProcessorImpl()) ;
+               RegistrationCoordinatorProcessor.setCoordinator(new RegistrationCoordinatorProcessorImpl()) ;
+           }
+        };
     }
 
     /**

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/ServiceRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,92 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11;
+
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * The registry of WS service providers for the WS-C and WS-T services.
+ * @author kevin
+ */
+public class ServiceRegistry
+{
+    /**
+     * The registry singleton.
+     */
+    private static final ServiceRegistry REGISTRY = new ServiceRegistry() ;
+
+    /**
+     * The SOAP service provider registry.
+     */
+    private final Map<String, String> serviceProviderRegistry = new TreeMap<String, String>() ;
+
+    /**
+     * Get the service registry.
+     * @return The service registry.
+     */
+    public static ServiceRegistry getRegistry()
+    {
+        return REGISTRY ;
+    }
+
+    /**
+     * Register the specified service.
+     * @param serviceName The service name.
+     * @param url The service url.
+     */
+    public void registerServiceProvider(final String serviceName, final String url)
+    {
+        synchronized(serviceProviderRegistry)
+        {
+            serviceProviderRegistry.put(serviceName, url) ;
+        }
+    }
+
+    /**
+     * Remove the specified service.
+     * @param serviceName The service name.
+     */
+    public void removeServiceProvider(final String serviceName)
+    {
+        synchronized(serviceProviderRegistry)
+        {
+            serviceProviderRegistry.remove(serviceName) ;
+        }
+    }
+
+    /**
+     * Get the service URI.
+     * @param serviceName The service name.
+     * @return The service URI or null if not registered.
+     */
+    public String getServiceURI(final String serviceName)
+    {
+        String uri;
+
+        synchronized(serviceProviderRegistry)
+        {
+            uri = serviceProviderRegistry.get(serviceName) ;
+        }
+
+        return uri;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/SoapFault11.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/SoapFault11.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/SoapFault11.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,181 @@
+package com.arjuna.webservices11;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.StringWriter;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Feb 1, 2008
+ * Time: 4:57:16 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class SoapFault11 extends SoapFault {
+    /**
+      * The detailElement element.
+      */
+     private Element detailElement;
+     /**
+      * The header elements.
+      */
+     private Element[] headerElements ;
+     /**
+      * Default constructor.
+      */
+     public SoapFault11()
+     {
+         super();
+     }
+
+     /**
+      * Construct a SOAP fault based on a throwable.
+      * @param th The throwable.
+      */
+     public SoapFault11(final Throwable th)
+     {
+         super(th);
+     }
+
+     /**
+      * Construct a SOAP header fault based on a throwable.
+      * @param th The throwable.
+      * @param headerElements The header elements.
+      */
+     public SoapFault11(final Throwable th, final Element[] headerElements)
+     {
+         super(th);
+         this.headerElements = headerElements;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param subcode The fault subcode.
+      * @param reason The fault reason.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType, final QName subcode, final String reason)
+     {
+         super(soapFaultType, subcode, reason) ;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param subcode The fault subcode.
+      * @param reason The fault reason.
+      * @param headerElements The header elements.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType, final QName subcode, final String reason, final Element[] headerElements)
+     {
+         super(soapFaultType, subcode, reason, null);
+         this.headerElements = headerElements ;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param subcode The fault subcode.
+      * @param reason The fault reason.
+      * @param detailElement The fault detailElement.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType, final QName subcode, final String reason, final Element detailElement)
+     {
+         super(soapFaultType, subcode, reason, getDetailString(detailElement)) ;
+         this.detailElement = detailElement;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param reason The fault reason.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType, final String reason)
+     {
+         this(soapFaultType, null, reason, null, null) ;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param reason The fault reason.
+      * @param detailElement The fault detailElement.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType,
+         final String reason, final Element detailElement)
+     {
+         this(soapFaultType, null, reason, detailElement, null) ;
+     }
+
+     /**
+      * Create a custom SOAP fault.
+      * @param soapFaultType the soap fault type.
+      * @param subcode The fault subcode.
+      * @param reason The fault reason.
+      * @param detailElement The fault detailElement.
+      * @param headerElements The fault header elements.
+      */
+     public SoapFault11(final SoapFaultType soapFaultType, final QName subcode,
+         final String reason, final Element detailElement, final Element[] headerElements)
+     {
+         this.soapFaultType = soapFaultType ;
+         this.subcode = subcode ;
+         this.reason = reason ;
+         this.detailElement = detailElement;
+         this.headerElements = headerElements ;
+     }
+
+     /**
+      * Get the SOAP fault detailElement.
+      * @return The SOAP fault detailElement.
+      */
+     public Element getDetailElement()
+     {
+         return detailElement;
+     }
+
+     /**
+      * Set the SOAP fault detailElement.
+      * @param detailElement The SOAP fault detailElement.
+      */
+     public void setDetailElement(final Element detailElement)
+     {
+         this.detailElement = detailElement;
+     }
+
+     /**
+      * Get the SOAP fault header elements.
+      * @return The SOAP fault header elements.
+      */
+     public Element[] getHeaderElements()
+     {
+         return headerElements ;
+     }
+
+     /**
+      * Set the SOAP fault header elements.
+      * @param headerElements The SOAP fault header elements.
+      */
+     public void setHeaderElements(final Element[] headerElements)
+     {
+         this.headerElements = headerElements ;
+     }
+
+     /**
+      * return a String representing the supplied detail element
+      * @param detailElement
+      * @return
+      */
+
+     private static String getDetailString(Element detailElement)
+     {
+         return detailElement.getTextContent();
+     }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/util/StreamHelper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/util/StreamHelper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/util/StreamHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,364 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.util;
+
+import java.text.MessageFormat;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices.util.QNameHelper;
+
+/**
+ * Helper class for Stream operations.
+ * @author kevin
+ *
+ * @message com.arjuna.webservices11.util.StreamHelper_1 [com.arjuna.webservices11.util.StreamHelper_1] - Unexpected end element: {0}
+ * @message com.arjuna.webservices11.util.StreamHelper_2 [com.arjuna.webservices11.util.StreamHelper_2] - Unexpected end of document reached
+ * @message com.arjuna.webservices11.util.StreamHelper_3 [com.arjuna.webservices11.util.StreamHelper_3] - Unexpected start element: {0}
+ */
+public class StreamHelper
+{
+    /**
+     * Pseudo namespace used to unbind a prefix.
+     */
+    private static final String UNBOUND_NAMESPACE = "http://www.arjuna.com/stax/parsing/unboundnamespace" ;
+
+    /**
+     * Write a start element with appropriate namespace declarations if necessary
+     * @param out The output stream.
+     * @param elementName The element name.
+     * @return The previous namespace if written, null otherwise.
+     * @throws javax.xml.stream.XMLStreamException for errors during writing.
+     */
+    public static String writeStartElement(final XMLStreamWriter out, final QName elementName)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(elementName.getNamespaceURI()) ;
+        final String localName = elementName.getLocalPart() ;
+
+        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
+
+        if (writeNamespace)
+        {
+            final String prefix = QNameHelper.getNormalisedValue(elementName.getPrefix()) ;
+            final String origNamespace = QNameHelper.getNormalisedValue(namespaceContext.getNamespaceURI(prefix)) ;
+            if (prefix.length() == 0)
+            {
+                out.setDefaultNamespace(namespaceURI) ;
+                out.writeStartElement(namespaceURI, localName) ;
+                out.writeDefaultNamespace(namespaceURI) ;
+            }
+            else
+            {
+                out.setPrefix(prefix, namespaceURI) ;
+                out.writeStartElement(namespaceURI, localName) ;
+                out.writeNamespace(prefix, namespaceURI) ;
+            }
+            return origNamespace ;
+        }
+        else
+        {
+            out.writeStartElement(namespaceURI, localName) ;
+            return null ;
+        }
+    }
+
+    /**
+     * Write an end element removing the namespace binding if necessary
+     * @param out The output stream.
+     * @param prefix The element prefix.
+     * @param namespaceURI The previous binding for the prefix.
+     * @throws javax.xml.stream.XMLStreamException for errors during writing.
+     */
+    public static void writeEndElement(final XMLStreamWriter out, final String prefix,
+        final String namespaceURI)
+        throws XMLStreamException
+    {
+        out.writeEndElement() ;
+        if (namespaceURI != null)
+        {
+            final String resetNamespace = (namespaceURI.length() == 0 ? UNBOUND_NAMESPACE : namespaceURI) ;
+
+            if (prefix.length() == 0)
+            {
+                out.setDefaultNamespace(resetNamespace) ;
+            }
+            else
+            {
+                out.setPrefix(prefix, resetNamespace) ;
+            }
+        }
+    }
+    /**
+     * Write the attributes to the stream.
+     * @param out The output stream.
+     * @param attributes The attributes.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttributes(final XMLStreamWriter out, final Map attributes)
+        throws XMLStreamException
+    {
+        final Set entrySet = attributes.entrySet() ;
+        final Iterator entryIter = entrySet.iterator() ;
+        while(entryIter.hasNext())
+        {
+            final Map.Entry entry = (Map.Entry)entryIter.next() ;
+            final QName name = (QName)entry.getKey() ;
+            final Object value = entry.getValue() ;
+            writeAttribute(out, name, value) ;
+        }
+    }
+
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final Object attributeValue)
+        throws XMLStreamException
+    {
+        if (attributeValue instanceof QName)
+        {
+            writeAttribute(out, attributeName, (QName)attributeValue) ;
+        }
+        else
+        {
+            writeAttribute(out, attributeName, attributeValue.toString()) ;
+        }
+    }
+
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value as a QName.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final QName attributeValue)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(attributeValue.getNamespaceURI()) ;
+        if (namespaceURI.length() == 0)
+        {
+            writeAttribute(out, attributeName, attributeValue.getLocalPart()) ;
+        }
+        else
+        {
+            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
+
+            if (origPrefix == null)
+            {
+                final String prefix = QNameHelper.getNormalisedValue(attributeValue.getPrefix()) ;
+                writeNamespace(out, prefix, namespaceURI) ;
+                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(attributeValue)) ;
+            }
+            else
+            {
+                // KEV must handle clashes with default namespace
+                writeAttribute(out, attributeName, QNameHelper.toQualifiedName(origPrefix, attributeValue.getLocalPart())) ;
+            }
+        }
+    }
+
+    /**
+     * Write the attribute to the stream.
+     * @param out The output stream.
+     * @param attributeName The attribute name.
+     * @param attributeValue The attribute value.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeAttribute(final XMLStreamWriter out, final QName attributeName,
+        final String attributeValue)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(attributeName.getNamespaceURI()) ;
+        final String localName = attributeName.getLocalPart() ;
+
+        if (namespaceURI.length() == 0)
+        {
+            out.writeAttribute(localName, attributeValue) ;
+        }
+        else
+        {
+            // KEV must handle clashes with default namespace
+            final String prefix = QNameHelper.getNormalisedValue(attributeName.getPrefix()) ;
+            writeNamespace(out, prefix, namespaceURI) ;
+            out.writeAttribute(namespaceURI, localName, attributeValue) ;
+        }
+    }
+
+    /**
+     * Write the QName to the stream as text.
+     * @param out The output stream.
+     * @param qName The qualified name.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeQualifiedName(final XMLStreamWriter out, final QName qName)
+        throws XMLStreamException
+    {
+        final String namespaceURI = QNameHelper.getNormalisedValue(qName.getNamespaceURI()) ;
+
+        if (namespaceURI.length() == 0)
+        {
+            out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
+        }
+        else
+        {
+            final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+            final String origPrefix = namespaceContext.getPrefix(namespaceURI) ;
+
+            if (origPrefix == null)
+            {
+                final String prefix = QNameHelper.getNormalisedValue(qName.getPrefix()) ;
+                writeNamespace(out, prefix, namespaceURI) ;
+                out.writeCharacters(QNameHelper.toQualifiedName(qName)) ;
+            }
+            else
+            {
+                // KEV must handle clashes with default namespace
+                out.writeCharacters(QNameHelper.toQualifiedName(origPrefix, qName.getLocalPart())) ;
+            }
+        }
+    }
+
+    /**
+     * Write the namespace if necessary.
+     * @param out The output stream.
+     * @param prefix The namespace prefix.
+     * @param namespaceURI The namespaceURI.
+     * @throws XMLStreamException Thrown for errors during writing.
+     */
+    public static void writeNamespace(final XMLStreamWriter out, final String prefix, final String namespaceURI)
+        throws XMLStreamException
+    {
+        final NamespaceContext namespaceContext = out.getNamespaceContext() ;
+
+        final boolean writeNamespace = (namespaceContext.getPrefix(namespaceURI) == null) ;
+        if (writeNamespace)
+        {
+            out.setPrefix(prefix, namespaceURI) ;
+            out.writeNamespace(prefix, namespaceURI) ;
+        }
+    }
+
+    /**
+     * Make sure the stream is at the start of the next element.
+     * @param streamReader The current stream reader.
+     * @throws XMLStreamException For parsing errors.
+     */
+    public static void skipToNextStartElement(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        if (streamReader.hasNext())
+        {
+            streamReader.nextTag() ;
+            if (streamReader.isEndElement())
+            {
+                final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_1") ;
+                final String message = MessageFormat.format(pattern, new Object[] {streamReader.getName()}) ;
+                throw new XMLStreamException(message) ;
+            }
+        }
+        else
+        {
+            throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
+        }
+    }
+
+    /**
+     * Make sure the stream is at the start of an element.
+     * @param streamReader The current stream reader.
+     * @throws XMLStreamException For parsing errors.
+     */
+    public static void skipToStartElement(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        while (!streamReader.isStartElement())
+        {
+            if (streamReader.hasNext())
+            {
+                streamReader.next() ;
+            }
+            else
+            {
+                throw new XMLStreamException(WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_2")) ;
+            }
+        }
+    }
+
+    /**
+     * Check the next start tag is as expected.
+     * @param streamReader The stream reader.
+     * @param expected The expected qualified name.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static void checkNextStartTag(final XMLStreamReader streamReader, final QName expected)
+        throws XMLStreamException
+    {
+        skipToNextStartElement(streamReader) ;
+        checkTag(streamReader, expected) ;
+    }
+
+    /**
+     * Compare the element tag with the expected qualified name.
+     * @param streamReader The current stream reader.
+     * @param expected The expected qualified name.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static void checkTag(final XMLStreamReader streamReader, final QName expected)
+        throws XMLStreamException
+    {
+        final QName elementName = streamReader.getName() ;
+        if (!expected.equals(elementName))
+        {
+            final String pattern = WSCLogger.log_mesg.getString("com.arjuna.webservices.util.StreamHelper_3") ;
+            final String message = MessageFormat.format(pattern, new Object[] {elementName}) ;
+            throw new XMLStreamException(message) ;
+        }
+    }
+
+    /**
+     * Check to see if the parent element is finished.
+     * @param streamReader The stream reader.
+     * @return true if it is finished, false otherwise.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public static boolean checkParentFinished(final XMLStreamReader streamReader)
+        throws XMLStreamException
+    {
+        return (streamReader.nextTag() == XMLStreamConstants.END_ELEMENT) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsaddr/AddressingHelper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsaddr/AddressingHelper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsaddr/AddressingHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,222 @@
+package com.arjuna.webservices11.wsaddr;
+
+import com.arjuna.wsc11.messaging.MessageId;
+
+import javax.xml.ws.addressing.*;
+import java.net.URISyntaxException;
+
+/**
+ * The complete addressing context.
+ * @author kevin
+ */
+public class AddressingHelper
+{
+    protected AddressingHelper()
+    {
+    }
+
+    public static AddressingProperties createOneWayResponseContext(final AddressingProperties addressingProperties, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties responseProperties = builder.newAddressingProperties();
+        responseProperties.initializeAsReply(addressingProperties, false) ;
+        responseProperties.setMessageID(makeURI(builder, messageID)) ;
+
+        return responseProperties ;
+    }
+
+    /**
+     * Create an addressing context that represents an inline reply to the specified addressing context.
+     * @param addressingProperties The addressing context being replied to.
+     * @param messageID The message id of the new message.
+     * @return The reply addressing context.
+     */
+    public static AddressingProperties createResponseContext(final AddressingProperties addressingProperties, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties responseProperties = builder.newAddressingProperties();
+        responseProperties.initializeAsReply(addressingProperties, false) ;
+        responseProperties.setMessageID(makeURI(builder, messageID)) ;
+
+        return responseProperties ;
+    }
+
+    /**
+     * Create an addressing context that represents a fault to the specified addressing context.
+     * @param addressingProperties The addressing context being replied to.
+     * @param messageID The message id of the new message.
+     * @return The fault addressing context.
+     *
+     * N.B. Still need to do From, Action, ReplyTo, FaultTo if needed.
+     */
+    public static AddressingProperties createFaultContext(final AddressingProperties addressingProperties, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties faultProperties = builder.newAddressingProperties();
+        faultProperties.initializeAsReply(addressingProperties, true) ;
+        faultProperties.setMessageID(makeURI(builder, messageID)) ;
+
+        return faultProperties ;
+    }
+
+    /**
+     * Create an addressing context that represents a request to the specified address.
+     * @param address TheendpointReference target address.
+     * @param messageID The message id of the new message.
+     * @return The addressing context.
+     *
+     * N.B. Still need to do From, Action, ReplyTo, FaultTo if needed.
+     */
+    public static AddressingProperties createRequestContext(final String address, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties requestProperties = builder.newAddressingProperties();
+        requestProperties.setTo(makeURI(builder, address));
+        if (messageID != null) {
+            requestProperties.setMessageID(makeURI(builder, messageID));
+        } else {
+            // client does not care about id but we have to set some id or WSA will complain
+
+            final String dummyID = MessageId.getMessageId();
+
+            requestProperties.setMessageID(makeURI(builder, dummyID));
+        }
+        return requestProperties;
+    }
+
+    /**
+     * Create an addressing context that represents a request to the specified address.
+     * @param address TheendpointReference target address.
+     * @param messageID The message id of the new message.
+     * @param action The action of the new message.
+     * @return The addressing context.
+     *
+     * N.B. Still need to do From, Action, ReplyTo, FaultTo if needed.
+     */
+    public static AddressingProperties createRequestContext(final String address, final String action, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties requestProperties = builder.newAddressingProperties();
+        requestProperties.setTo(makeURI(builder, address));
+        if (messageID != null) {
+            requestProperties.setMessageID(makeURI(builder, messageID));
+        } else {
+            // client does not care about id but we have to set some id or WSA will complain
+
+            final String dummyID = MessageId.getMessageId();
+
+            requestProperties.setMessageID(makeURI(builder, dummyID));
+        }
+        requestProperties.setAction(makeURI(builder, action));
+
+        return requestProperties;
+    }
+
+    /**
+     * Create an addressing context that represents a notification to the specified context.
+     * @param addressingProperties The addressing properties used to derive the notification addressing context.
+     * @param messageID The message id of the new message.
+     * @return The notification addressing context.
+     *
+     * N.B. Still need to do From, Action, ReplyTo, FaultTo if needed.
+     */
+    public static AddressingProperties createRequestContext(final AddressingProperties addressingProperties, final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties requestProperties = builder.newAddressingProperties();
+        requestProperties.initializeAsReply(addressingProperties, false) ;
+
+        if (messageID != null)
+        {
+            requestProperties.setMessageID (makeURI(builder, messageID));
+        }
+
+        return requestProperties;
+    }
+
+    /**
+     * Create an addressing context specifying only the message id for a notification.
+     * @param messageID The message id of the new message.
+     * @return The notification addressing context.
+     */
+    public static AddressingProperties createNotificationContext(final String messageID)
+    {
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        final AddressingProperties requestProperties = builder.newAddressingProperties();
+        requestProperties.setMessageID (makeURI(builder, messageID));
+        requestProperties.setAction(makeURI(builder, ""));
+
+        return requestProperties;
+    }
+
+
+    public static void installActionMessageID(AddressingProperties addressingProperties, final String action, final String messageID)
+    {
+        // requestProperties has been derived from an endpoint so To and ReferenceParameters will be set. we
+        // need to install the action and messageID
+
+        // create this each time so it uses the current thread classloader
+        // this allows the builder class to be redefined via a property
+        AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        addressingProperties.setMessageID(makeURI(builder, messageID));
+        addressingProperties.setAction(makeURI(builder, action));
+    }
+
+
+    public static void installCallerProperties(AddressingProperties addressingProperties, AddressingProperties requestProperties)
+    {
+        // requestProperties has been derived from an endpoint so To and ReferenceParameters will be set. we
+        // need to install alll the other fields supplied in addressingProperties
+
+        AttributedURI uri;
+        Relationship[] relatesTo;
+        EndpointReference epr;
+        uri = addressingProperties.getAction();
+        if (uri != null) {
+            requestProperties.setAction(uri);
+        }
+        uri = addressingProperties.getMessageID();
+        if (uri != null) {
+            requestProperties.setMessageID(uri);
+        }
+        epr = addressingProperties.getFrom();
+        if (epr != null) {
+            requestProperties.setFrom(epr);
+        }
+        epr = addressingProperties.getFaultTo();
+        if (epr != null) {
+            requestProperties.setFaultTo(epr);
+        }
+        epr = addressingProperties.getReplyTo();
+        if (epr != null) {
+            requestProperties.setReplyTo(epr);
+        }
+        relatesTo = addressingProperties.getRelatesTo();
+        if (relatesTo != null) {
+            requestProperties.setRelatesTo(relatesTo);
+        }
+    }
+    
+    public static javax.xml.ws.addressing.AttributedURI makeURI(AddressingBuilder builder, String messageID)
+    {
+        try {
+            return builder.newURI(messageID);
+        } catch (URISyntaxException use) {
+            return null;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/ArjunaContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/ArjunaContext.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/ArjunaContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,84 @@
+package com.arjuna.webservices11.wsarj;
+
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import javax.xml.ws.handler.MessageContext;
+
+/**
+ * The arjuna context.
+ * @author kevin
+ */
+public class ArjunaContext
+{
+    /**
+     * The key used for the arjuna context within a message exchange.
+     */
+    private static final String ARJUNAWS_CONTEXT_PROPERTY = "org.jboss.xts.ws.context";
+
+    /**
+     * The InstanceIdentifier header.
+     */
+    private InstanceIdentifier instanceIdentifier ;
+
+    /**
+     * Default constructor.
+     */
+    private ArjunaContext()
+    {
+    }
+
+    /**
+     * Get the instance identifier.
+     * @return The instance identifier.
+     */
+    public InstanceIdentifier getInstanceIdentifier()
+    {
+        return instanceIdentifier ;
+    }
+
+    /**
+     * Set the instance identifier.
+     * @param instanceIdentifier The instance identifier.
+     */
+    public void setInstanceIdentifier(final InstanceIdentifier instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+
+    /**
+     * Is the configuration of this element valid?
+     * @return true if valid, false otherwise.
+     */
+    public boolean isValid()
+    {
+        return ((instanceIdentifier != null) && instanceIdentifier.isValid()) ;
+    }
+
+    /**
+     * Get the arjuna context from the message context if present.
+     * @param messageContext The message context.
+     * @return The arjuna context or null if not present.
+     */
+    public static ArjunaContext getCurrentContext(final MessageContext messageContext)
+    {
+        return (ArjunaContext)messageContext.get(ARJUNAWS_CONTEXT_PROPERTY) ;
+    }
+
+    /**
+     * Get the arjuna context from the message context.
+     * @param messageContext The message context.
+     * @return The arjuna context.
+     */
+    public static ArjunaContext getContext(final MessageContext messageContext)
+    {
+        final ArjunaContext current = (ArjunaContext)messageContext.get(ARJUNAWS_CONTEXT_PROPERTY) ;
+        if (current != null)
+        {
+            return current ;
+        }
+        final ArjunaContext newContext = new ArjunaContext() ;
+        messageContext.put(ARJUNAWS_CONTEXT_PROPERTY, newContext) ;
+        messageContext.setScope(ARJUNAWS_CONTEXT_PROPERTY, MessageContext.Scope.APPLICATION);
+        return newContext ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/InstanceIdentifier.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/InstanceIdentifier.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/InstanceIdentifier.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,152 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarj;
+
+import org.w3c.dom.Element;
+
+import javax.xml.soap.Name;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+import com.arjuna.webservices.wsarj.ArjunaConstants;
+
+/**
+ * Representation of an InstanceIdentifier element.
+ * @author kevin
+ */
+public class InstanceIdentifier
+{
+    /**
+     * The instance identifier.
+     */
+    private String instanceIdentifier ;
+
+    /**
+      * Default constructor.
+      */
+     public InstanceIdentifier()
+     {
+     }
+
+    /**
+     * Construct an instance identifier with the specific identifier
+     * @param instanceIdentifier The instance identifier.
+     */
+
+    public InstanceIdentifier(final String instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+
+    /**
+     * Set the instance identifier of this element.
+     * @param instanceIdentifier The instance identifier of the element.
+     */
+    public void setInstanceIdentifier(final String instanceIdentifier)
+    {
+        this.instanceIdentifier = instanceIdentifier ;
+    }
+
+    /**
+     * Get the instance identifier of this element.
+     * @return The instance identifier of the element or null if not set.
+     */
+    public String getInstanceIdentifier()
+    {
+        return instanceIdentifier ;
+    }
+
+    /**
+     * Is the configuration of this element valid?
+     * @return true if valid, false otherwise.
+     */
+    public boolean isValid()
+    {
+        return (instanceIdentifier != null) && (instanceIdentifier.trim().length() > 0);
+    }
+
+    /**
+     * Get a string representation of this instance identifier.
+     * @return the string representation.
+     */
+    public String toString()
+    {
+        return (instanceIdentifier != null ? instanceIdentifier : "") ;
+    }
+
+     /**
+     * Set the identifier on an endpoint reference under construction.
+     * @param builder The endpoint reference builder.
+     * @param identifier The identifier.
+     */
+    public static void setEndpointInstanceIdentifier(final W3CEndpointReferenceBuilder builder, final String identifier)
+    {
+        builder.referenceParameter(createInstanceIdentifierElement(identifier));
+    }
+    
+    /**
+     * Set the identifier on an endpoint reference under construction.
+     * @param builder The endpoint reference builder.
+     * @param instanceIdentifier The identifier.
+     */
+    public static void setEndpointInstanceIdentifier(final W3CEndpointReferenceBuilder builder, final InstanceIdentifier instanceIdentifier)
+    {
+        builder.referenceParameter(createInstanceIdentifierElement(instanceIdentifier.getInstanceIdentifier())) ;
+    }
+
+    /**
+     * a soap factory used to construct SOAPElement instances representing InstanceIdentifier instances
+     */
+    private static SOAPFactory factory;
+
+    /**
+     * a name for the WSArj Instance element
+     */
+    private static Name WSARJ_ELEMENT_INSTANCE_NAME;
+
+    /**
+     * Create a SOAPElement representing an InstanceIdentifier
+     * @param instanceIdentifier the identifier string of the InstanceIdentifier being represented
+     * @return a SOAPElement with the InstancreIdentifier QName as its element tag and a text node containing the
+     * suppliedidentifier string as its value
+     */
+
+    private static Element createInstanceIdentifierElement(final String instanceIdentifier)
+    {
+        try {
+            if (factory == null) {
+                factory = SOAPFactory.newInstance();
+                Name name = factory.createName(ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER,
+                        ArjunaConstants.WSARJ_PREFIX,
+                        ArjunaConstants.WSARJ_NAMESPACE);
+                WSARJ_ELEMENT_INSTANCE_NAME = name;
+            }
+            SOAPElement element = factory.createElement(WSARJ_ELEMENT_INSTANCE_NAME);
+            element.addTextNode(instanceIdentifier);
+            return element;
+        } catch (SOAPException se) {
+            // TODO log error here (should never happen)
+            return null;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierHandler.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,172 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarj.handler;
+
+import com.arjuna.webservices.wsarj.ArjunaConstants;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * Header handler for parsing the Arjuna WS instance identifier header.
+ * @author adinn
+ */
+public class InstanceIdentifierHandler implements SOAPHandler<SOAPMessageContext>
+{
+    /**
+     * Gets the header blocks that can be processed by this Handler
+     * instance.
+     *
+     * @return Set of QNames of header blocks processed by this
+     *         handler instance. <code>QName</code> is the qualified
+     *         name of the outermost element of the Header block.
+     */
+    public Set<QName> getHeaders()
+    {
+        return headers;
+    }
+
+    /**
+     * Handle an outgoing message by inserting any current arjuna context attached to the context into the message
+     * headers and handle an incoming message by retrieving the context from the headers and attaching it to the
+     * context,
+     *
+     * @param context the message context.
+     * @return Always return true
+     * @throws RuntimeException               Causes the JAX-WS runtime to cease
+     *                                        handler processing and generate a fault.
+     * @throws javax.xml.ws.ProtocolException Causes the JAX-WS runtime to switch to
+     *                                        fault message processing.
+     */
+    public boolean handleMessage(SOAPMessageContext context) throws ProtocolException
+    {
+        final boolean outbound = (Boolean)context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+        if (outbound) {
+            return handleMessageOutbound(context);
+        } else {
+            return handlemessageInbound(context);
+        }
+    }
+
+    /**
+     * check for an arjuna context attached to the message context and, if found, install its identifier as the value
+     * of a soap message header element
+     * @param context
+     * @return
+     * @throws ProtocolException
+     */
+    protected boolean handleMessageOutbound(SOAPMessageContext context) throws ProtocolException
+    {
+        try {
+            ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(context);
+            if (arjunaContext != null) {
+                InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
+                // insert a header into the current message containing the instance identifier as a text element
+                final SOAPMessage soapMessage = context.getMessage();
+                final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+                SOAPHeader soapHeader = soapEnvelope.getHeader() ;
+                if (soapHeader == null)
+                {
+                    soapHeader = soapEnvelope.addHeader() ;
+                }
+                final SOAPHeaderElement headerElement = soapHeader.addHeaderElement(ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME);
+                headerElement.setValue(instanceIdentifier.getInstanceIdentifier());
+                headerElement.setMustUnderstand(true);
+            }
+        } catch (Exception se) {
+            throw new ProtocolException(se);
+        }
+
+        return true;
+    }
+
+    /**
+     * check for an arjuna instance identifier element embedded in the soap message headesr and, if found, use it to
+     * label an arjuna context attached to the message context
+     * @param context
+     * @return
+     * @throws ProtocolException
+     */
+    private boolean handlemessageInbound(SOAPMessageContext context)  throws ProtocolException
+    {
+        try {
+            final SOAPMessage soapMessage = context.getMessage();
+            final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
+            Iterator<SOAPHeaderElement> iterator = soapEnvelope.getHeader().examineAllHeaderElements();
+            while (iterator.hasNext()) {
+                final SOAPHeaderElement headerElement = iterator.next();
+                if (ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME.equals(headerElement.getElementQName())) {
+                    // found it - clear the must understand flag, retrieve the value and store an arjuna
+                    // context in the message context
+                    headerElement.setMustUnderstand(false);
+                    String identifierString = headerElement.getValue();
+                    if (identifierString != null) {
+                        ArjunaContext arjunaContext = ArjunaContext.getContext(context);
+                        arjunaContext.setInstanceIdentifier(new InstanceIdentifier(identifierString));
+                        break;
+                    }
+                }
+            }
+        } catch (Exception se) {
+            throw new ProtocolException(se);
+        }
+
+        return true;
+    }
+
+    /**
+     * this handler ignores faults but allows other handlers to deal with them
+     *
+     * @param context the message context
+     * @return true to allow fault handling to continue
+     */
+
+    public boolean handleFault(SOAPMessageContext context)
+    {
+        return true;
+    }
+
+    /**
+     * this hanlder ignores close messages
+     *
+     * @param context the message context
+     */
+    public void close(javax.xml.ws.handler.MessageContext context)
+    {
+    }
+
+    /**
+     * a singleton set containing the only header this handler is interested in
+     */
+    private static Set<QName> headers = Collections.singleton(ArjunaConstants.WSARJ_ELEMENT_INSTANCE_IDENTIFIER_QNAME);
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierInHandler.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierInHandler.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/handler/InstanceIdentifierInHandler.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,25 @@
+package com.arjuna.webservices11.wsarj.handler;
+
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import javax.xml.ws.ProtocolException;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Feb 27, 2008
+ * Time: 6:16:07 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class InstanceIdentifierInHandler extends InstanceIdentifierHandler {
+    /**
+     * override the parent behaviour so that this handler processes incoming arjuna instance identifiers
+     * but avoids inserting them into outgoing messages
+     *
+     * @param context
+     * @return
+     * @throws javax.xml.ws.ProtocolException
+     */
+    protected boolean handleMessageOutbound(SOAPMessageContext context) throws ProtocolException {
+        return true;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/processor/BaseNotificationProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/processor/BaseNotificationProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wsarj/processor/BaseNotificationProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,33 @@
+package com.arjuna.webservices11.wsarj.processor;
+
+import com.arjuna.webservices.base.processors.BaseProcessor;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * Utility class handling common response functionality.
+ * @author kevin
+ */
+public abstract class BaseNotificationProcessor extends BaseProcessor
+{
+    /**
+     * Get the callback ids.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     * @return The callback ids.
+     */
+    protected String[] getIDs(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        if (arjunaContext != null)
+        {
+            final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+            if (instanceIdentifier != null)
+            {
+                return new String[] {instanceIdentifier.getInstanceIdentifier()} ;
+            }
+        }
+        return null ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/CoordinationConstants.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/CoordinationConstants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/CoordinationConstants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,247 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.  All rights reserved. 
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-Coordination constants.
+ */
+public interface CoordinationConstants
+{
+    /**
+     * The Namespace.
+     */
+    public String WSCOOR_NAMESPACE = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06" ;
+    /**
+     * The namespace prefix.
+     */
+    public String WSCOOR_PREFIX = "wscoor" ;
+
+    public String REGISTRATION_SERVICE_NAME = "RegistrationService";
+
+    public String ACTIVATION_SERVICE_NAME = "ActivationService";
+
+    public String ACTIVATION_ENDPOINT_NAME = "ActivationPortType";
+
+    public String REGISTRATION_ENDPOINT_NAME = "RegistrationPortType";
+
+    public QName REGISTRATION_SERVICE_QNAME = new QName(WSCOOR_NAMESPACE, REGISTRATION_SERVICE_NAME, WSCOOR_PREFIX) ;;
+
+    public QName ACTIVATION_SERVICE_QNAME = new QName(WSCOOR_NAMESPACE, ACTIVATION_SERVICE_NAME, WSCOOR_PREFIX) ;;
+
+    public QName ACTIVATION_ENDPOINT_QNAME = new QName(WSCOOR_NAMESPACE, ACTIVATION_ENDPOINT_NAME, WSCOOR_PREFIX) ;;
+
+    public QName REGISTRATION_ENDPOINT_QNAME = new QName(WSCOOR_NAMESPACE, REGISTRATION_ENDPOINT_NAME, WSCOOR_PREFIX) ;;
+    /**
+     * The Expires element.
+     */
+    public String WSCOOR_ELEMENT_EXPIRES = "Expires" ;
+    /**
+     * The Expires QName.
+     */
+    public QName WSCOOR_ELEMENT_EXPIRES_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_EXPIRES, WSCOOR_PREFIX) ;
+    
+    /**
+     * The Identifier element.
+     */
+    public String WSCOOR_ELEMENT_IDENTIFIER = "Identifier" ;
+    /**
+     * The Identifier QName.
+     */
+    public QName WSCOOR_ELEMENT_IDENTIFIER_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_IDENTIFIER, WSCOOR_PREFIX) ;
+    
+    /**
+     * The RegistrationService element.
+     */
+    public String WSCOOR_ELEMENT_REGISTRATION_SERVICE = "RegistrationService" ;
+    /**
+     * The RegistrationService QName.
+     */
+    public QName WSCOOR_ELEMENT_REGISTRATION_SERVICE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_REGISTRATION_SERVICE, WSCOOR_PREFIX) ;
+    
+    /**
+     * The CoordinationContext element.
+     */
+    public String WSCOOR_ELEMENT_COORDINATION_CONTEXT = "CoordinationContext" ;
+    /**
+     * The CoordinationContext QName.
+     */
+    public QName WSCOOR_ELEMENT_COORDINATION_CONTEXT_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_COORDINATION_CONTEXT, WSCOOR_PREFIX) ;
+    
+    /**
+     * The CurrentContext element.
+     */
+    public String WSCOOR_ELEMENT_CURRENT_CONTEXT = "CurrentContext" ;
+    /**
+     * The CurrentContext QName.
+     */
+    public QName WSCOOR_ELEMENT_CURRENT_CONTEXT_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_CURRENT_CONTEXT, WSCOOR_PREFIX) ;
+    
+    /**
+     * The CoordinationType element.
+     */
+    public String WSCOOR_ELEMENT_COORDINATION_TYPE = "CoordinationType" ;
+    /**
+     * The CoordinationType QName.
+     */
+    public QName WSCOOR_ELEMENT_COORDINATION_TYPE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_COORDINATION_TYPE, WSCOOR_PREFIX) ;
+    
+    /**
+     * The CreateCoordinationContext element.
+     */
+    public String WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT = "CreateCoordinationContext" ;
+    /**
+     * The CreateCoordinationContext QName.
+     */
+    public QName WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT, WSCOOR_PREFIX) ;
+    /**
+     * The CreateCoordinationContext Action.
+     */
+    public String WSCOOR_ACTION_CREATE_COORDINATION_CONTEXT = WSCOOR_NAMESPACE + "/" + WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT ;
+    
+    /**
+     * The CreateCoordinationContextResponse element.
+     */
+    public String WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT_RESPONSE = "CreateCoordinationContextResponse" ;
+    /**
+     * The CreateCoordinationContextResponse QName.
+     */
+    public QName WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT_RESPONSE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT_RESPONSE, WSCOOR_PREFIX) ;
+    /**
+     * The CreateCoordinationContextResponse Action.
+     */
+    public String WSCOOR_ACTION_CREATE_COORDINATION_CONTEXT_RESPONSE = WSCOOR_NAMESPACE + "/" + WSCOOR_ELEMENT_CREATE_COORDINATION_CONTEXT_RESPONSE ;
+
+    /**
+     * The ProtocolIdentifier element.
+     */
+    public String WSCOOR_ELEMENT_PROTOCOL_IDENTIFIER = "ProtocolIdentifier" ;
+    /**
+     * The ProtocolIdentifier QName.
+     */
+    public QName WSCOOR_ELEMENT_PROTOCOL_IDENTIFIER_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_PROTOCOL_IDENTIFIER, WSCOOR_PREFIX) ;
+    
+    /**
+     * The ParticipantProtocolService element.
+     */
+    public String WSCOOR_ELEMENT_PARTICIPANT_PROTOCOL_SERVICE = "ParticipantProtocolService" ;
+    /**
+     * The ParticipantProtocolService QName.
+     */
+    public QName WSCOOR_ELEMENT_PARTICIPANT_PROTOCOL_SERVICE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_PARTICIPANT_PROTOCOL_SERVICE, WSCOOR_PREFIX) ;
+    
+    /**
+     * The Register element.
+     */
+    public String WSCOOR_ELEMENT_REGISTER = "Register" ;
+    /**
+     * The Register QName.
+     */
+    public QName WSCOOR_ELEMENT_REGISTER_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_REGISTER, WSCOOR_PREFIX) ;
+    /**
+     * The Register Action.
+     */
+    public String WSCOOR_ACTION_REGISTER = WSCOOR_NAMESPACE + "/" + WSCOOR_ELEMENT_REGISTER ;
+    
+    /**
+     * The CoordinatorProtocolService element.
+     */
+    public String WSCOOR_ELEMENT_COORDINATOR_PROTOCOL_SERVICE = "CoordinatorProtocolService" ;
+    /**
+     * The CoordinatorProtocolService QName.
+     */
+    public QName WSCOOR_ELEMENT_COORDINATOR_PROTOCOL_SERVICE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_COORDINATOR_PROTOCOL_SERVICE, WSCOOR_PREFIX) ;
+    
+    /**
+     * The RegisterResponse element.
+     */
+    public String WSCOOR_ELEMENT_REGISTER_RESPONSE = "RegisterResponse" ;
+    /**
+     * The RegisterResponse QName.
+     */
+    public QName WSCOOR_ELEMENT_REGISTER_RESPONSE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ELEMENT_REGISTER_RESPONSE, WSCOOR_PREFIX) ;
+    /**
+     * The Register Action.
+     */
+    public String WSCOOR_ACTION_REGISTER_RESPONSE = WSCOOR_NAMESPACE + "/" + WSCOOR_ELEMENT_REGISTER_RESPONSE ;
+    
+    /**
+     * The Fault Action.
+     */
+    public String WSCOOR_ACTION_FAULT = WSCOOR_NAMESPACE + "/fault" ;
+    /**
+     * The AlreadyRegistered error code.
+     */
+    public String WSCOOR_ERROR_CODE_ALREADY_REGISTERED = "AlreadyRegistered" ;
+    /**
+     * The AlreadyRegistered error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_ALREADY_REGISTERED, WSCOOR_PREFIX) ;
+    /**
+     * The ContextRefused error code.
+     */
+    public String WSCOOR_ERROR_CODE_CONTEXT_REFUSED = "ContextRefused" ;
+    /**
+     * The ContextRefused error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_CONTEXT_REFUSED_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_CONTEXT_REFUSED, WSCOOR_PREFIX) ;
+    /**
+     * The InvalidParameters error code.
+     */
+    public String WSCOOR_ERROR_CODE_INVALID_PARAMETERS = "InvalidParameters" ;
+    /**
+     * The InvalidParameters error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_INVALID_PARAMETERS, WSCOOR_PREFIX) ;
+    /**
+     * The InvalidProtocol error code.
+     */
+    public String WSCOOR_ERROR_CODE_INVALID_PROTOCOL = "InvalidProtocol" ;
+    /**
+     * The InvalidProtocol error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_INVALID_PROTOCOL, WSCOOR_PREFIX) ;
+    /**
+     * The InvalidState error code.
+     */
+    public String WSCOOR_ERROR_CODE_INVALID_STATE = "InvalidState" ;
+    /**
+     * The InvalidState error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_INVALID_STATE_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_INVALID_STATE, WSCOOR_PREFIX) ;
+    /**
+     * The NoActivity error code.
+     */
+    public String WSCOOR_ERROR_CODE_NO_ACTIVITY = "NoActivity" ;
+    /**
+     * The NoActivity error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_NO_ACTIVITY, WSCOOR_PREFIX) ;
+    /**
+     * The unexpected exception error code.
+     */
+    public String WSCOOR_ERROR_CODE_EXCEPTION = "Exception" ;
+    /**
+     * The NoActivity error code QName.
+     */
+    public QName WSCOOR_ERROR_CODE_EXCEPTION_QNAME = new QName(WSCOOR_NAMESPACE, WSCOOR_ERROR_CODE_EXCEPTION, WSCOOR_PREFIX) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/ActivationCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/ActivationCoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/ActivationCoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.  All rights reserved. 
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor.client;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.client.WSCOORClient;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.*;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import java.io.IOException;
+
+/**
+ * The Client side of the Activation Coordinator.
+ * @author kevin
+ */
+public class ActivationCoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final ActivationCoordinatorClient CLIENT = new ActivationCoordinatorClient() ;
+
+    /**
+     * Construct the activation coordinator client.
+     */
+    private ActivationCoordinatorClient()
+    {
+    }
+    
+    /**
+     * Send a create coordination request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param coordinationType The type of the coordination.
+     * @param expires The expiry interval of the context.
+     * @param currentContext The current coordination context.
+     * @throws SoapFault For any errors.
+     * @throws IOException for any transport errors.
+     */
+    public CreateCoordinationContextResponseType
+    sendCreateCoordination(final AddressingProperties addressingProperties,
+        final String coordinationType, final Expires expires, final CoordinationContext currentContext)
+        throws SoapFault, IOException
+    {
+        final CreateCoordinationContextType request = new CreateCoordinationContextType() ;
+        request.setCoordinationType(coordinationType) ;
+        request.setExpires(expires) ;
+        if (currentContext != null) {
+            // structurally a CreateCoordinationContextType.CurrentContext and a CoordinationContext are the same i.e.
+            // they are a CoordinationContextType extended with an Any list. but the schema does not use one to define
+            // the other so, until we can generate them as the same type we have to interconvert here (and elsewhere)
+
+            CreateCoordinationContextType.CurrentContext current = new CreateCoordinationContextType.CurrentContext();
+            current.setCoordinationType(currentContext.getCoordinationType());
+            current.setExpires(currentContext.getExpires());
+            current.setIdentifier(currentContext.getIdentifier());
+            current.setRegistrationService(currentContext.getRegistrationService());
+            current.getAny().addAll(currentContext.getAny());
+            request.setCurrentContext(current);
+        } else {
+            request.setCurrentContext(null) ;
+        }
+
+        // get proxy with required message id and end point address
+        ActivationPortType port = WSCOORClient.getActivationPort(addressingProperties, CoordinationConstants.WSCOOR_ACTION_CREATE_COORDINATION_CONTEXT);
+
+        // invoke remote method
+        return port.createCoordinationContextOperation(request);
+    }
+
+    /**
+     * Get the Activation Coordinator client singleton.
+     * @return The Activation Coordinator client singleton.
+     */
+    public static ActivationCoordinatorClient getClient()
+    {
+        return CLIENT ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/WSCOORClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/WSCOORClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/client/WSCOORClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,141 @@
+package com.arjuna.webservices11.wscoor.client;
+
+import com.arjuna.webservices11.wsarj.handler.InstanceIdentifierHandler;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationPortType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationService;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationService;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSCOORClient
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread activation service instance
+     */
+    private static ThreadLocal<ActivationService> activationService = new ThreadLocal<ActivationService>();
+
+    /**
+     *  thread local which maintains a per thread activation service instance
+     */
+    private static ThreadLocal<RegistrationService> registrationService = new ThreadLocal<RegistrationService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a coordinator activation service unique to the current thread
+     * @return
+     */
+    private static synchronized ActivationService getActivationService()
+    {
+        if (activationService.get() == null) {
+            activationService.set(new ActivationService());
+        }
+        return activationService.get();
+    }
+
+    /**
+     * fetch a coordinator registration service unique to the current thread
+     * @return
+     */
+    private static synchronized RegistrationService getRegistrationService()
+    {
+        if (registrationService.get() == null) {
+            registrationService.set(new RegistrationService());
+        }
+        return registrationService.get();
+    }
+
+    public static ActivationPortType getActivationPort(AddressingProperties addressingProperties,
+                                                       String action)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        ActivationService service = getActivationService();
+        // ActivationPortType port = service.getPort(ActivationPortType.class, new AddressingFeature(true, true));
+        ActivationPortType port = service.getPort(ActivationPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        AttributedURI toUri = addressingProperties.getTo();
+        /*
+         * we have to add the JaxWS WSAddressingClientHandler because we cannot specify the WSAddressing feature
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, toUri.getURI().toString());
+        try {
+            addressingProperties.setAction(builder.newURI(action));
+        } catch (URISyntaxException use) {
+            // TODO log this error
+        }
+
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static RegistrationPortType getRegistrationPort(W3CEndpointReference endpointReference, String action, String messageID)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        RegistrationService service = getRegistrationService();
+        // RegistrationPortType port = service.getPort(endpointReference, RegistrationPortType.class, new AddressingFeature(true, true));
+        RegistrationPortType port = service.getPort(endpointReference, RegistrationPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // but we still need to set the action and message id -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        // String address = (String)requestContext.get(BindingProvider.ENDPOINT_ADDRESS_PROPERTY);
+        // AddressingProperties addressingProperties = AddressingHelper.createRequestContext(address, action, messageID);
+        // requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    // requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+        AddressingProperties addressingProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        AddressingHelper.installActionMessageID(addressingProperties, action, messageID);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, addressingProperties.getTo().getURI().toString());
+        return port;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/ActivationCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,69 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor.processors;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextResponseType;
+
+/**
+ * The Activation Coordinator processor.
+ * @author kevin
+ */
+public abstract class ActivationCoordinatorProcessor
+{
+    /**
+     * The coordinator.
+     */
+    private static ActivationCoordinatorProcessor COORDINATOR  ;
+    
+    /**
+     * Get the coordinator.
+     * @return The coordinator.
+     */
+    public static ActivationCoordinatorProcessor getCoordinator()
+    {
+        return COORDINATOR ;
+    }
+    
+    /**
+     * Set the coordinator.
+     * @param coordinator The coordinator.
+     * @return The previous coordinator.
+     */
+    public static ActivationCoordinatorProcessor setCoordinator(final ActivationCoordinatorProcessor coordinator)
+    {
+        final ActivationCoordinatorProcessor origCoordinator = COORDINATOR ;
+        COORDINATOR = coordinator ;
+        return origCoordinator ;
+    }
+    
+    /**
+     * Create the coordination context.
+     * @param createCoordinationContext The create coordination context request.
+     * @param addressingContext The addressing context.
+     * @return a response message containing the desired coordinaton context
+     */
+    public abstract CreateCoordinationContextResponseType
+        createCoordinationContext(final CreateCoordinationContextType createCoordinationContext,
+                                  final AddressingProperties addressingProperties) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/processors/RegistrationCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,71 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor.processors;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Registration Coordinator processor.
+ * @author kevin
+ */
+public abstract class RegistrationCoordinatorProcessor
+{
+    /**
+     * The coordinator.
+     */
+    private static RegistrationCoordinatorProcessor COORDINATOR ;
+    
+    /**
+     * Get the coordinator.
+     * @return The coordinator.
+     */
+    public static RegistrationCoordinatorProcessor getCoordinator()
+    {
+        return COORDINATOR ;
+    }
+    
+    /**
+     * Set the coordinator.
+     * @param coordinator The coordinator.
+     * @return The orig coordinator.
+     */
+    public static RegistrationCoordinatorProcessor setCoordinator(final RegistrationCoordinatorProcessorImpl coordinator)
+    {
+        final RegistrationCoordinatorProcessor origCoordinator = COORDINATOR ;
+        COORDINATOR = coordinator ;
+        return origCoordinator ;
+    }
+
+    /**
+     * Register the participant in the protocol.
+     * @param register The register request.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract RegisterResponseType register(final RegisterType register, final AddressingProperties addressingContext,
+        final ArjunaContext arjunaContext) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/ActivationPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,50 @@
+package com.arjuna.webservices11.wscoor.sei;
+
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.processors.ActivationCoordinatorProcessor;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationPortType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextResponseType;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Sep 27, 2007
+ * Time: 10:31:43 AM
+ * To change this template use File | Settings | File Templates.
+ */
+ at WebService(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "ActivationPortType",
+        wsdlLocation = "/WEB-INF/wsdl/wscoor-activation-binding.wsdl",
+        serviceName = "ActivationService",
+        portName = "ActivationPortType"
+        // endpointInterface = "org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationPortType",
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+// @EndpointConfig(configName = "Standard WSAddressing Endpoint")
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class ActivationPortTypeImpl implements ActivationPortType
+{
+    @Resource private WebServiceContext webServiceCtx;
+
+    @WebMethod(operationName = "CreateCoordinationContextOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext")
+    @WebResult(name = "CreateCoordinationContextResponse", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+    public CreateCoordinationContextResponseType createCoordinationContextOperation(
+        @WebParam(name = "CreateCoordinationContext", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+        CreateCoordinationContextType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        return ActivationCoordinatorProcessor.getCoordinator().createCoordinationContext(parameters, inboundAddressProperties);
+   }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/sei/RegistrationPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,56 @@
+package com.arjuna.webservices11.wscoor.sei;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType;
+
+// import org.jboss.ws.annotation.EndpointConfig;
+
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.annotation.Resource;
+
+import com.arjuna.webservices11.wscoor.processors.RegistrationCoordinatorProcessor;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Sep 27, 2007
+ * Time: 1:33:06 PM
+ * To change this template use File | Settings | File Templates.
+ */
+
+ at WebService(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "RegistrationPortType",
+        wsdlLocation = "/WEB-INF/wsdl/wscoor-registration-binding.wsdl",
+        serviceName = "RegistrationService",
+        portName = "RegistrationPortType"
+        // endpointInterface = "org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType",
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+// @EndpointConfig(configName = "Standard WSAddressing Endpoint")
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class RegistrationPortTypeImpl implements RegistrationPortType
+{
+    @Resource private WebServiceContext webServiceCtx;
+
+    @WebResult(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters", name = "RegisterResponse")
+    @WebMethod(operationName = "RegisterOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register")
+    public org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType registerOperation(
+        @WebParam(targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters", name = "Register")
+        org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType parameters
+    )
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx) ;
+
+        return RegistrationCoordinatorProcessor.getCoordinator().register(parameters, inboundAddressProperties, arjunaContext);
+
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/ActivationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.  All rights reserved. 
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor.server;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Activate the Activation Coordinator service
+ * @author kevin
+ */
+public class ActivationCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/ActivationService";
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
+           public void run() {
+               // TODO if we rely upon JaxWS to automatically publish implementation classes it will only
+               // do so under a URL based on service name. which means we cannot define a service using
+               // multiple port bindings because thsi causes a namespace clash
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/webservices11/wscoor/server/RegistrationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag.  All rights reserved. 
+ * 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wscoor.server;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Activate the Registration Coordinator service
+ * @author kevin
+ */
+public class RegistrationCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/RegistrationService";
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
+           public void run() {
+               // TODO work out how to configure the endpoint name here
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ActivationCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ActivationCoordinator.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ActivationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,93 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc11;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.client.ActivationCoordinatorClient;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextResponseType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.soap.SOAPFaultException;
+import java.io.IOException;
+
+/**
+ * Wrapper around low level Activation Coordinator messaging.
+ * @author kevin
+ */
+public class ActivationCoordinator
+{
+    /**
+     * Create the coordination context.
+     * @param activationCoordinatorURI The URI of the activation coordinator.
+     * @param messageID The messageID to use.
+     * @param coordinationTypeURI The coordination type.
+     * @param expires The expiry time or null.
+     * @param currentContext The currnt context or null.
+     * @return The coordination context.
+     * @throws com.arjuna.wsc.InvalidCreateParametersException if the create parameters are invalid.
+     * @throws SoapFault for errors during processing.
+     */
+    public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI,
+        final String messageID, final String coordinationTypeURI, final Long expires,
+        final CoordinationContext currentContext)
+        throws InvalidCreateParametersException, SoapFault
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID) ;
+        
+        final Expires expiresValue;
+        if (expires == null) {
+            expiresValue = null;
+        } else {
+            expiresValue = new Expires();
+            expiresValue.setValue(expires.longValue());
+        }
+
+        try
+        {
+            CreateCoordinationContextResponseType response;
+            ActivationCoordinatorClient client = ActivationCoordinatorClient.getClient();
+            response = client.sendCreateCoordination(addressingProperties, coordinationTypeURI, expiresValue, currentContext) ;
+            return response.getCoordinationContext();
+        }
+        catch (final IOException ioe)
+        {
+            throw new SoapFault11(ioe) ;
+        } catch (SOAPFaultException sfe) {
+            // TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
+            final SOAPFault soapFault = sfe.getFault() ;
+            final QName subcode = soapFault.getFaultCodeAsQName() ;
+            if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(subcode))
+            {
+                throw new InvalidCreateParametersException(soapFault.getFaultString());
+            }
+            throw new SoapFault11(sfe);
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,71 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * ContextFactory.java
+ */
+
+package com.arjuna.wsc11;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import com.arjuna.wsc.InvalidCreateParametersException;
+
+public interface ContextFactory
+{
+    /**
+     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
+     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
+     * protocol identifiers.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+	
+    public void install(final String coordinationTypeURI);
+
+    /**
+     * Creates a coordination context.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     * @param expires the expire date/time for the returned context, can be null
+     * @param currentContext the current coordination context, can be null
+     *
+     * @return the created coordination context
+     *
+     * @throws com.arjuna.wsc.InvalidCreateParametersException if a parameter passed is invalid
+     *         this activity identifier
+     */
+	
+    public CoordinationContext create(final String coordinationTypeURI,
+            final Long expires, final CoordinationContextType currentContext)
+        throws InvalidCreateParametersException;
+
+    /**
+     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
+     * times if the context factory is removed from multiple context factory mappers or from the same context factory
+     * mapper with different coordination type uris.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+	
+    public void uninstall(final String coordinationTypeURI);
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactoryMapper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactoryMapper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/ContextFactoryMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,139 @@
+package com.arjuna.wsc11;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * The context factory mapper.
+ * @author kevin
+ */
+public class ContextFactoryMapper
+{
+    /**
+     * The factory singleton.
+     */
+    private static final ContextFactoryMapper FACTORY = new ContextFactoryMapper() ;
+
+    /**
+     * The context factory map.
+     */
+    private final Map contextFactoryMap = new HashMap() ;
+    /**
+     * The subordinate context factory mapper.
+     */
+    private ContextFactoryMapper subordinateContextFactoryMapper ;
+    /**
+     * The default context factory.
+     */
+    private ContextFactory defaultContextFactory ;
+
+    /**
+     * Get the context factory mapper singleton.
+     * @return The context factory mapper singleton.
+     */
+    public static ContextFactoryMapper getFactory()
+    {
+        return FACTORY;
+    }
+
+    /**
+     * Default constructor
+     */
+    protected ContextFactoryMapper()
+    {
+    }
+
+    /**
+     * Add a context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     * @param contextFactory The context factory.
+     */
+    public void addContextFactory(final String coordinationTypeURI, final ContextFactory contextFactory)
+    {
+        synchronized(contextFactoryMap)
+        {
+            contextFactoryMap.put(coordinationTypeURI, contextFactory) ;
+        }
+        contextFactory.install(coordinationTypeURI) ;
+    }
+
+    /**
+     * Get the context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     * @return The context factory.
+     */
+    public ContextFactory getContextFactory(final String coordinationTypeURI)
+    {
+        final Object localContextFactory ;
+        synchronized(contextFactoryMap)
+        {
+            localContextFactory = contextFactoryMap.get(coordinationTypeURI) ;
+        }
+        if (localContextFactory != null)
+        {
+            return (ContextFactory)localContextFactory ;
+        }
+        if (subordinateContextFactoryMapper != null)
+        {
+            final ContextFactory subordinateContextFactory = subordinateContextFactoryMapper.getContextFactory(coordinationTypeURI) ;
+            if (subordinateContextFactory != null)
+            {
+                return subordinateContextFactory ;
+            }
+        }
+        return defaultContextFactory ;
+    }
+
+    /**
+     * Remove the context factory for the specified coordination type.
+     * @param coordinationTypeURI The coordination type.
+     */
+    public void removeContextFactory(final String coordinationTypeURI)
+    {
+        final Object localContextFactory ;
+        synchronized(contextFactoryMap)
+        {
+            localContextFactory = contextFactoryMap.remove(coordinationTypeURI) ;
+        }
+        if (localContextFactory != null)
+        {
+            ((ContextFactory)localContextFactory).uninstall(coordinationTypeURI) ;
+        }
+    }
+
+    /**
+     * Get the subordinate coordination factory mapper.
+     * @return The subordinate coordination factory mapper.
+     */
+    public ContextFactoryMapper getSubordinateContextFactoryMapper()
+    {
+        return subordinateContextFactoryMapper ;
+    }
+
+    /**
+     * Set a subordinate coordination factory mapper.
+     * @param subordinateContextFactoryMapper The subordinate coordination factory mapper.
+     */
+    public void setSubordinateContextFactoryMapper(final ContextFactoryMapper subordinateContextFactoryMapper)
+    {
+        this.subordinateContextFactoryMapper = subordinateContextFactoryMapper ;
+    }
+
+    /**
+     * Get the default coordination factory.
+     * @return The default coordination factory.
+     */
+    public ContextFactory getDefaultContextFactory()
+    {
+        return defaultContextFactory ;
+    }
+
+    /**
+     * Set the default coordination factory.
+     * @param defaultContextFactory The default coordination factory.
+     */
+    public void setDefaultContextFactory(final ContextFactory defaultContextFactory)
+    {
+        this.defaultContextFactory = defaultContextFactory ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/Registrar.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,50 @@
+package com.arjuna.wsc11;
+
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.InvalidProtocolException;
+import com.arjuna.wsc.InvalidStateException;
+import com.arjuna.wsc.NoActivityException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public interface Registrar
+{
+    /**
+     * Called when a registrar is added to a register mapper. This method will be called multiple times if the
+     * registrar is added to multiple register mappers or to the same register mapper with different protocol
+     * identifiers.
+     *
+     * @param protocolIdentifier the protocol identifier
+     */
+    public void install(final String protocolIdentifier);
+
+    /**
+     * Registers the interest of participant in a particular protocol.
+     *
+     * @param participantProtocolService the port reference of the participant protocol service
+     * @param protocolIdentifier the protocol identifier
+     * @param instanceIdentifier the instance identifier, this may be null
+     *
+     * @return the port reference of the coordinator protocol service
+     *
+     * @throws com.arjuna.wsc.AlreadyRegisteredException if the participant is already registered for this coordination protocol under
+     *         this activity identifier
+     * @throws com.arjuna.wsc.InvalidProtocolException if the coordination protocol is not supported
+     * @throws com.arjuna.wsc.InvalidStateException if the state of the coordinator no longer allows registration for this
+     *         coordination protocol
+     * @throws com.arjuna.wsc.NoActivityException if the actvity does not exist
+     */
+    public W3CEndpointReference register(final W3CEndpointReference participantProtocolService,
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+        throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException;
+
+    /**
+     * Called when a registrar is removed from a register mapper. This method will be called multiple times if the
+     * registrar is removed from multiple register mappers or from the same register mapper with different protocol
+     * identifiers.
+     *
+     * @param protocolIdentifier the protocol identifier
+     */
+    public void uninstall(final String protocolIdentifier);
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrarMapper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrarMapper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrarMapper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,85 @@
+package com.arjuna.wsc11;
+
+import com.arjuna.wsc11.Registrar;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * The registrar mapper.
+ * @author kevin
+ */
+public class RegistrarMapper
+{
+    /**
+     * The factory singleton.
+     */
+    private static final RegistrarMapper FACTORY = new RegistrarMapper() ;
+
+    /**
+     * The registrar map.
+     */
+    private final Map registrarMap = new HashMap() ;
+
+    /**
+     * Get the registrar mapper singleton.
+     * @return The registrar mapper singleton.
+     */
+    public static RegistrarMapper getFactory()
+    {
+        return FACTORY;
+    }
+
+    /**
+     * Default constructor
+     */
+    protected RegistrarMapper()
+    {
+    }
+
+    /**
+     * Add a registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     * @param registrar The registrar.
+     */
+    public void addRegistrar(final String protocolIdentifier, final Registrar registrar)
+    {
+        synchronized(registrarMap)
+        {
+            registrarMap.put(protocolIdentifier, registrar) ;
+        }
+        registrar.install(protocolIdentifier) ;
+    }
+
+    /**
+     * Get the registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     * @return The registrar.
+     */
+    public Registrar getRegistrar(final String protocolIdentifier)
+    {
+        final Object localRegistrar ;
+        synchronized(registrarMap)
+        {
+            localRegistrar = registrarMap.get(protocolIdentifier) ;
+        }
+        return (Registrar)localRegistrar ;
+    }
+
+    /**
+     * Remove the registrar for the specified protocol identifier.
+     * @param protocolIdentifier The protocol identifier.
+     */
+    public void removeRegistrar(final String protocolIdentifier)
+    {
+        final Object localRegistrar ;
+        synchronized(registrarMap)
+        {
+            localRegistrar = registrarMap.remove(protocolIdentifier) ;
+        }
+        if (localRegistrar != null)
+        {
+            ((Registrar)localRegistrar).uninstall(protocolIdentifier) ;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrationCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrationCoordinator.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/RegistrationCoordinator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+package com.arjuna.wsc11;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.client.WSCOORClient;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.InvalidProtocolException;
+import com.arjuna.wsc.InvalidStateException;
+import com.arjuna.wsc.NoActivityException;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationPortType;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.soap.SOAPFaultException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Wrapper around low level Registration Coordinator messaging.
+ * @author kevin
+ */
+public class RegistrationCoordinator
+{
+    /**
+     * Register the participant in the protocol.
+     * @param coordinationContext The current coordination context
+     * @param messageID The messageID to use.
+     * @param participantProtocolService The participant protocol service.
+     * @param protocolIdentifier The protocol identifier.
+     * @return The endpoint reference of the coordinator protocol service.
+     * @throws com.arjuna.wsc.AlreadyRegisteredException If the participant is already registered.
+     * @throws com.arjuna.wsc.InvalidProtocolException If the protocol is unsupported.
+     * @throws com.arjuna.wsc.InvalidStateException If the state is invalid
+     * @throws com.arjuna.wsc.NoActivityException If there is to activity context active.
+     * @throws com.arjuna.webservices.SoapFault for errors during processing.
+     */
+    public static W3CEndpointReference register(final CoordinationContextType coordinationContext,
+        final String messageID, final W3CEndpointReference participantProtocolService,
+        final String protocolIdentifier)
+        throws AlreadyRegisteredException, InvalidProtocolException,
+            InvalidStateException, NoActivityException, SoapFault
+    {
+        final W3CEndpointReference endpointReference = coordinationContext.getRegistrationService() ;
+
+        try
+        {
+            RegisterType registerType = new RegisterType();
+            RegisterResponseType response;
+
+            registerType.setProtocolIdentifier(protocolIdentifier);
+            registerType.setParticipantProtocolService(participantProtocolService);
+            RegistrationPortType port = WSCOORClient.getRegistrationPort(endpointReference, CoordinationConstants.WSCOOR_ACTION_REGISTER, messageID);
+            response = port.registerOperation(registerType);
+            return response.getCoordinatorProtocolService();
+        } catch (SOAPFaultException sfe) {
+            // TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
+            final SOAPFault soapFault = sfe.getFault() ;
+            final QName subcode = soapFault.getFaultCodeAsQName() ;
+            if (CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME.equals(subcode))
+            {
+                throw new AlreadyRegisteredException(soapFault.getFaultString()) ;
+            }
+            else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode))
+            {
+                throw new InvalidProtocolException(soapFault.getFaultString()) ;
+            }
+            else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode))
+            {
+                throw new InvalidStateException(soapFault.getFaultString()) ;
+            }
+            else if (CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME.equals(subcode))
+            {
+                throw new NoActivityException(soapFault.getFaultString()) ;
+            }
+            throw new SoapFault11(sfe);
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/ActivationCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,115 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc11.messaging;
+
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.processors.ActivationCoordinatorProcessor;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.wsc11.ContextFactory;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc11.ContextFactoryMapper;
+
+import javax.xml.ws.soap.SOAPFaultException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.ProtocolException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPFactory;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.*;
+
+/**
+ * The Activation Coordinator processor.
+ * @author kevin
+ */
+public class ActivationCoordinatorProcessorImpl extends ActivationCoordinatorProcessor
+{
+    /**
+     * Create the coordination context.
+     * @param createCoordinationContext The create coordination context request.
+     * @param addressingProperties The addressing context.
+     * @message com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_1 [com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_1] - Invalid create coordination context parameters
+     * @message com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_2 [com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_2] - Unexpected exception thrown from create:
+     * @message com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_3 [com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_3] - CreateCoordinationContext called for unknown coordination type: {0}
+     */
+    public CreateCoordinationContextResponseType
+        createCoordinationContext(final CreateCoordinationContextType createCoordinationContext,
+                                  final AddressingProperties addressingProperties)
+    {
+        final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
+        try
+        {
+            final String coordinationType = createCoordinationContext.getCoordinationType() ;
+            final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
+            
+            if (contextFactory != null)
+            {
+                final CoordinationContext coordinationContext ;
+                try
+                {
+                    final Expires expiresElement = createCoordinationContext.getExpires() ;
+                    final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
+                    
+                    coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext()) ;
+                    final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
+                    response.setCoordinationContext(coordinationContext) ;
+                    return response;
+                }
+                catch (final InvalidCreateParametersException invalidCreateParametersException)
+                {
+	                SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME);
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_1"));
+	                throw new SOAPFaultException(soapFault);
+                }
+                catch (final Throwable th)
+                {
+                    if (WSCLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_2", th) ;
+                    }
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault() ;
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_EXCEPTION_QNAME).addTextNode(th.getMessage());
+                    throw new SOAPFaultException(soapFault);
+                }
+            }
+            else
+            {
+                if (WSCLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_3", new Object[] {coordinationType}) ;
+                }
+
+                SOAPFactory factory = SOAPFactory.newInstance();
+                SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME) ;
+                soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl_1"));
+                throw new SOAPFaultException(soapFault);
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+            throw new ProtocolException(throwable);
+
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/MessageId.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/MessageId.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/MessageId.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Created on 15-Jan-2005
+ */
+package com.arjuna.wsc11.messaging;
+
+import java.rmi.dgc.VMID;
+
+/**
+ * A simple message id generator, used when UID is inaccessible.
+ * @author kevin
+ */
+public class MessageId
+{
+    /**
+     * Prevent instantiation.
+     */
+    private MessageId()
+    {
+    }
+
+    /**
+     * Get the next message identifier.
+     * @return The next message identifier.
+     */
+    public static String getMessageId()
+    {
+        return "urn:" + new VMID().toString() ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/RegistrationCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,141 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc11.messaging;
+
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSCLogger;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wscoor.processors.RegistrationCoordinatorProcessor;
+import com.arjuna.wsc.*;
+import com.arjuna.wsc11.RegistrarMapper;
+import com.arjuna.wsc11.Registrar;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterType;
+
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPFault;
+import javax.xml.ws.ProtocolException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.soap.SOAPFaultException;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+
+/**
+ * The Registration Coordinator processor.
+ * @author kevin
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_1 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_1] - Participant already registered
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_2 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_2] - Invalid protocol identifier
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_3 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_3] - Invalid coordination context state
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_4 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_4] - Unknown activity identifier
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_5 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_5] - Unexpected exception thrown from create:
+ * @message com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_6 [com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_6] - Register called for unknown protocol identifier: {0}
+ */
+public class RegistrationCoordinatorProcessorImpl extends RegistrationCoordinatorProcessor
+{
+    /**
+     * Register the participant in the protocol.
+     * @param register The register request.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public RegisterResponseType register(final RegisterType register, final AddressingProperties addressingContext,
+        final ArjunaContext arjunaContext)
+    {
+        final com.arjuna.wsc11.RegistrarMapper registrarMapper = RegistrarMapper.getFactory() ;
+        try
+        {
+            final String protocolIdentifier = register.getProtocolIdentifier() ;
+            final Registrar registrar = registrarMapper.getRegistrar(protocolIdentifier) ;
+            
+            if (registrar != null)
+            {
+                try
+                {
+                    final W3CEndpointReference participantProtocolService = register.getParticipantProtocolService() ;
+                    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
+                    final W3CEndpointReference coordinationProtocolService =
+                            registrar.register(participantProtocolService, protocolIdentifier, instanceIdentifier) ;
+                    final RegisterResponseType response = new RegisterResponseType() ;
+
+                    response.setCoordinatorProtocolService(coordinationProtocolService);
+                    return response;
+                }
+                catch (final AlreadyRegisteredException alreadyRegisteredException)
+                {
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME);
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_ALREADY_REGISTERED_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_1"));
+                    throw new SOAPFaultException(soapFault);
+                }
+                catch (final InvalidProtocolException invalidProtocolException)
+                {
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_2"));
+                    throw new SOAPFaultException(soapFault);
+                }
+                catch (final InvalidStateException InvalidStateException)
+                {
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME);
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_3"));
+                    throw new SOAPFaultException(soapFault);
+                }
+                catch (final NoActivityException noActivityException)
+                {
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME);
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_NO_ACTIVITY_QNAME).addTextNode(WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_4"));
+                    throw new SOAPFaultException(soapFault);
+                }
+                catch (final Throwable th)
+                {
+                    if (WSCLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_5", th) ;
+                    }
+                    SOAPFactory factory = SOAPFactory.newInstance();
+                    SOAPFault soapFault = factory.createFault();
+                    soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_EXCEPTION_QNAME).addTextNode(th.getMessage());
+                    throw new SOAPFaultException(soapFault);
+                }
+            }
+            else
+            {
+                if (WSCLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSCLogger.arjLoggerI18N.debug("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_6", new Object[] {protocolIdentifier}) ;
+                }
+                SOAPFactory factory = SOAPFactory.newInstance();
+                SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
+                WSCLogger.log_mesg.getString("com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl_2") ;
+                throw new SOAPFaultException(soapFault);
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+            throw new ProtocolException(throwable);
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/deploy/CoordinationInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/deploy/CoordinationInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/com/arjuna/wsc11/messaging/deploy/CoordinationInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,61 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wsc11.messaging.deploy;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wscoor.processors.ActivationCoordinatorProcessor;
+import com.arjuna.webservices11.wscoor.processors.RegistrationCoordinatorProcessor;
+import com.arjuna.wsc11.messaging.ActivationCoordinatorProcessorImpl;
+import com.arjuna.wsc11.messaging.RegistrationCoordinatorProcessorImpl;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Initialise the coordination services.
+ * @author kevin
+ */
+public class CoordinationInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11) {
+           public void run() {
+               ActivationCoordinatorProcessor.setCoordinator(new ActivationCoordinatorProcessorImpl()) ;
+               RegistrationCoordinatorProcessor.setCoordinator(new RegistrationCoordinatorProcessorImpl()) ;
+           }
+        };
+        // this is the last WSC callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSC11);
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,34 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+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 the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "ActivationPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface ActivationPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     * @return
+     *     returns org.oasis_open.docs.ws_tx.wscoor._2006._06.CreateCoordinationContextResponseType
+     */
+    @WebMethod(operationName = "CreateCoordinationContextOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/CreateCoordinationContext")
+    @WebResult(name = "CreateCoordinationContextResponse", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+    public CreateCoordinationContextResponseType createCoordinationContextOperation(
+        @WebParam(name = "CreateCoordinationContext", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+        CreateCoordinationContextType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ActivationService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,60 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+import javax.xml.ws.soap.AddressingFeature;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "ActivationService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", wsdlLocation = "wsdl/wscoor-activation-binding.wsdl")
+public class ActivationService
+    extends Service21
+{
+
+    private final static URL ACTIVATIONSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wscoor._2006._06.ActivationService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wscoor-activation-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wscoor-activation-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        ACTIVATIONSERVICE_WSDL_LOCATION = url;
+    }
+
+    public ActivationService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public ActivationService() {
+        super(ACTIVATIONSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "ActivationService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns ActivationPortType
+     */
+    @WebEndpoint(name = "ActivationPortType")
+    public ActivationPortType getActivationPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "ActivationPortType"), ActivationPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContext.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContext.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContext.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,75 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;extension base="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}CoordinationContextType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/extension>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+    "any"
+})
+ at XmlRootElement(name = "CoordinationContext")
+public class CoordinationContext
+    extends CoordinationContextType
+{
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContextType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContextType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CoordinationContextType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,254 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+
+/**
+ * <p>Java class for CoordinationContextType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="CoordinationContextType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="Identifier">
+ *           &lt;complexType>
+ *             &lt;simpleContent>
+ *               &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anyURI">
+ *               &lt;/extension>
+ *             &lt;/simpleContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element ref="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}Expires" minOccurs="0"/>
+ *         &lt;element name="CoordinationType" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         &lt;element name="RegistrationService" type="{http://www.w3.org/2005/08/addressing}EndpointReferenceType"/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "CoordinationContextType", propOrder = {
+    "identifier",
+    "expires",
+    "coordinationType",
+    "registrationService"
+})
+public class CoordinationContextType {
+
+    @XmlElement(name = "Identifier", required = true)
+    protected CoordinationContextType.Identifier identifier;
+    @XmlElement(name = "Expires")
+    protected Expires expires;
+    @XmlElement(name = "CoordinationType", required = true)
+    @XmlSchemaType(name = "anyURI")
+    protected String coordinationType;
+    @XmlElement(name = "RegistrationService", required = true)
+    protected W3CEndpointReference registrationService;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the identifier property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CoordinationContextType.Identifier }
+     *     
+     */
+    public CoordinationContextType.Identifier getIdentifier() {
+        return identifier;
+    }
+
+    /**
+     * Sets the value of the identifier property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CoordinationContextType.Identifier }
+     *     
+     */
+    public void setIdentifier(CoordinationContextType.Identifier value) {
+        this.identifier = value;
+    }
+
+    /**
+     * Gets the value of the expires property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Expires }
+     *     
+     */
+    public Expires getExpires() {
+        return expires;
+    }
+
+    /**
+     * Sets the value of the expires property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Expires }
+     *     
+     */
+    public void setExpires(Expires value) {
+        this.expires = value;
+    }
+
+    /**
+     * Gets the value of the coordinationType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCoordinationType() {
+        return coordinationType;
+    }
+
+    /**
+     * Sets the value of the coordinationType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCoordinationType(String value) {
+        this.coordinationType = value;
+    }
+
+    /**
+     * Gets the value of the registrationService property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public W3CEndpointReference getRegistrationService() {
+        return registrationService;
+    }
+
+    /**
+     * Sets the value of the registrationService property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public void setRegistrationService(W3CEndpointReference value) {
+        this.registrationService = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;simpleContent>
+     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anyURI">
+     *     &lt;/extension>
+     *   &lt;/simpleContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "value"
+    })
+    public static class Identifier {
+
+        @XmlValue
+        @XmlSchemaType(name = "anyURI")
+        protected String value;
+        @XmlAnyAttribute
+        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+        /**
+         * Gets the value of the value property.
+         * 
+         * @return
+         *     possible object is
+         *     {@link String }
+         *     
+         */
+        public String getValue() {
+            return value;
+        }
+
+        /**
+         * Sets the value of the value property.
+         * 
+         * @param value
+         *     allowed object is
+         *     {@link String }
+         *     
+         */
+        public void setValue(String value) {
+            this.value = value;
+        }
+
+        /**
+         * Gets a map that contains attributes that aren't bound to any typed property on this class.
+         * 
+         * <p>
+         * the map is keyed by the name of the attribute and 
+         * the value is the string value of the attribute.
+         * 
+         * the map returned by this method is live, and you can add new attribute
+         * by updating the map directly. Because of this design, there's no setter.
+         * 
+         * 
+         * @return
+         *     always non-null
+         */
+        public Map<QName, String> getOtherAttributes() {
+            return otherAttributes;
+        }
+
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextResponseType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextResponseType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextResponseType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,124 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for CreateCoordinationContextResponseType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="CreateCoordinationContextResponseType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element ref="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}CoordinationContext"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "CreateCoordinationContextResponseType", propOrder = {
+    "coordinationContext",
+    "any"
+})
+public class CreateCoordinationContextResponseType {
+
+    @XmlElement(name = "CoordinationContext", required = true)
+    protected CoordinationContext coordinationContext;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the coordinationContext property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CoordinationContext }
+     *     
+     */
+    public CoordinationContext getCoordinationContext() {
+        return coordinationContext;
+    }
+
+    /**
+     * Sets the value of the coordinationContext property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CoordinationContext }
+     *     
+     */
+    public void setCoordinationContext(CoordinationContext value) {
+        this.coordinationContext = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/CreateCoordinationContextType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,255 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for CreateCoordinationContextType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="CreateCoordinationContextType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element ref="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}Expires" minOccurs="0"/>
+ *         &lt;element name="CurrentContext" minOccurs="0">
+ *           &lt;complexType>
+ *             &lt;complexContent>
+ *               &lt;extension base="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}CoordinationContextType">
+ *                 &lt;sequence>
+ *                   &lt;any/>
+ *                 &lt;/sequence>
+ *               &lt;/extension>
+ *             &lt;/complexContent>
+ *           &lt;/complexType>
+ *         &lt;/element>
+ *         &lt;element name="CoordinationType" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "CreateCoordinationContextType", propOrder = {
+    "expires",
+    "currentContext",
+    "coordinationType",
+    "any"
+})
+public class CreateCoordinationContextType {
+
+    @XmlElement(name = "Expires")
+    protected Expires expires;
+    @XmlElement(name = "CurrentContext")
+    protected CreateCoordinationContextType.CurrentContext currentContext;
+    @XmlElement(name = "CoordinationType", required = true)
+    @XmlSchemaType(name = "anyURI")
+    protected String coordinationType;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the expires property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link Expires }
+     *     
+     */
+    public Expires getExpires() {
+        return expires;
+    }
+
+    /**
+     * Sets the value of the expires property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link Expires }
+     *     
+     */
+    public void setExpires(Expires value) {
+        this.expires = value;
+    }
+
+    /**
+     * Gets the value of the currentContext property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link CreateCoordinationContextType.CurrentContext }
+     *     
+     */
+    public CreateCoordinationContextType.CurrentContext getCurrentContext() {
+        return currentContext;
+    }
+
+    /**
+     * Sets the value of the currentContext property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link CreateCoordinationContextType.CurrentContext }
+     *     
+     */
+    public void setCurrentContext(CreateCoordinationContextType.CurrentContext value) {
+        this.currentContext = value;
+    }
+
+    /**
+     * Gets the value of the coordinationType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getCoordinationType() {
+        return coordinationType;
+    }
+
+    /**
+     * Sets the value of the coordinationType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setCoordinationType(String value) {
+        this.coordinationType = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+
+    /**
+     * <p>Java class for anonymous complex type.
+     * 
+     * <p>The following schema fragment specifies the expected content contained within this class.
+     * 
+     * <pre>
+     * &lt;complexType>
+     *   &lt;complexContent>
+     *     &lt;extension base="{http://docs.oasis-open.org/ws-tx/wscoor/2006/06}CoordinationContextType">
+     *       &lt;sequence>
+     *         &lt;any/>
+     *       &lt;/sequence>
+     *     &lt;/extension>
+     *   &lt;/complexContent>
+     * &lt;/complexType>
+     * </pre>
+     * 
+     * 
+     */
+    @XmlAccessorType(XmlAccessType.FIELD)
+    @XmlType(name = "", propOrder = {
+        "any"
+    })
+    public static class CurrentContext
+        extends CoordinationContextType
+    {
+
+        @XmlAnyElement(lax = true)
+        protected List<Object> any;
+
+        /**
+         * Gets the value of the any property.
+         * 
+         * <p>
+         * This accessor method returns a reference to the live list,
+         * not a snapshot. Therefore any modification you make to the
+         * returned list will be present inside the JAXB object.
+         * This is why there is not a <CODE>set</CODE> method for the any property.
+         * 
+         * <p>
+         * For example, to add a new item, do as follows:
+         * <pre>
+         *    getAny().add(newItem);
+         * </pre>
+         * 
+         * 
+         * <p>
+         * Objects of the following type(s) are allowed in the list
+         * {@link Element }
+         * {@link Object }
+         * 
+         * 
+         */
+        public List<Object> getAny() {
+            if (any == null) {
+                any = new ArrayList<Object>();
+            }
+            return this.any;
+        }
+
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/Expires.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/Expires.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/Expires.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,79 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;simpleContent>
+ *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>unsignedInt">
+ *     &lt;/extension>
+ *   &lt;/simpleContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+    "value"
+})
+ at XmlRootElement(name = "Expires")
+public class Expires {
+
+    @XmlValue
+    @XmlSchemaType(name = "unsignedInt")
+    protected long value;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the value property.
+     * 
+     */
+    public long getValue() {
+        return value;
+    }
+
+    /**
+     * Sets the value of the value property.
+     * 
+     */
+    public void setValue(long value) {
+        this.value = value;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ObjectFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ObjectFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/ObjectFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,147 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.oasis_open.docs.ws_tx.wscoor._2006._06 package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Register_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "Register");
+    private final static QName _RegisterResponse_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "RegisterResponse");
+    private final static QName _CreateCoordinationContext_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "CreateCoordinationContext");
+    private final static QName _CreateCoordinationContextResponse_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "CreateCoordinationContextResponse");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.oasis_open.docs.ws_tx.wscoor._2006._06
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link Expires }
+     * 
+     */
+    public Expires createExpires() {
+        return new Expires();
+    }
+
+    /**
+     * Create an instance of {@link CreateCoordinationContextResponseType }
+     * 
+     */
+    public CreateCoordinationContextResponseType createCreateCoordinationContextResponseType() {
+        return new CreateCoordinationContextResponseType();
+    }
+
+    /**
+     * Create an instance of {@link CoordinationContextType.Identifier }
+     * 
+     */
+    public CoordinationContextType.Identifier createCoordinationContextTypeIdentifier() {
+        return new CoordinationContextType.Identifier();
+    }
+
+    /**
+     * Create an instance of {@link CoordinationContextType }
+     * 
+     */
+    public CoordinationContextType createCoordinationContextType() {
+        return new CoordinationContextType();
+    }
+
+    /**
+     * Create an instance of {@link CreateCoordinationContextType.CurrentContext }
+     * 
+     */
+    public CreateCoordinationContextType.CurrentContext createCreateCoordinationContextTypeCurrentContext() {
+        return new CreateCoordinationContextType.CurrentContext();
+    }
+
+    /**
+     * Create an instance of {@link RegisterResponseType }
+     * 
+     */
+    public RegisterResponseType createRegisterResponseType() {
+        return new RegisterResponseType();
+    }
+
+    /**
+     * Create an instance of {@link CreateCoordinationContextType }
+     * 
+     */
+    public CreateCoordinationContextType createCreateCoordinationContextType() {
+        return new CreateCoordinationContextType();
+    }
+
+    /**
+     * Create an instance of {@link RegisterType }
+     * 
+     */
+    public RegisterType createRegisterType() {
+        return new RegisterType();
+    }
+
+    /**
+     * Create an instance of {@link CoordinationContext }
+     * 
+     */
+    public CoordinationContext createCoordinationContext() {
+        return new CoordinationContext();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link RegisterType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "Register")
+    public JAXBElement<RegisterType> createRegister(RegisterType value) {
+        return new JAXBElement<RegisterType>(_Register_QNAME, RegisterType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link RegisterResponseType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "RegisterResponse")
+    public JAXBElement<RegisterResponseType> createRegisterResponse(RegisterResponseType value) {
+        return new JAXBElement<RegisterResponseType>(_RegisterResponse_QNAME, RegisterResponseType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link CreateCoordinationContextType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "CreateCoordinationContext")
+    public JAXBElement<CreateCoordinationContextType> createCreateCoordinationContext(CreateCoordinationContextType value) {
+        return new JAXBElement<CreateCoordinationContextType>(_CreateCoordinationContext_QNAME, CreateCoordinationContextType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link CreateCoordinationContextResponseType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", name = "CreateCoordinationContextResponse")
+    public JAXBElement<CreateCoordinationContextResponseType> createCreateCoordinationContextResponse(CreateCoordinationContextResponseType value) {
+        return new JAXBElement<CreateCoordinationContextResponseType>(_CreateCoordinationContextResponse_QNAME, CreateCoordinationContextResponseType.class, null, value);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterResponseType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterResponseType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterResponseType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,125 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for RegisterResponseType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RegisterResponseType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="CoordinatorProtocolService" type="{http://www.w3.org/2005/08/addressing}EndpointReferenceType"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "RegisterResponseType", propOrder = {
+    "coordinatorProtocolService",
+    "any"
+})
+public class RegisterResponseType {
+
+    @XmlElement(name = "CoordinatorProtocolService", required = true)
+    protected W3CEndpointReference coordinatorProtocolService;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the coordinatorProtocolService property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public W3CEndpointReference getCoordinatorProtocolService() {
+        return coordinatorProtocolService;
+    }
+
+    /**
+     * Sets the value of the coordinatorProtocolService property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public void setCoordinatorProtocolService(W3CEndpointReference value) {
+        this.coordinatorProtocolService = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegisterType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,155 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for RegisterType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="RegisterType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="ProtocolIdentifier" type="{http://www.w3.org/2001/XMLSchema}anyURI"/>
+ *         &lt;element name="ParticipantProtocolService" type="{http://www.w3.org/2005/08/addressing}EndpointReferenceType"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "RegisterType", propOrder = {
+    "protocolIdentifier",
+    "participantProtocolService",
+    "any"
+})
+public class RegisterType {
+
+    @XmlElement(name = "ProtocolIdentifier", required = true)
+    @XmlSchemaType(name = "anyURI")
+    protected String protocolIdentifier;
+    @XmlElement(name = "ParticipantProtocolService", required = true)
+    protected W3CEndpointReference participantProtocolService;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the protocolIdentifier property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getProtocolIdentifier() {
+        return protocolIdentifier;
+    }
+
+    /**
+     * Sets the value of the protocolIdentifier property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setProtocolIdentifier(String value) {
+        this.protocolIdentifier = value;
+    }
+
+    /**
+     * Gets the value of the participantProtocolService property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public W3CEndpointReference getParticipantProtocolService() {
+        return participantProtocolService;
+    }
+
+    /**
+     * Sets the value of the participantProtocolService property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link W3CEndpointReference }
+     *     
+     */
+    public void setParticipantProtocolService(W3CEndpointReference value) {
+        this.participantProtocolService = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,34 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+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 the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "RegistrationPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface RegistrationPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     * @return
+     *     returns org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType
+     */
+    @WebMethod(operationName = "RegisterOperation", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/Register")
+    @WebResult(name = "RegisterResponse", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+    public RegisterResponseType registerOperation(
+        @WebParam(name = "Register", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", partName = "parameters")
+        RegisterType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/RegistrationService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,60 @@
+
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+import javax.xml.ws.soap.AddressingFeature;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "RegistrationService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", wsdlLocation = "wsdl/wscoor-registration-binding.wsdl")
+public class RegistrationService
+    extends Service21
+{
+
+    private final static URL REGISTRATIONSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wscoor._2006._06.RegistrationService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wscoor-registration-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wscoor-registration-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        REGISTRATIONSERVICE_WSDL_LOCATION = url;
+    }
+
+    public RegistrationService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public RegistrationService() {
+        super(REGISTRATIONSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "RegistrationService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns RegistrationPortType
+     */
+    @WebEndpoint(name = "RegistrationPortType")
+    public RegistrationPortType getRegistrationPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wscoor/2006/06", "RegistrationPortType"), RegistrationPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/package-info.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/package-info.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src11/org/oasis_open/docs/ws_tx/wscoor/_2006/_06/package-info.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,2 @@
+ at javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.oasis_open.docs.ws_tx.wscoor._2006._06;

Modified: labs/jbosstm/trunk/XTS/WS-T/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -43,10 +43,14 @@
 
     <property name="build.dir"               value="build"/>
     <property name="dev.src.dir"             value="dev/src"/>
+    <property name="dev.src10.dir"             value="dev/src10"/>
+    <property name="dev.src11.dir"             value="dev/src11"/>
     <property name="dev.dd.dir"              value="dev/dd"/>
     <property name="tests.src.dir"           value="tests/src"/>
     <property name="tests.dd.dir"            value="tests/dd"/>
     <property name="build.dev.classes.dir"   value="${build.dir}/dev/classes"/>
+    <property name="build.dev.classes10.dir"   value="${build.dir}/dev/classes10/classes"/>
+    <property name="build.dev.classes11.dir"   value="${build.dir}/dev/classes11/classes"/>
     <property name="build.dev.lib.dir"       value="${build.dir}/dev/lib"/>
     <property name="build.dev.dd.dir"        value="${build.dir}/dev/dd"/>
     <property name="build.dev.webapps.dir"   value="${build.dir}/dev/webapps"/>
@@ -74,10 +78,12 @@
     <property name="xts.ext.compile.jars" value="servlet.jar"/>
     -->
     <property name="xts.ext.jars" value=""/>
-    <property name="xts.ext.compile.jars" value="stax-api-1.0.jar wstx-asl-2.0.3.jar servlet.jar"/>
+    <property name="xts.ext.compile.jars" value="jaxb-api.jar jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jbossws-client.jar jboss-saaj.jar"/>
 
     <property name="tests.libs"              value="junit.jar"/>
     <property name="ws-c.libs"               value="ws-c.jar"/>
+    <property name="ws-c10.libs"               value="ws-c10.jar"/>
+    <property name="ws-c11.libs"               value="ws-c11.jar"/>
 
     <property name="javac.debug"             value="on"/>
     <property name="javac.optimize"          value="off"/>
@@ -85,6 +91,12 @@
     <path id="ws-c.path">
         <fileset dir="${ws-c.build.dev.lib.dir}" includes="${ws-c.libs}"/>
     </path>
+    <path id="ws-c10.path">
+        <fileset dir="${ws-c.build.dev.lib.dir}" includes="${ws-c10.libs}"/>
+    </path>
+    <path id="ws-c11.path">
+        <fileset dir="${ws-c.build.dev.lib.dir}" includes="${ws-c11.libs}"/>
+    </path>
 
     <path id="lib.ext.path">
         <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
@@ -124,6 +136,8 @@
     <target name="init-dir">
         <mkdir dir="${build.dir}"/>
         <mkdir dir="${build.dev.classes.dir}"/>
+        <mkdir dir="${build.dev.classes10.dir}"/>
+        <mkdir dir="${build.dev.classes11.dir}"/>
         <mkdir dir="${build.dev.lib.dir}"/>
         <mkdir dir="${build.dev.dd.dir}"/>
         <mkdir dir="${build.dev.webapps.dir}"/>
@@ -133,7 +147,35 @@
         <mkdir dir="${build.tests.webapps.dir}"/>
     </target>
 
-    <target name="dev-compile" depends="init">
+    <target name="dev-compile" depends="dev-compile10, dev-compile11"/>
+
+    <target name="dev-compile10" depends="dev-compile-generic">
+        <javac destdir="${build.dev.classes10.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
+            <classpath>
+                <path>
+                    <pathelement path="${build.dev.classes.dir}"/>
+                </path>
+                <path refid="lib.ext.path"/>
+                <path refid="ws-c10.path"/>
+            </classpath>
+            <src path="${dev.src10.dir}"/>
+        </javac>
+    </target>
+
+    <target name="dev-compile11" depends="dev-compile-generic">
+        <javac destdir="${build.dev.classes11.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
+            <classpath>
+                <path>
+                    <pathelement path="${build.dev.classes.dir}"/>
+                </path>
+                <path refid="lib.ext.path"/>
+                <path refid="ws-c11.path"/>
+            </classpath>
+            <src path="${dev.src11.dir}"/>
+        </javac>
+    </target>
+
+    <target name="dev-compile-generic" depends="init">
         <javac destdir="${build.dev.classes.dir}" debug="${javac.debug}" optimize="${javac.optimize}">
             <classpath>
                 <path refid="lib.ext.path"/>
@@ -148,13 +190,24 @@
 
         <classpath-builder filename="${com.arjuna.mwlabs.classpathbuilderfilename}" inproperty="build.classpath"/>
 
-        <javadoc    sourcepath="${dev.src.dir}"
-                    packagenames="com.arjuna.*"
+        <javadoc    packagenames="com.arjuna.*"
                     failonerror="yes"
                     private="yes"
                     defaultexcludes="yes"
                     classpath="${build.classpath}">
 
+            <packageset dir="${dev.src.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
+            <packageset dir="${dev.src10.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
+            <packageset dir="${dev.src11.dir}" defaultexcludes="yes">
+              <include name="com/arjuna/**"/>
+            </packageset>
+
              <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
                 <path>
                     <pathelement path="${com.arjuna.buildsystem.classpath}"/>
@@ -166,12 +219,56 @@
     </target>
 
     <target name="dev-jars" depends="dev-compile, dev-resourcebundle" >
+        <!-- wsdl files for services -->
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-participant-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsat-participant-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsat-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsat-completion-initiator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsat-completion-coordinator-binding.wsdl"/>
+
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsba-coordinator-completion-participant-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsba-participant-completion-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsba-participant-completion-participant-binding.wsdl"/>
+
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsarjtx.wsdl"/>
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsarjtx-termination-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl" tofile="${build.dev.dd.dir}/wsdl/wsarjtx-termination-participant-binding.wsdl"/>
+
+        <!-- wsdl files for clients  -->
+        <mkdir dir="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsat/_2006/_06/wsdl"/>
+        <mkdir dir="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsba/_2006/_06/wsdl"/>
+        <mkdir dir="${build.dev.classes11.dir}/com/arjuna/schemas/ws/_2005/_10/wsarjtx/wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-participant-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsat/_2006/_06/wsdl/wsat-participant-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsat/_2006/_06/wsdl/wsat-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsat/_2006/_06/wsdl/wsat-completion-initiator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsat/_2006/_06/wsdl/wsat-completion-coordinator-binding.wsdl"/>
+
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsba/_2006/_06/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsba/_2006/_06/wsdl/wsba-coordinator-completion-participant-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsba/_2006/_06/wsdl/wsba-participant-completion-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl" tofile="${build.dev.classes11.dir}/org/oasis_open/docs/ws_tx/wsba/_2006/_06/wsdl/wsba-participant-completion-participant-binding.wsdl"/>
+
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx.wsdl" tofile="${build.dev.classes11.dir}/com/arjuna/schemas/ws/_2005/_10/wsarjtx/wsdl/wsarjtx.wsdl"/>
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl" tofile="${build.dev.classes11.dir}/com/arjuna/schemas/ws/_2005/_10/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl"/>
+        <copy file="${dev.dd.dir}/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl" tofile="${build.dev.classes11.dir}/com/arjuna/schemas/ws/_2005/_10/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl"/>
         <jar jarfile="${build.dev.lib.dir}/ws-t.jar">
             <fileset dir="${build.dev.classes.dir}"/>
             <manifest>
                 <attribute name="Class-Path" value="${ws-c.libs}"/>
             </manifest>
         </jar>
+        <jar jarfile="${build.dev.lib.dir}/ws-t10.jar">
+            <fileset dir="${build.dev.classes10.dir}"/>
+            <manifest>
+                <attribute name="Class-Path" value="ws-t.jar ${ws-c10.libs}"/>
+            </manifest>
+        </jar>
+        <jar jarfile="${build.dev.lib.dir}/ws-t11.jar">
+            <fileset dir="${build.dev.classes11.dir}" excludes="com/arjuna/webservices11/wsat/sei/* com/arjuna/webservices11/wsba/sei/* com/arjuna/webservices11/wsarjtx/sei/* handlers.xml"/>
+            <manifest>
+                <attribute name="Class-Path" value="ws-t.jar ${ws-c11.libs}"/>
+            </manifest>
+        </jar>
     </target>
 
     <target name="dev-webapps" depends="dev-jars">
@@ -181,11 +278,25 @@
                 <filter token="port" value="${port}"/>
             </filterset>
         </copy>
-        <war warfile="${build.dev.webapps.dir}/ws-t.war" webxml="${build.dev.dd.dir}/web-app.xml">
+        <copy file="${dev.dd.dir}/ws-t11_web-app.xml" tofile="${build.dev.dd.dir}/web-app11.xml">
+            <filterset>
+                <filter token="hostname" value="${hostname}"/>
+                <filter token="port" value="${port}"/>
+            </filterset>
+        </copy>
+        <copy file="${dev.dd.dir}/ws-t_handlers.xml" tofile="${build.dev.classes11.dir}/handlers.xml"/>
+        <war warfile="${build.dev.webapps.dir}/ws-t10.war" webxml="${build.dev.dd.dir}/web-app.xml">
             <manifest>
-                <attribute name="Class-Path" value="ws-t.jar"/>
+                <attribute name="Class-Path" value="ws-t10.jar ws-t.jar"/>
             </manifest>
         </war>
+        <war warfile="${build.dev.webapps.dir}/ws-t11.war" webxml="${build.dev.dd.dir}/web-app11.xml">
+            <webinf dir="${build.dir}/dev/classes11" includes="classes/com/arjuna/webservices11/wsat/sei/* classes/com/arjuna/webservices11/wsba/sei/* classes/com/arjuna/webservices11/wsarjtx/sei/* classes/handlers.xml"/>
+            <webinf dir="${build.dev.dd.dir}" includes="wsdl/**"/>
+            <manifest>
+                <attribute name="Class-Path" value="WEB-INF/classes ws-c.jar ws-t11.jar ws-t.jar"/>
+            </manifest>
+        </war>
     </target>
 
     <target name="tests-compile" depends="dev-webapps">

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t11_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,176 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Arjuna Web Services Transaction 1.1</display-name>
+
+    <description>Arjuna Web Services Transaction 1.1</description>
+
+    <!-- base URL for location of Web Services Transaction 1.1 services -->
+    <context-param>
+        <param-name>BaseURI</param-name>
+	<param-value>http://@hostname@:@port@/ws-t11</param-value>
+    </context-param>
+    <!-- Initialise Arjuna TX 1.1 services -->
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsarjtx.server.TerminationParticipantInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsarjtx.server.TerminationCoordinatorInitialisation</listener-class>
+    </listener>
+    
+    <!-- Initialise WS-AT 1.1 services -->
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsat.server.CompletionCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsat.server.CompletionInitiatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsat.server.CoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsat.server.ParticipantInitialisation</listener-class>
+    </listener>
+    
+    <!-- Initialise WS-BA 1.1 services -->
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsba.server.CoordinatorCompletionCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsba.server.CoordinatorCompletionParticipantInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsba.server.ParticipantCompletionCoordinatorInitialisation</listener-class>
+    </listener>
+    <listener>
+        <listener-class>com.arjuna.webservices11.wsba.server.ParticipantCompletionParticipantInitialisation</listener-class>
+    </listener>
+    
+    <!-- Initialise WS-T  1.1 -->
+    <listener>
+        <listener-class>com.arjuna.wst11.messaging.deploy.TransactionInitialisation</listener-class>
+    </listener>
+
+    <!-- Define WSAT 1.1 JaxWS Server Endpoints -->
+    <servlet>
+      <servlet-name>Coordinator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsat.sei.CoordinatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Participant</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsat.sei.ParticipantPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Completion Coordinator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsat.sei.CompletionCoordinatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Completion Initiator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsat.sei.CompletionInitiatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- Define WSBA 1.1 JaxWS Server Endpoints -->
+    <servlet>
+      <servlet-name>Business Agreement With Coordinator Completion Coordinator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsba.sei.BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Business Agreement With Coordinator Completion Participant</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsba.sei.BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Business Agreement With Participant Completion Coordinator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsba.sei.BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Business Agreement With Participant Completion Participant</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsba.sei.BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- Define WSArjTX JaxWS Server Endpoints -->
+    <servlet>
+      <servlet-name>Termination Coordinator</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsarjtx.sei.TerminationCoordinatorPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet>
+      <servlet-name>Termination Participant</servlet-name>
+      <servlet-class>com.arjuna.webservices11.wsarjtx.sei.TerminationParticipantPortTypeImpl</servlet-class>
+      <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <!-- Define WSAT 1.1 JaxWS Server Endpoint Mappings -->
+    <servlet-mapping>
+      <servlet-name>Coordinator</servlet-name>
+      <url-pattern>/CoordinatorService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Participant</servlet-name>
+      <url-pattern>/ParticipantService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Completion Coordinator</servlet-name>
+      <url-pattern>/CompletionCoordinatorService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Completion Initiator</servlet-name>
+      <url-pattern>/CompletionInitiatorService</url-pattern>
+    </servlet-mapping>
+
+    <!-- Define WSBA 1.1 JaxWS Server Endpoint Mappings -->
+    <servlet-mapping>
+      <servlet-name>Business Agreement With Coordinator Completion Coordinator</servlet-name>
+      <url-pattern>/BusinessAgreementWithCoordinatorCompletionCoordinatorService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Business Agreement With Coordinator Completion Participant</servlet-name>
+      <url-pattern>/BusinessAgreementWithCoordinatorCompletionParticipantService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Business Agreement With Participant Completion Coordinator</servlet-name>
+      <url-pattern>/BusinessAgreementWithParticipantCompletionCoordinatorService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Business Agreement With Participant Completion Participant</servlet-name>
+      <url-pattern>/BusinessAgreementWithParticipantCompletionParticipantService</url-pattern>
+    </servlet-mapping>
+
+    <!-- Define WSArjTX JaxWS Server Endpoint Mappings -->
+    <servlet-mapping>
+      <servlet-name>Termination Coordinator</servlet-name>
+      <url-pattern>/TerminationCoordinatorService</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+      <servlet-name>Termination Participant</servlet-name>
+      <url-pattern>/TerminationParticipantService</url-pattern>
+    </servlet-mapping>
+</web-app>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t_handlers.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t_handlers.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/ws-t_handlers.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2007, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags. 
+  See the copyright.txt in the distribution for a full listing 
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2007,
+  @author JBoss Inc.
+-->
+<handler-chains xmlns="http://java.sun.com/xml/ns/javaee" 
+xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+xsi:schemaLocation="http://java.sun.com/xml/ns/javaee">
+    <handler-chain>
+	<handler>
+		<handler-name>Instance Identifier Handler</handler-name>
+		<handler-class>com.arjuna.webservices11.wsarj.handler.InstanceIdentifierHandler</handler-class>
+	</handler>
+	<handler>
+		<handler-name>WS Addressing Server Handler</handler-name>
+		<handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler</handler-class>
+	</handler>
+    </handler-chain>
+</handler-chains>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/build.sh
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/build.sh	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/build.sh	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,40 @@
+#
+#
+#
+
+if [ ! -d tmp ] ; then
+    mkdir tmp
+fi
+
+if [ ! -d tmp/classes ] ; then
+    mkdir tmp/classes
+fi
+
+if [ ! -d tmp/src ] ; then
+    mkdir tmp/src
+fi
+
+# delete old generated versions -- any changes should be made to a copy!
+
+rm -rf tmp/classes/* tmp/src/*
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /wsdl/wsarjtx.wsdl -o tmp/classes -s tmp/src -k wsdl/wsarjtx.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /home/adinn/tmp/wsdl/wsarjtx.wsdl -o tmp/classes -s tmp/src -k wsdl/wsarjtx.wsdl
+
+# generate termination participant and coordinator code
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsarjtx-termination-participant-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsarjtx-termination-participant-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsarjtx-termination-coordinator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsarjtx-termination-coordinator-binding.wsdl
+
+# we need to patch the resource lookup used to provide a jar base URL
+# for the wsdl location supplied above wsimport generates
+# e.g. 'qualified.path.ClassName.class.getResource(".")' to locate a
+# URL for the jar dir containing ClassName.class. But the EJB class
+# loader returns null for this (even though it returns true for
+# hasEntry!). If we patch the generated code to specify
+# 'qualified.path.ClassName.class.getResource("")' it works ok.
+
+sed -i -e 's/TerminationCoordinatorService.class.getResource(".")/TerminationCoordinatorService.class.getResource("")/' tmp/src/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorService.java
+sed -i -e 's/TerminationParticipantService.class.getResource(".")/TerminationParticipantService.class.getResource("")/' tmp/src/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantService.java

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-orig.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-orig.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-orig.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2007 JBoss -->
+<wsdl:definitions name="WSARJTX"
+		  targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+		  xmlns="http://schemas.xmlsoap.org/wsdl/" 
+		  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		  xmlns:wsarjtx="http://schemas.arjuna.com/ws/2005/10/wsarjtx">
+        <wsdl:types>
+	  <schema targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx" 
+		  xmlns="http://www.w3.org/2001/XMLSchema"
+		  elementFormDefault="qualified">
+	    <complexType name="NotificationType">
+		<sequence>
+		    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+	    </complexType>
+	    <complexType name="ExceptionType">
+		<sequence>
+		    <element name="soapFaultType" type="string"/>
+		    <element name="subCode" type="QName"/>
+		    <element name="reason" type="string"/>
+		    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+	    </complexType>
+	    <!-- Coordinator accepts -->
+	    <element name="Complete" type="wsarjtx:NotificationType"/>
+	    <element name="Close" type="wsarjtx:NotificationType"/>
+	    <element name="Cancel" type="wsarjtx:NotificationType"/>
+	    <!-- Participant accepts -->
+	    <element name="Completed" type="wsarjtx:NotificationType"/>
+	    <element name="Closed" type="wsarjtx:NotificationType"/>
+	    <element name="Cancelled" type="wsarjtx:NotificationType"/>
+	    <element name="Faulted" type="wsarjtx:NotificationType"/>
+	    <element name="Fault" type="wsarjtx:ExceptionType"/>
+	  </schema>
+        </wsdl:types> 
+	<!-- Messages -->
+	<wsdl:message name="CompleteMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Complete"/>
+	</wsdl:message>
+	<wsdl:message name="CloseMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Close"/>
+	</wsdl:message>
+	<wsdl:message name="CancelMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Cancel"/>
+	</wsdl:message>
+	<wsdl:message name="CompletedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Completed"/>
+	</wsdl:message>
+	<wsdl:message name="ClosedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Closed"/>
+	</wsdl:message>
+	<wsdl:message name="CancelledMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Cancelled"/>
+	</wsdl:message>
+	<wsdl:message name="FaultedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Faulted"/>
+	</wsdl:message>
+	<wsdl:message name="FaultMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Fault"/>
+	</wsdl:message>
+	<!-- Asynchronous Messaging PortTypes -->
+	<wsdl:portType name="TerminationCoordinatorPortType">
+		<wsdl:operation name="CompleteOperation">
+			<wsdl:input message="wsarjtx:CompleteMessage" name="Complete"/>
+		</wsdl:operation>
+		<wsdl:operation name="CloseOperation">
+			<wsdl:input message="wsarjtx:CloseMessage" name="Close"/>
+		</wsdl:operation>
+		<wsdl:operation name="CancelOperation">
+			<wsdl:input message="wsarjtx:CancelMessage" name="Cancel"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="TerminationParticipantPortType">
+		<wsdl:operation name="CompletedOperation">
+			<wsdl:input message="wsarjtx:CompletedMessage" name="Completed"/>
+		</wsdl:operation>
+		<wsdl:operation name="ClosedOperation">
+			<wsdl:input message="wsarjtx:ClosedMessage" name="Closed"/>
+		</wsdl:operation>
+		<wsdl:operation name="CancelledOperation">
+			<wsdl:input message="wsarjtx:CancelledMessage" name="Cancelled"/>
+		</wsdl:operation>
+		<wsdl:operation name="FaultedOperation">
+			<wsdl:input message="wsarjtx:FaultedMessage" name="Faulted"/>
+		</wsdl:operation>
+		<wsdl:operation name="FaultOperation">
+			<wsdl:input message="wsarjtx:FaultMessage" name="Fault"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<!-- SOAP bindings for ports -->
+	<wsdl:binding name="TerminationCoordinator_SOAPBinding" type="wsarjtx:TerminationCoordinatorPortType">
+	        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<wsdl:operation name="CompleteOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Complete" style="document"/>
+		    <wsdl:input name="Complete">
+		        <soap:body use="literal"/>
+		    </wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="CloseOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close" style="document"/>
+			<wsdl:input name="Close">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="CancelOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancel" style="document"/>
+			<wsdl:input name="Cancel">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+	</wsdl:binding>
+
+	<wsdl:binding name="TerminationParticipant_SOAPBinding" type="wsarjtx:TerminationParticipantPortType">
+	        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<wsdl:operation name="CompletedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Completed" style="document"/>
+		    <wsdl:input name="Completed">
+		        <soap:body use="literal"/>
+		    </wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="ClosedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Closed" style="document"/>
+			<wsdl:input name="Closed">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="CancelledOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancelled" style="document"/>
+			<wsdl:input name="Cancelled">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="FaultedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted" style="document"/>
+			<wsdl:input name="Faulted">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="FaultOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Fault" style="document"/>
+			<wsdl:input name="Fault">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+	</wsdl:binding>
+	<!-- SOAP Service definition -->
+	<wsdl:service name="Termination_SOAPService">
+	    <wsdl:port binding="wsarjtx:TerminationCoordinator_SOAPBinding" name="TerminationCoordinator_SoapPort">
+                <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+	    </wsdl:port>
+
+	    <wsdl:port binding="wsarjtx:TerminationParticipant_SOAPBinding" name="TerminationParticipant_SoapPort">
+                <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+	    </wsdl:port>
+	</wsdl:service>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-coordinator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2007 JBoss -->
+<wsdl:definitions name="WSARJTX-COORDINATOR-BINDING"
+		  targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+		  xmlns="http://schemas.xmlsoap.org/wsdl/" 
+		  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		  xmlns:wsarjtx="http://schemas.arjuna.com/ws/2005/10/wsarjtx">
+    <wsdl:import
+        namespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+        location="wsarjtx.wsdl" />
+
+	<!-- SOAP bindings for termination coordinator port -->
+	<wsdl:binding name="TerminationCoordinator_SOAPBinding" type="wsarjtx:TerminationCoordinatorPortType">
+	        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<wsdl:operation name="CompleteOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Complete" style="document"/>
+		    <wsdl:input name="Complete">
+		        <soap:body use="literal"/>
+		    </wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="CloseOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close" style="document"/>
+			<wsdl:input name="Close">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="CancelOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancel" style="document"/>
+			<wsdl:input name="Cancel">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+	</wsdl:binding>
+
+	<!-- termination coordinator service definition -->
+	<wsdl:service name="TerminationCoordinatorService">
+	    <wsdl:port binding="wsarjtx:TerminationCoordinator_SOAPBinding" name="TerminationCoordinatorPortType">
+                <soap:address location="http://localhost:9000/wst11/TerminationCoordinatorService"/>
+	    </wsdl:port>
+	</wsdl:service>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx-termination-participant-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2007 JBoss -->
+<wsdl:definitions name="WSARJTX"
+		  targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+		  xmlns="http://schemas.xmlsoap.org/wsdl/" 
+		  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		  xmlns:wsarjtx="http://schemas.arjuna.com/ws/2005/10/wsarjtx">
+    <wsdl:import
+        namespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+        location="wsarjtx.wsdl" />
+
+	<!-- SOAP bindings for termination participant port -->
+	<wsdl:binding name="TerminationParticipant_SOAPBinding" type="wsarjtx:TerminationParticipantPortType">
+	        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+		<wsdl:operation name="CompletedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Completed" style="document"/>
+		    <wsdl:input name="Completed">
+		        <soap:body use="literal"/>
+		    </wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="ClosedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Closed" style="document"/>
+			<wsdl:input name="Closed">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="CancelledOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancelled" style="document"/>
+			<wsdl:input name="Cancelled">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="FaultedOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted" style="document"/>
+			<wsdl:input name="Faulted">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+
+		<wsdl:operation name="FaultOperation">
+		    <soap:operation soapAction="http://schemas.arjuna.com/ws/2005/10/wsarjtx/Fault" style="document"/>
+			<wsdl:input name="Fault">
+		            <soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+	</wsdl:binding>
+	<!-- termination participant service definition -->
+	<wsdl:service name="TerminationParticipantService">
+	    <wsdl:port binding="wsarjtx:TerminationParticipant_SOAPBinding" name="TerminationParticipantPortType">
+                <soap:address location="http://localhost:9000/wst11/TerminationParticipantService"/>
+	    </wsdl:port>
+	</wsdl:service>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wsarjtx/wsdl/wsarjtx.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2007 JBoss -->
+<wsdl:definitions name="WSARJTX"
+		  targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx"
+		  xmlns="http://schemas.xmlsoap.org/wsdl/" 
+		  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+		  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+		  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+		  xmlns:wsarjtx="http://schemas.arjuna.com/ws/2005/10/wsarjtx">
+        <wsdl:types>
+	  <schema targetNamespace="http://schemas.arjuna.com/ws/2005/10/wsarjtx" 
+		  xmlns="http://www.w3.org/2001/XMLSchema"
+		  elementFormDefault="qualified">
+	    <complexType name="NotificationType">
+		<sequence>
+		    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+	    </complexType>
+	    <complexType name="ExceptionType">
+		<sequence>
+		    <element name="soapFaultType" type="string"/>
+		    <element name="subCode" type="QName"/>
+		    <element name="reason" type="string"/>
+		    <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</sequence>
+		<anyAttribute namespace="##other" processContents="lax"/>
+	    </complexType>
+	    <!-- Coordinator accepts -->
+	    <element name="Complete" type="wsarjtx:NotificationType"/>
+	    <element name="Close" type="wsarjtx:NotificationType"/>
+	    <element name="Cancel" type="wsarjtx:NotificationType"/>
+	    <!-- Participant accepts -->
+	    <element name="Completed" type="wsarjtx:NotificationType"/>
+	    <element name="Closed" type="wsarjtx:NotificationType"/>
+	    <element name="Cancelled" type="wsarjtx:NotificationType"/>
+	    <element name="Faulted" type="wsarjtx:NotificationType"/>
+	    <element name="Fault" type="wsarjtx:ExceptionType"/>
+	  </schema>
+        </wsdl:types> 
+	<!-- Messages -->
+	<wsdl:message name="CompleteMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Complete"/>
+	</wsdl:message>
+	<wsdl:message name="CloseMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Close"/>
+	</wsdl:message>
+	<wsdl:message name="CancelMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Cancel"/>
+	</wsdl:message>
+	<wsdl:message name="CompletedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Completed"/>
+	</wsdl:message>
+	<wsdl:message name="ClosedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Closed"/>
+	</wsdl:message>
+	<wsdl:message name="CancelledMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Cancelled"/>
+	</wsdl:message>
+	<wsdl:message name="FaultedMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Faulted"/>
+	</wsdl:message>
+	<wsdl:message name="FaultMessage">
+		<wsdl:part name="parameters" element="wsarjtx:Fault"/>
+	</wsdl:message>
+	<!-- Asynchronous Messaging PortTypes -->
+	<wsdl:portType name="TerminationCoordinatorPortType">
+		<wsdl:operation name="CompleteOperation">
+			<wsdl:input message="wsarjtx:CompleteMessage" name="Complete"/>
+		</wsdl:operation>
+		<wsdl:operation name="CloseOperation">
+			<wsdl:input message="wsarjtx:CloseMessage" name="Close"/>
+		</wsdl:operation>
+		<wsdl:operation name="CancelOperation">
+			<wsdl:input message="wsarjtx:CancelMessage" name="Cancel"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="TerminationParticipantPortType">
+		<wsdl:operation name="CompletedOperation">
+			<wsdl:input message="wsarjtx:CompletedMessage" name="Completed"/>
+		</wsdl:operation>
+		<wsdl:operation name="ClosedOperation">
+			<wsdl:input message="wsarjtx:ClosedMessage" name="Closed"/>
+		</wsdl:operation>
+		<wsdl:operation name="CancelledOperation">
+			<wsdl:input message="wsarjtx:CancelledMessage" name="Cancelled"/>
+		</wsdl:operation>
+		<wsdl:operation name="FaultedOperation">
+			<wsdl:input message="wsarjtx:FaultedMessage" name="Faulted"/>
+		</wsdl:operation>
+		<wsdl:operation name="FaultOperation">
+			<wsdl:input message="wsarjtx:FaultMessage" name="Fault"/>
+		</wsdl:operation>
+	</wsdl:portType>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/build.sh
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/build.sh	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/build.sh	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,65 @@
+#
+#
+#
+
+if [ ! -d tmp ] ; then
+    mkdir tmp
+fi
+
+if [ ! -d tmp/classes ] ; then
+    mkdir tmp/classes
+fi
+
+if [ ! -d tmp/src ] ; then
+    mkdir tmp/src
+fi
+
+# delete old generated versions -- any changes should be made to a copy!
+
+rm -rf tmp/classes/* tmp/src/*
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /wsdl/wsat.wsdl -o tmp/classes -s tmp/src -k wsdl/wsat-binding.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /wsdl/wsba.wsdl -o tmp/classes -s tmp/src -k wsdl/wsba-binding.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /home/adinn/tmp/wsdl/wsat.wsdl -o tmp/classes -s tmp/src -k wsdl/wsat-binding.wsdl
+
+# $JBOSS_HOME/bin/wsconsume.sh -v -k -w /home/adinn/tmp/wsdl/wsba.wsdl -o tmp/classes -s tmp/src -k wsdl/wsba-binding.wsdl
+
+# first the at services
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsat-completion-coordinator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsat-completion-coordinator-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsat-completion-initiator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsat-completion-initiator-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsat-coordinator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsat-coordinator-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsat-participant-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsat-participant-binding.wsdl
+
+# now the ba services
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsba-coordinator-completion-coordinator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsba-coordinator-completion-coordinator-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsba-coordinator-completion-participant-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsba-coordinator-completion-participant-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsba-participant-completion-coordinator-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsba-participant-completion-coordinator-binding.wsdl
+
+$GF_HOME/bin/wsimport -verbose -keep -wsdllocation wsdl/wsba-participant-completion-participant-binding.wsdl -d tmp/classes -s tmp/src -target 2.0 wsdl/wsba-participant-completion-participant-binding.wsdl
+
+# we need to patch the resource lookup used to provide a jar base URL
+# for the wsdl location supplied above wsimport generates
+# e.g. 'qualified.path.ClassName.class.getResource(".")' to locate a
+# URL for the jar dir containing ClassName.class. But the EJB class
+# loader returns null for this (even though it returns true for
+# hasEntry!). If we patch the generated code to specify
+# 'qualified.path.ClassName.class.getResource("")' it works ok.
+
+sed -i -e 's/CoordinatorService.class.getResource(".")/CoordinatorService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorService.java
+sed -i -e 's/ParticipantService.class.getResource(".")/ParticipantService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantService.java
+sed -i -e 's/CompletionInitiatorService.class.getResource(".")/CompletionInitiatorService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorService.java
+sed -i -e 's/CompletionCoordinatorService.class.getResource(".")/CompletionCoordinatorService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorService.java
+
+sed -i -e 's/BusinessAgreementWithCoordinatorCompletionCoordinatorService.class.getResource(".")/BusinessAgreementWithCoordinatorCompletionCoordinatorService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorService.java
+sed -i -e 's/BusinessAgreementWithCoordinatorCompletionParticipantService.class.getResource(".")/BusinessAgreementWithCoordinatorCompletionParticipantService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantService.java
+sed -i -e 's/BusinessAgreementWithParticipantCompletionCoordinatorService.class.getResource(".")/BusinessAgreementWithParticipantCompletionCoordinatorService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorService.java
+sed -i -e 's/BusinessAgreementWithParticipantCompletionParticipantService.class.getResource(".")/BusinessAgreementWithParticipantCompletionParticipantService.class.getResource("")/' tmp/src/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantService.java

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.wsdl" />
+
+  <wsdl:binding name="CompletionCoordinator_SOAPBinding" type="wsat:CompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CommitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit" style="document"/>
+      <wsdl:input name="wsat:Commit">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="RollbackOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback" style="document"/>
+      <wsdl:input name="wsat:Rollback">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="CompletionInitiator_SOAPBinding" type="wsat:CompletionInitiatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CommittedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed" style="document"/>
+      <wsdl:input name="wsat:Committed">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="AbortedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted" style="document"/>
+      <wsdl:input name="wsat:Aborted">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="Coordinator_SOAPBinding" type="wsat:CoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="PreparedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared" style="document"/>
+      <wsdl:input name="wsat:Prepared">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="AbortedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted" style="document"/>
+      <wsdl:input name="wsat:Aborted">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ReadOnlyOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly" style="document"/>
+      <wsdl:input name="wsat:ReadOnly">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CommittedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed" style="document"/>
+      <wsdl:input name="wsat:Committed">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="Participant_SOAPBinding" type="wsat:ParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="PrepareOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepare" style="document"/>
+      <wsdl:input name="wsat:Prepare">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CommitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit" style="document"/>
+      <wsdl:input name="wsat:Commit">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="RollbackOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback" style="document"/>
+      <wsdl:input name="wsat:Rollback">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="WSAT_SOAPService">
+    <wsdl:port binding="wsat:CompletionCoordinator_SOAPBinding" name="CompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSAT/CompletionCoordinatorSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsat:CompletionInitiator_SOAPBinding" name="CompletionInitiatorPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSAT/CompletionInitiatorSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatorPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSAT/CoordinatorSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsat:Participant_SOAPBinding" name="ParticipantPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSAT/ParticipantSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-coordinator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.wsdl" />
+
+  <wsdl:binding name="CompletionCoordinator_SOAPBinding" type="wsat:CompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CommitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit" style="document"/>
+      <wsdl:input message="wsat:Commit">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="RollbackOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback" style="document"/>
+      <wsdl:input message="wsat:Rollback">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="CompletionCoordinatorService">
+    <wsdl:port binding="wsat:CompletionCoordinator_SOAPBinding" name="CompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/wst11/CompletionCoordinatorService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-completion-initiator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.wsdl" />
+
+  <wsdl:binding name="CompletionInitiator_SOAPBinding" type="wsat:CompletionInitiatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CommittedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed" style="document"/>
+      <wsdl:input message="wsat:Committed">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="AbortedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted" style="document"/>
+      <wsdl:input message="wsat:Aborted">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="CompletionInitiatorService">
+    <wsdl:port binding="wsat:CompletionInitiator_SOAPBinding" name="CompletionInitiatorPortType">
+      <soap:address location="http://localhost:9000/wst11/CompletionInitiatorService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-coordinator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.wsdl" />
+
+  <wsdl:binding name="Coordinator_SOAPBinding" type="wsat:CoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="PreparedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared" style="document"/>
+      <wsdl:input message="wsat:Prepared">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="AbortedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted" style="document"/>
+      <wsdl:input message="wsat:Aborted">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ReadOnlyOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly" style="document"/>
+      <wsdl:input message="wsat:ReadOnly">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CommittedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed" style="document"/>
+      <wsdl:input message="wsat:Committed">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="CoordinatorService">
+    <wsdl:port binding="wsat:Coordinator_SOAPBinding" name="CoordinatorPortType">
+      <soap:address location="http://localhost:9000/wst11/CoordinatorService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-participant-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-participant-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat-participant-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.wsdl" />
+
+  <wsdl:binding name="Participant_SOAPBinding" type="wsat:ParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="PrepareOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepare" style="document"/>
+      <wsdl:input message="wsat:Prepare">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CommitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit" style="document"/>
+      <wsdl:input message="wsat:Commit">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="RollbackOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback" style="document"/>
+      <wsdl:input message="wsat:Rollback">
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="ParticipantService">
+    <wsdl:port binding="wsat:Participant_SOAPBinding" name="ParticipantPortType">
+      <soap:address location="http://localhost:9000/wst11/ParticipantService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsat.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS President.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS President.
+Copyright OASIS Open 2006. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself must not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:wsa="http://www.w3.org/2005/08/addressing" targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06">
+    <wsdl:types>
+        <xs:schema>
+            <xs:import
+                namespace="http://www.w3.org/2005/08/addressing"
+                schemaLocation="http://www.w3.org/2006/03/addressing/ws-addr.xsd" />
+            <xs:import
+                namespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06"
+                schemaLocation="http://docs.oasis-open.org/ws-tx/wsat/2006/06/wsat.xsd" />
+        </xs:schema>
+    </wsdl:types>
+    <!-- Messages -->
+    <wsdl:message name="Prepare">
+        <wsdl:part name="parameters" element="wsat:Prepare"/>
+    </wsdl:message>
+    <wsdl:message name="Prepared">
+        <wsdl:part name="parameters" element="wsat:Prepared"/>
+    </wsdl:message>
+    <wsdl:message name="Aborted">
+        <wsdl:part name="parameters" element="wsat:Aborted"/>
+    </wsdl:message>
+    <wsdl:message name="ReadOnly">
+        <wsdl:part name="parameters" element="wsat:ReadOnly"/>
+    </wsdl:message>
+    <wsdl:message name="Commit">
+        <wsdl:part name="parameters" element="wsat:Commit"/>
+    </wsdl:message>
+    <wsdl:message name="Rollback">
+        <wsdl:part name="parameters" element="wsat:Rollback"/>
+    </wsdl:message>
+    <wsdl:message name="Committed">
+        <wsdl:part name="parameters" element="wsat:Committed"/>
+    </wsdl:message>
+    <!-- Port Types -->
+    <wsdl:portType name="CompletionCoordinatorPortType">
+        <wsdl:operation name="CommitOperation">
+            <wsdl:input message="wsat:Commit"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit"/>
+        </wsdl:operation>
+        <wsdl:operation name="RollbackOperation">
+            <wsdl:input message="wsat:Rollback"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="CompletionInitiatorPortType">
+        <wsdl:operation name="CommittedOperation">
+            <wsdl:input message="wsat:Committed"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed"/>
+        </wsdl:operation>
+        <wsdl:operation name="AbortedOperation">
+            <wsdl:input message="wsat:Aborted"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="CoordinatorPortType">
+        <wsdl:operation name="PreparedOperation">
+            <wsdl:input message="wsat:Prepared"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared"/>
+        </wsdl:operation>
+        <wsdl:operation name="AbortedOperation">
+            <wsdl:input message="wsat:Aborted"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted"/>
+        </wsdl:operation>
+        <wsdl:operation name="ReadOnlyOperation">
+            <wsdl:input message="wsat:ReadOnly"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly"/>
+        </wsdl:operation>
+        <wsdl:operation name="CommittedOperation">
+            <wsdl:input message="wsat:Committed"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed"/>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:portType name="ParticipantPortType">
+        <wsdl:operation name="PrepareOperation">
+            <wsdl:input message="wsat:Prepare"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepare"/>
+        </wsdl:operation>
+        <wsdl:operation name="CommitOperation">
+            <wsdl:input message="wsat:Commit"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit"/>
+        </wsdl:operation>
+        <wsdl:operation name="RollbackOperation">
+            <wsdl:input message="wsat:Rollback"
+              wsa:Action="http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback"/>
+        </wsdl:operation>
+    </wsdl:portType>
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.wsdl" />
+
+  <wsdl:binding name="BusinessAgreementWithParticipantCompletionCoordinator_SOAPBinding" type="wsba:BusinessAgreementWithParticipantCompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompletedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed" style="document"/>
+      <wsdl:input name="wsba:Completed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail" style="document"/>
+      <wsdl:input name="wsba:Fail">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensatedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated" style="document"/>
+      <wsdl:input name="wsba:Compensated">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ClosedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed" style="document"/>
+      <wsdl:input name="wsba:Closed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CanceledOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled" style="document"/>
+      <wsdl:input name="wsba:Canceled">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit" style="document"/>
+      <wsdl:input name="wsba:Exit">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CannotComplete">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete" style="document"/>
+      <wsdl:input name="wsba:CannotComplete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+    
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input name="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input name="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="BusinessAgreementWithParticipantCompletionParticipant_SOAPBinding" type="wsba:BusinessAgreementWithParticipantCompletionParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CloseOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input name="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CancelOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel" style="document"/>
+      <wsdl:input name="wsba:Cancel">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensateOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensate" style="document"/>
+      <wsdl:input name="wsba:Compensate">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed" style="document"/>
+      <wsdl:input name="wsba:Failed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited" style="document"/>
+      <wsdl:input name="wsba:Exited">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="NotCompleted">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted" style="document"/>
+      <wsdl:input name="wsba:NotCompleted">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input name="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input name="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="BusinessAgreementWithCoordinatorCompletionCoordinator_SOAPBinding" type="wsba:BusinessAgreementWithCoordinatorCompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompletedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed" style="document"/>
+      <wsdl:input name="wsba:Completed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail" style="document"/>
+      <wsdl:input name="wsba:Fail">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensatedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated" style="document"/>
+      <wsdl:input name="wsba:Compensated">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ClosedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed" style="document"/>
+      <wsdl:input name="wsba:Closed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CanceledOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled" style="document"/>
+      <wsdl:input name="wsba:Canceled">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit" style="document"/>
+      <wsdl:input name="wsba:Exit">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CannotComplete">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete" style="document"/>
+      <wsdl:input name="wsba:CannotComplete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input name="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input name="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:binding name="BusinessAgreementWithCoordinatorCompletionParticipant_SOAPBinding" type="wsba:BusinessAgreementWithCoordinatorCompletionParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompleteOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/mplete" style="document"/>
+      <wsdl:input name="wsba:Complete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CloseOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input name="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CancelOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel" style="document"/>
+      <wsdl:input name="wsba:Cancel">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensateOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input name="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed" style="document"/>
+      <wsdl:input name="wsba:Failed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited" style="document"/>
+      <wsdl:input name="wsba:Exited">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="NotCompleted">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted" style="document"/>
+      <wsdl:input name="wsba:NotCompleted">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input name="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input name="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="WSBA_SOAPService">
+    <wsdl:port binding="wsba:BusinessAgreementWithParticipantCompletionCoordinator_SOAPBinding" name="BusinessAgreementWithParticipantCompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSBA/BusinessAgreementWithParticipantCompletionCoordinatorSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsba:BusinessAgreementWithParticipantCompletionParticipant_SOAPBinding" name="BusinessAgreementWithParticipantCompletionParticipantPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSBA/BusinessAgreementWithParticipantCompletionParticipantSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsba:BusinessAgreementWithCoordinatorCompletionCoordinator_SOAPBinding" name="BusinessAgreementWithCoordinatorCompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSBA/BusinessAgreementWithCoordinatorCompletionCoordinatorSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+
+    <wsdl:port binding="wsba:BusinessAgreementWithCoordinatorCompletionParticipant_SOAPBinding" name="BusinessAgreementWithCoordinatorCompletionParticipantPortType">
+      <soap:address location="http://localhost:9000/SoapContext/WSBA/BusinessAgreementWithCoordinatorCompletionParticipantSoapPort"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.wsdl" />
+
+  <wsdl:binding name="BusinessAgreementWithCoordinatorCompletionCoordinator_SOAPBinding" type="wsba:BusinessAgreementWithCoordinatorCompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompletedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed" style="document"/>
+      <wsdl:input message="wsba:Completed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail" style="document"/>
+      <wsdl:input message="wsba:Fail">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensatedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated" style="document"/>
+      <wsdl:input message="wsba:Compensated">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ClosedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed" style="document"/>
+      <wsdl:input message="wsba:Closed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CanceledOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled" style="document"/>
+      <wsdl:input message="wsba:Canceled">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit" style="document"/>
+      <wsdl:input message="wsba:Exit">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CannotComplete">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete" style="document"/>
+      <wsdl:input message="wsba:CannotComplete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input message="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input message="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="BusinessAgreementWithCoordinatorCompletionCoordinatorService">
+    <wsdl:port binding="wsba:BusinessAgreementWithCoordinatorCompletionCoordinator_SOAPBinding" name="BusinessAgreementWithCoordinatorCompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/wst11/BusinessAgreementWithCoordinatorCompletionCoordinatorService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-coordinator-completion-participant-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.wsdl" />
+
+  <wsdl:binding name="BusinessAgreementWithCoordinatorCompletionParticipant_SOAPBinding" type="wsba:BusinessAgreementWithCoordinatorCompletionParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompleteOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/mplete" style="document"/>
+      <wsdl:input message="wsba:Complete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CloseOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input message="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CancelOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel" style="document"/>
+      <wsdl:input message="wsba:Cancel">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensateOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input message="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed" style="document"/>
+      <wsdl:input message="wsba:Failed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited" style="document"/>
+      <wsdl:input message="wsba:Exited">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="NotCompleted">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted" style="document"/>
+      <wsdl:input message="wsba:NotCompleted">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input message="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input message="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="BusinessAgreementWithCoordinatorCompletionParticipantService">
+    <wsdl:port binding="wsba:BusinessAgreementWithCoordinatorCompletionParticipant_SOAPBinding" name="BusinessAgreementWithCoordinatorCompletionParticipantPortType">
+      <soap:address location="http://localhost:9000/wst11/BusinessAgreementWithCoordinatorCompletionParticipantService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-coordinator-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.wsdl" />
+
+  <wsdl:binding name="BusinessAgreementWithParticipantCompletionCoordinator_SOAPBinding" type="wsba:BusinessAgreementWithParticipantCompletionCoordinatorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CompletedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed" style="document"/>
+      <wsdl:input message="wsba:Completed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail" style="document"/>
+      <wsdl:input message="wsba:Fail">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensatedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated" style="document"/>
+      <wsdl:input message="wsba:Compensated">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ClosedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed" style="document"/>
+      <wsdl:input message="wsba:Closed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CanceledOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled" style="document"/>
+      <wsdl:input message="wsba:Canceled">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit" style="document"/>
+      <wsdl:input message="wsba:Exit">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CannotComplete">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete" style="document"/>
+      <wsdl:input message="wsba:CannotComplete">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+    
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input message="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input message="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="BusinessAgreementWithParticipantCompletionCoordinatorService">
+    <wsdl:port binding="wsba:BusinessAgreementWithParticipantCompletionCoordinator_SOAPBinding" name="BusinessAgreementWithParticipantCompletionCoordinatorPortType">
+      <soap:address location="http://localhost:9000/wst11/BusinessAgreementWithParticipantCompletionCoordinatorService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba-participant-completion-participant-binding.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsaw="http://www.w3.org/2006/02/addressing/wsdl">
+
+  <wsdl:import
+      namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06"
+      location="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.wsdl" />
+
+  <wsdl:binding name="BusinessAgreementWithParticipantCompletionParticipant_SOAPBinding" type="wsba:BusinessAgreementWithParticipantCompletionParticipantPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="CloseOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close" style="document"/>
+      <wsdl:input message="wsba:Close">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CancelOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel" style="document"/>
+      <wsdl:input message="wsba:Cancel">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="CompensateOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensate" style="document"/>
+      <wsdl:input message="wsba:Compensate">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="FailedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed" style="document"/>
+      <wsdl:input message="wsba:Failed">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="ExitedOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited" style="document"/>
+      <wsdl:input message="wsba:Exited">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="NotCompleted">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted" style="document"/>
+      <wsdl:input message="wsba:NotCompleted">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="GetStatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus" style="document"/>
+      <wsdl:input message="wsba:GetStatus">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+
+    <wsdl:operation name="StatusOperation">
+      <soap:operation soapAction="http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status" style="document"/>
+      <wsdl:input message="wsba:Status">
+	<soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+  </wsdl:binding>
+
+  <wsdl:service name="BusinessAgreementWithParticipantCompletionParticipantService">
+    <wsdl:port binding="wsba:BusinessAgreementWithParticipantCompletionParticipant_SOAPBinding" name="BusinessAgreementWithParticipantCompletionParticipantPortType">
+      <soap:address location="http://localhost:9000/wst11/BusinessAgreementWithParticipantCompletionParticipantService"/>
+       <wsaw:UsingAddressing required="true"/>
+    </wsdl:port>
+  </wsdl:service>
+
+</wsdl:definitions>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba.wsdl
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba.wsdl	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/wsdl/wsba.wsdl	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright OASIS Open 2006. All Rights Reserved. -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06">
+  <wsdl:types>
+    <xs:schema>
+      <xs:import namespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" schemaLocation="http://docs.oasis-open.org/ws-tx/wsba/2006/06/wsba.xsd"/>
+    </xs:schema>
+  </wsdl:types>
+  <!-- Messages -->
+  <wsdl:message name="Complete">
+    <wsdl:part name="parameters" element="wsba:Complete"/>
+  </wsdl:message>
+  <wsdl:message name="Completed">
+    <wsdl:part name="parameters" element="wsba:Completed"/>
+  </wsdl:message>
+  <wsdl:message name="Close">
+    <wsdl:part name="parameters" element="wsba:Close"/>
+  </wsdl:message>
+  <wsdl:message name="Closed">
+    <wsdl:part name="parameters" element="wsba:Closed"/>
+  </wsdl:message>
+  <wsdl:message name="Cancel">
+    <wsdl:part name="parameters" element="wsba:Cancel"/>
+  </wsdl:message>
+  <wsdl:message name="Canceled">
+    <wsdl:part name="parameters" element="wsba:Canceled"/>
+  </wsdl:message>
+  <wsdl:message name="Compensate">
+    <wsdl:part name="parameters" element="wsba:Compensate"/>
+  </wsdl:message>
+  <wsdl:message name="Compensated">
+    <wsdl:part name="parameters" element="wsba:Compensated"/>
+  </wsdl:message>
+  <wsdl:message name="Fail">
+    <wsdl:part name="parameters" element="wsba:Fail"/>
+  </wsdl:message>
+  <wsdl:message name="Failed">
+    <wsdl:part name="parameters" element="wsba:Failed"/>
+  </wsdl:message>
+  <wsdl:message name="Exit">
+    <wsdl:part name="parameters" element="wsba:Exit"/>
+  </wsdl:message>
+  <wsdl:message name="Exited">
+    <wsdl:part name="parameters" element="wsba:Exited"/>
+  </wsdl:message>
+  <wsdl:message name="CannotComplete">
+    <wsdl:part name="parameters" element="wsba:CannotComplete"/>
+  </wsdl:message>
+  <wsdl:message name="NotCompleted">
+    <wsdl:part name="parameters" element="wsba:NotCompleted"/>
+  </wsdl:message>
+  <wsdl:message name="GetStatus">
+    <wsdl:part name="parameters" element="wsba:GetStatus"/>
+  </wsdl:message>
+  <wsdl:message name="Status">
+    <wsdl:part name="parameters" element="wsba:Status"/>
+  </wsdl:message>
+  <!-- BusinessAgreement Service -->
+  <wsdl:portType name="BusinessAgreementWithParticipantCompletionCoordinatorPortType">
+    <wsdl:operation name="CompletedOperation">
+      <wsdl:input message="wsba:Completed"/>
+    </wsdl:operation>
+    <wsdl:operation name="FailOperation">
+      <wsdl:input message="wsba:Fail"/>
+    </wsdl:operation>
+    <wsdl:operation name="CompensatedOperation">
+      <wsdl:input message="wsba:Compensated"/>
+    </wsdl:operation>
+    <wsdl:operation name="ClosedOperation">
+      <wsdl:input message="wsba:Closed"/>
+    </wsdl:operation>
+    <wsdl:operation name="CanceledOperation">
+      <wsdl:input message="wsba:Canceled"/>
+    </wsdl:operation>
+    <wsdl:operation name="ExitOperation">
+      <wsdl:input message="wsba:Exit"/>
+    </wsdl:operation>
+    <wsdl:operation name="CannotComplete">
+      <wsdl:input message="wsba:CannotComplete"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetStatusOperation">
+      <wsdl:input message="wsba:GetStatus"/>
+    </wsdl:operation>
+    <wsdl:operation name="StatusOperation">
+      <wsdl:input message="wsba:Status"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="BusinessAgreementWithParticipantCompletionParticipantPortType">
+    <wsdl:operation name="CloseOperation">
+      <wsdl:input message="wsba:Close"/>
+    </wsdl:operation>
+    <wsdl:operation name="CancelOperation">
+      <wsdl:input message="wsba:Cancel"/>
+    </wsdl:operation>
+    <wsdl:operation name="CompensateOperation">
+      <wsdl:input message="wsba:Compensate"/>
+    </wsdl:operation>
+    <wsdl:operation name="FailedOperation">
+      <wsdl:input message="wsba:Failed"/>
+    </wsdl:operation>
+    <wsdl:operation name="ExitedOperation">
+      <wsdl:input message="wsba:Exited"/>
+    </wsdl:operation>
+    <wsdl:operation name="NotCompleted">
+      <wsdl:input message="wsba:NotCompleted"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetStatusOperation">
+      <wsdl:input message="wsba:GetStatus"/>
+    </wsdl:operation>
+    <wsdl:operation name="StatusOperation">
+      <wsdl:input message="wsba:Status"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <!-- BusinessAgreementWithComplete Service -->
+  <wsdl:portType name="BusinessAgreementWithCoordinatorCompletionCoordinatorPortType">
+    <wsdl:operation name="CompletedOperation">
+      <wsdl:input message="wsba:Completed"/>
+    </wsdl:operation>
+    <wsdl:operation name="FailOperation">
+      <wsdl:input message="wsba:Fail"/>
+    </wsdl:operation>
+    <wsdl:operation name="CompensatedOperation">
+      <wsdl:input message="wsba:Compensated"/>
+    </wsdl:operation>
+    <wsdl:operation name="ClosedOperation">
+      <wsdl:input message="wsba:Closed"/>
+    </wsdl:operation>
+    <wsdl:operation name="CanceledOperation">
+      <wsdl:input message="wsba:Canceled"/>
+    </wsdl:operation>
+    <wsdl:operation name="ExitOperation">
+      <wsdl:input message="wsba:Exit"/>
+    </wsdl:operation>
+    <wsdl:operation name="CannotComplete">
+      <wsdl:input message="wsba:CannotComplete"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetStatusOperation">
+      <wsdl:input message="wsba:GetStatus"/>
+    </wsdl:operation>
+    <wsdl:operation name="StatusOperation">
+      <wsdl:input message="wsba:Status"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="BusinessAgreementWithCoordinatorCompletionParticipantPortType">
+    <wsdl:operation name="CompleteOperation">
+      <wsdl:input message="wsba:Complete"/>
+    </wsdl:operation>
+    <wsdl:operation name="CloseOperation">
+      <wsdl:input message="wsba:Close"/>
+    </wsdl:operation>
+    <wsdl:operation name="CancelOperation">
+      <wsdl:input message="wsba:Cancel"/>
+    </wsdl:operation>
+    <wsdl:operation name="CompensateOperation">
+      <wsdl:input message="wsba:Compensate"/>
+    </wsdl:operation>
+    <wsdl:operation name="FailedOperation">
+      <wsdl:input message="wsba:Failed"/>
+    </wsdl:operation>
+    <wsdl:operation name="ExitedOperation">
+      <wsdl:input message="wsba:Exited"/>
+    </wsdl:operation>
+    <wsdl:operation name="NotCompleted">
+      <wsdl:input message="wsba:NotCompleted"/>
+    </wsdl:operation>
+    <wsdl:operation name="GetStatusOperation">
+      <wsdl:input message="wsba:GetStatus"/>
+    </wsdl:operation>
+    <wsdl:operation name="StatusOperation">
+      <wsdl:input message="wsba:Status"/>
+    </wsdl:operation>
+  </wsdl:portType>
+</wsdl:definitions>
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/ws-addr.xsd
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/ws-addr.xsd	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/ws-addr.xsd	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
+<!--
+    W3C XML Schema defined in the Web Services Addressing 1.0 specification
+    http://www.w3.org/TR/ws-addr-core
+
+   Copyright © 2005 World Wide Web Consortium,
+
+   (Massachusetts Institute of Technology, European Research Consortium for
+   Informatics and Mathematics, Keio University). All Rights Reserved. This
+   work is distributed under the W3C® Software License [1] in the hope that
+   it will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+   [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+   $Id: ws-addr.xsd,v 1.1 2006/03/21 10:19:47 hugo Exp $
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.w3.org/2005/08/addressing" targetNamespace="http://www.w3.org/2005/08/addressing" blockDefault="#all" elementFormDefault="qualified" finalDefault="" attributeFormDefault="unqualified">
+	
+	<!-- Constructs from the WS-Addressing Core -->
+
+	<xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
+	<xs:complexType name="EndpointReferenceType" mixed="false">
+		<xs:sequence>
+			<xs:element name="Address" type="tns:AttributedURIType"/>
+			<xs:element ref="tns:ReferenceParameters" minOccurs="0"/>
+
+			<xs:element ref="tns:Metadata" minOccurs="0"/>
+			<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+	<xs:element name="ReferenceParameters" type="tns:ReferenceParametersType"/>
+	<xs:complexType name="ReferenceParametersType" mixed="false">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+	<xs:element name="Metadata" type="tns:MetadataType"/>
+	<xs:complexType name="MetadataType" mixed="false">
+		<xs:sequence>
+			<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+
+	</xs:complexType>
+	
+	<xs:element name="MessageID" type="tns:AttributedURIType"/>
+	<xs:element name="RelatesTo" type="tns:RelatesToType"/>
+	<xs:complexType name="RelatesToType" mixed="false">
+		<xs:simpleContent>
+			<xs:extension base="xs:anyURI">
+				<xs:attribute name="RelationshipType" type="tns:RelationshipTypeOpenEnum" use="optional" default="http://www.w3.org/2005/08/addressing/reply"/>
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:simpleType name="RelationshipTypeOpenEnum">
+		<xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
+	</xs:simpleType>
+	
+	<xs:simpleType name="RelationshipType">
+		<xs:restriction base="xs:anyURI">
+			<xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
+		</xs:restriction>
+
+	</xs:simpleType>
+	
+	<xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
+	<xs:element name="From" type="tns:EndpointReferenceType"/>
+	<xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
+	<xs:element name="To" type="tns:AttributedURIType"/>
+	<xs:element name="Action" type="tns:AttributedURIType"/>
+
+	<xs:complexType name="AttributedURIType" mixed="false">
+		<xs:simpleContent>
+
+			<xs:extension base="xs:anyURI">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<!-- Constructs from the WS-Addressing SOAP binding -->
+
+	<xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
+	
+	<xs:simpleType name="FaultCodesOpenEnumType">
+
+		<xs:union memberTypes="tns:FaultCodesType xs:QName"/>
+	</xs:simpleType>
+	
+	<xs:simpleType name="FaultCodesType">
+		<xs:restriction base="xs:QName">
+			<xs:enumeration value="tns:InvalidAddressingHeader"/>
+			<xs:enumeration value="tns:InvalidAddress"/>
+			<xs:enumeration value="tns:InvalidEPR"/>
+			<xs:enumeration value="tns:InvalidCardinality"/>
+			<xs:enumeration value="tns:MissingAddressInEPR"/>
+
+			<xs:enumeration value="tns:DuplicateMessageID"/>
+			<xs:enumeration value="tns:ActionMismatch"/>
+			<xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
+			<xs:enumeration value="tns:DestinationUnreachable"/>
+			<xs:enumeration value="tns:ActionNotSupported"/>
+			<xs:enumeration value="tns:EndpointUnavailable"/>
+		</xs:restriction>
+	</xs:simpleType>
+	
+	<xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
+
+	<xs:complexType name="AttributedUnsignedLongType" mixed="false">
+		<xs:simpleContent>
+			<xs:extension base="xs:unsignedLong">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
+	<xs:complexType name="AttributedQNameType" mixed="false">
+
+		<xs:simpleContent>
+			<xs:extension base="xs:QName">
+				<xs:anyAttribute namespace="##other" processContents="lax"/>
+			</xs:extension>
+		</xs:simpleContent>
+	</xs:complexType>
+	
+	<xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
+	
+	<xs:element name="ProblemAction" type="tns:ProblemActionType"/>
+	<xs:complexType name="ProblemActionType" mixed="false">
+
+		<xs:sequence>
+			<xs:element ref="tns:Action" minOccurs="0"/>
+			<xs:element name="SoapAction" minOccurs="0" type="xs:anyURI"/>
+		</xs:sequence>
+		<xs:anyAttribute namespace="##other" processContents="lax"/>
+	</xs:complexType>
+	
+</xs:schema>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsat.xsd
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsat.xsd	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsat.xsd	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+OASIS takes no position regarding the validity or scope of any intellectual property or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; neither does it represent that it has made any effort to identify any such rights. Information on OASIS's procedures with respect to rights in OASIS specifications can be found at the OASIS website. Copies of claims of rights made available for publication and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementors or users of this specification, can be obtained from the OASIS President.
+OASIS invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights which may cover technology that may be required to implement this specification. Please address the information to the OASIS President.
+Copyright OASIS Open 2006. All Rights Reserved.
+This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself must not be modified in any way, such as by removing the copyright notice or references to OASIS, except as needed for the purpose of developing OASIS specifications, in which case the procedures for copyrights defined in the OASIS Intellectual Property Rights document must be followed, or as required to translate it into languages other than English.
+The limited permissions granted above are perpetual and will not be revoked by OASIS or its successors or assigns.
+This document and the information contained herein is provided on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+-->
+<xsd:schema targetNamespace="http://docs.oasis-open.org/ws-tx/wsat/2006/06" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsat="http://docs.oasis-open.org/ws-tx/wsat/2006/06" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+    <xsd:complexType name="Notification">
+        <xsd:sequence>
+            <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:anyAttribute namespace="##other" processContents="lax"/>
+    </xsd:complexType>
+    <xsd:element name="Prepare" type="wsat:Notification"/>
+    <xsd:element name="Prepared" type="wsat:Notification"/>
+    <xsd:element name="Aborted" type="wsat:Notification"/>
+    <xsd:element name="ReadOnly" type="wsat:Notification"/>
+    <xsd:element name="Commit" type="wsat:Notification"/>
+    <xsd:element name="Rollback" type="wsat:Notification"/>
+    <xsd:element name="Committed" type="wsat:Notification"/>
+    <xsd:simpleType name="ErrorCodes">
+        <xsd:restriction base="xsd:QName">
+            <xsd:enumeration value="wsat:InconsistentInternalState"/>
+            <xsd:enumeration value="wsat:UnknownTransaction"/>
+        </xsd:restriction>
+    </xsd:simpleType>
+    
+    <!-- Policy assertion -->
+    <xsd:element name="ATAssertion">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+            </xsd:sequence>
+            <xsd:anyAttribute namespace="##other" processContents="lax" />
+        </xsd:complexType>
+    </xsd:element>
+</xsd:schema>

Added: labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsba.xsd
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsba.xsd	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/dd/wscoor1.1/xsd/wsba.xsd	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright OASIS Open 2006. All Rights Reserved. -->
+<xsd:schema targetNamespace="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:wsba="http://docs.oasis-open.org/ws-tx/wsba/2006/06" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+	<xsd:complexType name="NotificationType">
+		<xsd:sequence>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	<xsd:complexType name="ExceptionType">
+		<xsd:sequence>
+			<xsd:element name="ExceptionIdentifier" type="xsd:QName"/>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	<!-- Coordinator accepts -->
+	<xsd:element name="Canceled" type="wsba:NotificationType"/>
+	<xsd:element name="Closed" type="wsba:NotificationType"/>
+	<xsd:element name="Compensated" type="wsba:NotificationType"/>
+	<xsd:element name="Completed" type="wsba:NotificationType"/>
+	<xsd:element name="Exit" type="wsba:NotificationType"/>
+      <xsd:element name="CannotComplete" type="wsba:NotificationType"/>
+	<xsd:element name="Fail" type="wsba:ExceptionType"/>
+	<!-- Participant accepts -->
+	<xsd:element name="Cancel" type="wsba:NotificationType"/>
+	<xsd:element name="Close" type="wsba:NotificationType"/>
+	<xsd:element name="Compensate" type="wsba:NotificationType"/>
+	<xsd:element name="Complete" type="wsba:NotificationType"/>
+	<xsd:element name="Failed" type="wsba:NotificationType"/>
+      <xsd:element name="NotCompleted" type="wsba:NotificationType"/>
+	<xsd:element name="Exited" type="wsba:NotificationType"/>
+	<!-- Both accept -->
+	<xsd:element name="GetStatus" type="wsba:NotificationType"/>
+	<xsd:complexType name="StatusType">
+		<xsd:sequence>
+			<xsd:element name="State" type="wsba:StateType"/>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	<xsd:element name="Status" type="wsba:StatusType"/>
+	<xsd:simpleType name="StateType">
+		<xsd:restriction base="xsd:QName">
+			<xsd:enumeration value="wsba:Active"/>
+			<xsd:enumeration value="wsba:Canceling"/>
+			<xsd:enumeration value="wsba:Canceling-Active"/>
+			<xsd:enumeration value="wsba:Canceling-Completing"/>
+			<xsd:enumeration value="wsba:Completing"/>
+			<xsd:enumeration value="wsba:Completed"/>
+			<xsd:enumeration value="wsba:Closing"/>
+			<xsd:enumeration value="wsba:Compensating"/>
+			<xsd:enumeration value="wsba:Failing-Active"/>
+                  <xsd:enumeration value="wsba:Failing-Canceling"/>
+                  <xsd:enumeration value="wsba:Failing-Completing"/>
+			<xsd:enumeration value="wsba:Failing-Compensating"/>
+                  <xsd:enumeration value="wsba:Exiting"/>
+                  <xsd:enumeration value="wsba:NotCompleting"/>
+			<xsd:enumeration value="wsba:Ended"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+
+    <!-- Policy assertions -->
+    <xsd:element name="BAAtomicOutcomeAssertion">
+		<xsd:complexType>
+			<xsd:sequence>
+                   <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+               <xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+    </xsd:element>
+    <xsd:element name="BAMixedOutcomeAssertion">
+		<xsd:complexType>
+			<xsd:sequence>
+                   <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+               </xsd:sequence>
+               <xsd:anyAttribute namespace="##other" processContents="lax"/>
+		</xsd:complexType>
+    </xsd:element>
+
+</xsd:schema>

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/NotificationType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/NotificationType.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/NotificationType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,60 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.webservices.wsarjtx;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import com.arjuna.webservices.stax.AnyContentAnyAttributeSupport;
-
-/*
- * <xsd:complexType name="Notification">
- *   <xsd:sequence>
- *     <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
- *   </xsd:sequence>
- *   <xsd:anyAttribute namespace="##other" processContents="lax"/>
- * </xsd:complexType>
- */
-/**
- * Representation of the Notification type.
- * @author kevin
- */
-public class NotificationType extends AnyContentAnyAttributeSupport
-{
-    /**
-     * Default constructor.
-     */
-    public NotificationType()
-    {
-    }
-    
-    /**
-     * Construct a notification from the input stream.
-     * 
-     * @param in The input stream.
-     * @throws XMLStreamException For errors during parsing.
-     */
-    public NotificationType(final XMLStreamReader in)
-        throws XMLStreamException
-    {
-        parse(in) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/BAParticipantManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/BAParticipantManager.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/BAParticipantManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,86 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
- */
-
-package com.arjuna.wst;
-
-/**
- * When a Business Activity participant registers with a BA transaction it
- * gets a reference to the transaction coordinator that lets it callback
- * into the transaction and drive the state-transition.
- *
- * One instance of this per transaction.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
- * @since XTS 1.0.
- */
-
-public interface BAParticipantManager
-{
-
-    /**
-     * The participant has exited the business activity. The participant
-     * uses this to inform the coordinator that is has left the activity.
-     * It will not be informed when (and how) the business activity terminates.
-     */
-
-    public void exit () throws WrongStateException, UnknownTransactionException, SystemException;
-
-    /**
-     * The participant has completed it works, but wishes to continue in
-     * the business activity, so that it will eventually be told when (and how)
-     * the activity terminates. The participant may later be asked to
-     * compensate for the work it has done.
-     */
-
-    public void completed () throws WrongStateException, UnknownTransactionException, SystemException;
-
-    /**
-     * Fault.
-     */
-
-    public void fault () throws SystemException;
-    
-    /**
-     * An unknown error has occurred that the participant wants to communicate
-     * to the coordinator.
-     */
-
-    public void unknown () throws SystemException;
-
-    /**
-     * An error has occurred during the execution of the protocol that the
-     * participant wants to communicate to the coordinator.
-     */
-
-    public void error () throws SystemException;
-
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,109 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.wst.stub;
-
-import com.arjuna.webservices.wsba.State;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipantEngine;
-
-public class BACoordinatorCompletionParticipantManagerStub implements com.arjuna.wst.BAParticipantManager
-{
-    private final CoordinatorCompletionParticipantEngine coordinator ;
-    
-    public BACoordinatorCompletionParticipantManagerStub (final CoordinatorCompletionParticipantEngine coordinator)
-        throws Exception
-    {
-        this.coordinator = coordinator ;
-    }
-
-    public void exit ()
-        throws WrongStateException, UnknownTransactionException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state 
-         * Exiting -> no response
-         * Ended -> ended
-         */
-        final State state = coordinator.exit() ;
-        if (state == State.STATE_EXITING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public void completed ()
-        throws WrongStateException, UnknownTransactionException, SystemException
-    {
-        // returns original state
-        final State state = coordinator.completed() ;
-        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public void fault ()
-        throws SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> no response
-         * Faulting-Compensating -> no response 
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = coordinator.fault() ;
-        if (state != State.STATE_ENDED)
-        {
-            throw new SystemException() ;
-        }
-    }
-
-    public void unknown()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    public void error()
-        throws SystemException
-    {
-        fault() ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,109 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.wst.stub;
-
-import com.arjuna.webservices.wsba.State;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
-
-public class BAParticipantCompletionParticipantManagerStub implements com.arjuna.wst.BAParticipantManager
-{
-    private final ParticipantCompletionParticipantEngine coordinator ;
-    
-    public BAParticipantCompletionParticipantManagerStub (final ParticipantCompletionParticipantEngine coordinator)
-        throws Exception
-    {
-        this.coordinator = coordinator ;
-    }
-
-    public synchronized void exit ()
-        throws WrongStateException, UnknownTransactionException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state 
-         * Exiting -> no response
-         * Ended -> ended
-         */
-        final State state = coordinator.exit() ;
-        if (state == State.STATE_EXITING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void completed ()
-        throws WrongStateException, UnknownTransactionException, SystemException
-    {
-        // returns original state
-        final State state = coordinator.completed() ;
-        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void fault ()
-        throws SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> no response
-         * Faulting-Compensating -> no response 
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = coordinator.fault() ;
-        if (state != State.STATE_ENDED)
-        {
-            throw new SystemException() ;
-        }
-    }
-
-    public void unknown()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    public void error()
-        throws SystemException
-    {
-        fault() ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,385 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, Arjuna Technologies Limited.
- *
- * $Id: BusinessActivityTerminatorStub.java,v 1.7.6.1 2005/11/22 10:35:29 kconner Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import javax.xml.namespace.QName;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapFaultType;
-import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.wsaddr.AddressingContext;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.ArjunaContext;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.webservices.wsarjtx.NotificationType;
-import com.arjuna.webservices.wsarjtx.client.TerminationCoordinatorClient;
-import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantCallback;
-import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantProcessor;
-import com.arjuna.wsc.messaging.MessageId;
-import com.arjuna.wst.FaultedException;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-
-public class BusinessActivityTerminatorStub implements com.arjuna.wst.BusinessActivityTerminator
-{
-    private EndpointReferenceType          _terminationParticipant         = null;
-    private final String _id ;
-    
-    public BusinessActivityTerminatorStub (final String id, final EndpointReferenceType terminationParticipant)
-        throws Exception
-    {
-        _terminationParticipant         = terminationParticipant;
-        _id = id ;
-    }
-
-    public void close ()
-        throws TransactionRolledBackException, UnknownTransactionException, SystemException
-    {
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
-        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
-        try
-        {
-            TerminationCoordinatorClient.getClient().sendClose(addressingContext, new InstanceIdentifier(_id)) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SystemException() ;
-        }
-        finally
-        {
-            terminatorCoordinatorProcessor.removeCallback(_id) ;
-        }
-        
-        if (callback.hasTriggered())
-        {
-            if (callback.receivedClosed())
-            {
-                return ;
-            }
-            final SoapFault soapFault = callback.getSoapFault() ;
-            if (soapFault != null)
-            {
-                final QName subcode = soapFault.getSubcode() ;
-                if (ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(subcode))
-                {
-                    throw new TransactionRolledBackException();
-                }
-                else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
-                {
-                    throw new UnknownTransactionException() ;
-                }
-            }
-        }
-        throw new SystemException() ;
-    }
-
-    public void cancel ()
-        throws FaultedException, UnknownTransactionException, SystemException
-    {
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
-        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
-        try
-        {
-            TerminationCoordinatorClient.getClient().sendCancel(addressingContext, new InstanceIdentifier(_id)) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SystemException() ;
-        }
-        finally
-        {
-            terminatorCoordinatorProcessor.removeCallback(_id) ;
-        }
-        
-        if (callback.hasTriggered())
-        {
-            if (callback.receivedCancelled())
-            {
-                return ;
-            }
-            else if (callback.receivedFaulted())
-            {
-                throw new FaultedException() ;
-            }
-            final SoapFault soapFault = callback.getSoapFault() ;
-            if (soapFault != null)
-            {
-                final QName subcode = soapFault.getSubcode() ;
-                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
-                {
-                    throw new UnknownTransactionException() ;
-                }
-            }
-        }
-        throw new SystemException() ;
-    }
-
-    public void complete ()
-        throws FaultedException, UnknownTransactionException, SystemException
-    {
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
-        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
-        try
-        {
-            TerminationCoordinatorClient.getClient().sendComplete(addressingContext, new InstanceIdentifier(_id)) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SystemException() ;
-        }
-        finally
-        {
-            terminatorCoordinatorProcessor.removeCallback(_id) ;
-        }
-        
-        if (callback.hasTriggered())
-        {
-            if (callback.receivedCompleted())
-            {
-                return ;
-            }
-            else if (callback.receivedFaulted())
-            {
-                throw new FaultedException() ;
-            }
-            final SoapFault soapFault = callback.getSoapFault() ;
-            if (soapFault != null)
-            {
-                final QName subcode = soapFault.getSubcode() ;
-                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
-                {
-                    throw new UnknownTransactionException() ;
-                }
-            }
-        }
-        throw new SystemException() ;
-    }
-
-    public void unknown ()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    /**
-     * @message com.arjuna.wst.stub.BusinessActivityTerminatorStub_1 [com.arjuna.wst.stub.BusinessActivityTerminatorStub_1] - Unknown error
-     */
-    public void error ()
-        throws SystemException
-    {
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
-        final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME,
-                WSTLogger.log_mesg.getString("com.arjuna.wst.stub.BusinessActivityTerminatorStub_1")) ;
-        try
-        {
-            TerminationCoordinatorClient.getClient().sendSoapFault(addressingContext, soapFault, new InstanceIdentifier(_id)) ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SystemException() ;
-        }
-    }
-
-    private static class RequestCallback extends TerminationParticipantCallback
-    {
-        /**
-         * The addressing context.
-         */
-        private AddressingContext addressingContext ;
-        /**
-         * The arjuna context.
-         */
-        private ArjunaContext arjunaContext ;
-        /**
-         * The SOAP fault.
-         */
-        private SoapFault soapFault ;
-        /**
-         * The completed notification flag.
-         */
-        private boolean completed ;
-        /**
-         * The cancelled notification flag.
-         */
-        private boolean cancelled ;
-        /**
-         * The closed notification flag.
-         */
-        private boolean closed ;
-        /**
-         * The faulted notification flag.
-         */
-        private boolean faulted ;
-        
-        /**
-         * Get the addressing context.
-         * @return The addressing context.
-         */
-        AddressingContext getAddressingContext()
-        {
-            return addressingContext ;
-        }
-        
-        /**
-         * Get the arjuna context.
-         * @return The arjuna context.
-         */
-        ArjunaContext getArjunaContext()
-        {
-            return arjunaContext ;
-        }
-        
-        /**
-         * Get the SOAP fault.
-         * @return The SOAP fault.
-         */
-        SoapFault getSoapFault()
-        {
-            return soapFault ;
-        }
-        
-        /**
-         * Did we receive a completed notification?
-         * @return True if completed, false otherwise.
-         */
-        boolean receivedCompleted()
-        {
-            return completed ;
-        }
-        
-        /**
-         * Did we receive a cancelled notification?
-         * @return True if cancelled, false otherwise.
-         */
-        boolean receivedCancelled()
-        {
-            return cancelled ;
-        }
-        
-        /**
-         * Did we receive a closed notification?
-         * @return True if closed, false otherwise.
-         */
-        boolean receivedClosed()
-        {
-            return closed ;
-        }
-        
-        /**
-         * Did we receive a faulted notification?
-         * @return True if faulted, false otherwise.
-         */
-        boolean receivedFaulted()
-        {
-            return faulted ;
-        }
-        
-        /**
-         * A completed response.
-         * @param completed The completed notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void completed(final NotificationType completed, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.completed = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-
-        /**
-         * A cancelled response.
-         * @param cancelled The cancelled notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void cancelled(final NotificationType cancelled, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.cancelled  = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-
-        /**
-         * A closed response.
-         * @param closed The closed notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void closed(final NotificationType closed, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.closed = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-
-        /**
-         * A faulted response.
-         * @param faulted The faulted notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void faulted(final NotificationType faulted, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.faulted = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-        
-        /**
-         * A SOAP fault response.
-         * @param soapFault The SOAP fault.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.soapFault = soapFault ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,255 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, Arjuna Technologies Limited.
- *
- * $Id: BusinessAgreementWithCoordinatorCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.ats.arjuna.state.InputObjectState;
-import com.arjuna.ats.arjuna.state.OutputObjectState;
-import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.soap.SoapUtils;
-import com.arjuna.webservices.util.StreamHelper;
-import com.arjuna.webservices.wsba.State;
-import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
-import com.arjuna.wst.FaultedException;
-import com.arjuna.wst.PersistableParticipant;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.CoordinatorCompletionCoordinatorEngine;
-
-public class BusinessAgreementWithCoordinatorCompletionStub implements BusinessAgreementWithCoordinatorCompletionParticipant, PersistableParticipant
-{
-    private static final QName QNAME_BACC_PARTICIPANT = new QName("baccParticipant") ;
-    private CoordinatorCompletionCoordinatorEngine participant ;
-
-    public BusinessAgreementWithCoordinatorCompletionStub (final CoordinatorCompletionCoordinatorEngine participant)
-        throws Exception
-    {
-        this.participant = participant ;
-    }
-
-    public synchronized void close ()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Canceling-Active -> illegal state
-         * Canceling-Completing -> illegal state
-         * Completing -> illegal state
-         * Completed -> illegal state
-         * Closing -> no response
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.close() ;
-        
-        if (state == State.STATE_CLOSING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void cancel ()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> no response
-         * Canceling-Active -> no response
-         * Canceling-Completing -> no response
-         * Completing -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.cancel() ;
-        
-        if ((state == State.STATE_CANCELING) || (state == State.STATE_CANCELING_ACTIVE) ||
-            (state == State.STATE_CANCELING_COMPLETING))
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void compensate ()
-        throws FaultedException, WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Canceling-Active -> illegal state
-         * Canceling-Completing -> illegal state
-         * Completing -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> no response
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> fault
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.compensate() ;
-        if (state == State.STATE_COMPENSATING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state == State.STATE_FAULTING_COMPENSATING)
-        {
-            throw new FaultedException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void complete ()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Canceling-Active -> illegal state
-         * Canceling-Completing -> canceling
-         * Completing -> no response
-         * Completed -> completed
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> fault
-         * Exiting -> exiting
-         * Ended -> illegal state
-         */
-        final State state = participant.complete() ;
-        if (state == State.STATE_COMPLETED)
-        {
-            return ;
-        }
-        else if ((state == State.STATE_FAULTING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) ||
-            (state == State.STATE_EXITING))
-        {
-            throw new SystemException() ;
-        }
-        throw new WrongStateException() ;
-    }
-
-    public String status ()
-        throws SystemException
-    {
-        final State state = participant.getStatus() ;
-        return (state == null ? null : state.getValue().getLocalPart()) ;
-    }
-
-    public void unknown ()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    public synchronized void error ()
-        throws SystemException
-    {
-        participant.cancel() ;
-    }
-    
-    /**
-     * @message com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2 [com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2] - Error persisting participant state
-     */
-    public boolean saveState(final OutputObjectState oos)
-    {
-        try
-        {
-            oos.packString(participant.getId()) ;
-            
-            final StringWriter sw = new StringWriter() ;
-            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
-            StreamHelper.writeStartElement(writer, QNAME_BACC_PARTICIPANT) ;
-            participant.getParticipant().writeContent(writer) ;
-            StreamHelper.writeEndElement(writer, null, null) ;
-            writer.close() ;
-            
-            oos.packString(writer.toString()) ;
-            
-            return true ;
-        }
-        catch (final Throwable th)
-        {
-            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2", th) ;
-            return false ;
-        }
-    }
-    
-    /**
-     * @message com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3 [com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3] - Error restoring participant state
-     */
-    public boolean restoreState(final InputObjectState ios)
-    {
-        // KEV - rework
-        return false ;
-//        try
-//        {
-//            final String id = ios.unpackString() ;
-//            final String eprValue = ios.unpackString() ;
-//            
-//            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
-//            StreamHelper.checkNextStartTag(reader, QNAME_BACC_PARTICIPANT) ;
-//            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
-//            
-//            _id = id ;
-//            _businessAgreementWithCoordinatorCompletionParticipant = endpointReferenceType ;
-//            return true ;
-//        }
-//        catch (final Throwable th)
-//        {
-//            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3", th) ;
-//            return false ;
-//        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,215 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, Arjuna Technologies Limited.
- *
- * $Id: BusinessAgreementWithParticipantCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.ats.arjuna.state.InputObjectState;
-import com.arjuna.ats.arjuna.state.OutputObjectState;
-import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.soap.SoapUtils;
-import com.arjuna.webservices.util.StreamHelper;
-import com.arjuna.webservices.wsba.State;
-import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
-import com.arjuna.wst.FaultedException;
-import com.arjuna.wst.PersistableParticipant;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.ParticipantCompletionCoordinatorEngine;
-
-public class BusinessAgreementWithParticipantCompletionStub implements BusinessAgreementWithParticipantCompletionParticipant, PersistableParticipant
-{
-    private static final QName QNAME_BAPC_PARTICIPANT = new QName("bapcParticipant") ;
-    
-    private ParticipantCompletionCoordinatorEngine participant ;
-    
-    public BusinessAgreementWithParticipantCompletionStub (final ParticipantCompletionCoordinatorEngine participant)
-        throws Exception
-    {
-        this.participant = participant ;
-    }
-
-    public synchronized void close ()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> no response
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.close() ;
-        
-        if (state == State.STATE_CLOSING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void cancel ()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> no response
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> illegal state
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> illegal state
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.cancel() ;
-        
-        if (state == State.STATE_CANCELING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public synchronized void compensate ()
-        throws FaultedException, WrongStateException, SystemException
-    {
-        /*
-         * Active -> illegal state
-         * Canceling -> illegal state
-         * Completed -> illegal state
-         * Closing -> illegal state
-         * Compensating -> no answer
-         * Faulting -> illegal state
-         * Faulting-Active -> illegal state
-         * Faulting-Compensating -> fault
-         * Exiting -> illegal state
-         * Ended -> ended
-         */
-        final State state = participant.compensate() ;
-        if (state == State.STATE_COMPENSATING)
-        {
-            throw new SystemException() ;
-        }
-        else if (state == State.STATE_FAULTING_COMPENSATING)
-        {
-            throw new FaultedException() ;
-        }
-        else if (state != State.STATE_ENDED)
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public String status ()
-        throws SystemException
-    {
-        final State state = participant.getStatus() ;
-        return (state == null ? null : state.getValue().getLocalPart()) ;
-    }
-
-    public void unknown ()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    public synchronized void error ()
-        throws SystemException
-    {
-        participant.cancel() ;
-    }
-    
-    /**
-     * @message com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2 [com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2] - Error persisting participant state
-     */
-    public boolean saveState(final OutputObjectState oos)
-    {
-        try
-        {
-            oos.packString(participant.getId()) ;
-            
-            final StringWriter sw = new StringWriter() ;
-            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
-            StreamHelper.writeStartElement(writer, QNAME_BAPC_PARTICIPANT) ;
-            participant.getParticipant().writeContent(writer) ;
-            StreamHelper.writeEndElement(writer, null, null) ;
-            writer.close() ;
-            
-            oos.packString(writer.toString()) ;
-            
-            return true ;
-        }
-        catch (final Throwable th)
-        {
-            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2", th) ;
-            return false ;
-        }
-    }
-    
-    /**
-     * @message com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3 [com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3] - Error restoring participant state
-     */
-    public boolean restoreState(final InputObjectState ios)
-    {
-        // KEV - rework
-        return false ;
-//        try
-//        {
-//            final String id = ios.unpackString() ;
-//            final String eprValue = ios.unpackString() ;
-//            
-//            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
-//            StreamHelper.checkNextStartTag(reader, QNAME_BAPC_PARTICIPANT) ;
-//            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
-//            
-//            _id = id ;
-//            _businessAgreementWithParticipantCompletionParticipant = endpointReferenceType ;
-//            return true ;
-//        }
-//        catch (final Throwable th)
-//        {
-//            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3", th) ;
-//            return false ;
-//        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/CompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/CompletionStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/CompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,248 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, Arjuna Technologies Limited.
- * 
- * CompletionStub.java
- */
-
-package com.arjuna.wst.stub;
-
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.wsaddr.AddressingContext;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.ArjunaContext;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.webservices.wsat.NotificationType;
-import com.arjuna.webservices.wsat.client.CompletionCoordinatorClient;
-import com.arjuna.webservices.wsat.processors.CompletionInitiatorCallback;
-import com.arjuna.webservices.wsat.processors.CompletionInitiatorProcessor;
-import com.arjuna.wsc.messaging.MessageId;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-
-public class CompletionStub implements
-		com.arjuna.wst.CompletionCoordinatorParticipant
-{
-    private EndpointReferenceType _completionCoordinator = null;
-    private String _id;
-
-	public CompletionStub (final String id, final EndpointReferenceType completionCoordinator)
-			throws Exception
-	{	
-		_completionCoordinator = completionCoordinator;
-		_id = id;
-	}
-
-	public void commit () throws TransactionRolledBackException,
-			UnknownTransactionException, SystemException
-	{
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_completionCoordinator, MessageId.getMessageId()) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
-        completionInitiator.registerCallback(_id, callback) ;
-        try
-        {
-            CompletionCoordinatorClient.getClient().sendCommit(addressingContext, new InstanceIdentifier(_id)) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final Throwable th)
-        {
-            th.printStackTrace() ;
-            throw new SystemException() ;
-        }
-        finally
-        {
-            completionInitiator.removeCallback(_id) ;
-        }
-        
-        if (callback.hasTriggered())
-        {
-            if (callback.receivedCommitted())
-            {
-                return ;
-            }
-            else if (callback.receivedAborted())
-            {
-                throw new TransactionRolledBackException() ;
-            }
-            final SoapFault soapFault = callback.getSoapFault() ;
-            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
-            {
-                throw new UnknownTransactionException();
-            }
-        }
-        
-        throw new SystemException() ;
-	}
-
-	public void rollback () throws UnknownTransactionException, SystemException
-	{
-        final AddressingContext addressingContext = AddressingContext.createRequestContext(_completionCoordinator, MessageId.getMessageId()) ;
-        
-        final RequestCallback callback = new RequestCallback() ;
-        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
-        completionInitiator.registerCallback(_id, callback) ;
-        try
-        {
-            CompletionCoordinatorClient.getClient().sendRollback(addressingContext, new InstanceIdentifier(_id)) ;
-            callback.waitUntilTriggered() ;
-        }
-        catch (final Throwable th)
-        {
-            th.printStackTrace() ;
-            throw new SystemException() ;
-        }
-        finally
-        {
-            completionInitiator.removeCallback(_id) ;
-        }
-        
-        if (callback.hasTriggered())
-        {
-            if (callback.receivedAborted())
-            {
-                return ;
-            }
-            final SoapFault soapFault = callback.getSoapFault() ;
-            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
-            {
-                throw new UnknownTransactionException();
-            }
-        }
-        
-        throw new SystemException() ;
-	}
-    
-    private static class RequestCallback extends CompletionInitiatorCallback
-    {
-        /**
-         * The addressing context.
-         */
-        private AddressingContext addressingContext ;
-        /**
-         * The arjuna context.
-         */
-        private ArjunaContext arjunaContext ;
-        /**
-         * The SOAP fault.
-         */
-        private SoapFault soapFault ;
-        /**
-         * The aborted notification flag.
-         */
-        private boolean aborted ;
-        /**
-         * The committed notification flag.
-         */
-        private boolean committed ;
-        
-        /**
-         * Get the addressing context.
-         * @return The addressing context.
-         */
-        AddressingContext getAddressingContext()
-        {
-            return addressingContext ;
-        }
-        
-        /**
-         * Get the arjuna context.
-         * @return The arjuna context.
-         */
-        ArjunaContext getArjunaContext()
-        {
-            return arjunaContext ;
-        }
-        
-        /**
-         * Get the SOAP fault.
-         * @return The SOAP fault.
-         */
-        SoapFault getSoapFault()
-        {
-            return soapFault ;
-        }
-        
-        /**
-         * Did we receive a aborted notification?
-         * @return True if aborted, false otherwise.
-         */
-        boolean receivedAborted()
-        {
-            return aborted ;
-        }
-        
-        /**
-         * Did we receive a committed notification?
-         * @return True if committed, false otherwise.
-         */
-        boolean receivedCommitted()
-        {
-            return committed ;
-        }
-        
-        /**
-         * A aborted response.
-         * @param aborted The aborted notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void aborted(final NotificationType aborted, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.aborted = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-
-        /**
-         * An committed response.
-         * @param committed The committed notification.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void committed(final NotificationType committed, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.committed  = true ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-        
-        /**
-         * A SOAP fault response.
-         * @param soapFault The SOAP fault.
-         * @param addressingContext The addressing context.
-         * @param arjunaContext The arjuna context.
-         */
-        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext,
-            final ArjunaContext arjunaContext)
-        {
-            this.soapFault = soapFault ;
-            this.addressingContext = addressingContext ;
-            this.arjunaContext = arjunaContext ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Durable2PCStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Durable2PCStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Durable2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,46 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, 2004,
- *
- * Arjuna Technologies Limited.
- *
- * $Id: Durable2PCStub.java,v 1.1.2.3 2004/06/18 15:06:09 nmcl Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.wst.Durable2PCParticipant;
-
-public class Durable2PCStub extends ParticipantStub implements Durable2PCParticipant
-{
-    // default ctor for crash recovery
-    public Durable2PCStub() throws Exception {
-        super(null, true, null);
-    }
-
-    public Durable2PCStub(final String id, final EndpointReferenceType twoPCParticipant)
-        throws Exception
-    {
-        super(id, true, twoPCParticipant) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/ParticipantStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/ParticipantStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/ParticipantStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,234 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, 2004,
- *
- * Arjuna Technologies Limited.
- *
- * $Id: ParticipantStub.java,v 1.1.2.1 2005/11/22 10:35:28 kconner Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import com.arjuna.ats.arjuna.state.InputObjectState;
-import com.arjuna.ats.arjuna.state.OutputObjectState;
-import com.arjuna.webservices.logging.WSTLogger;
-import com.arjuna.webservices.soap.SoapUtils;
-import com.arjuna.webservices.util.StreamHelper;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsat.State;
-import com.arjuna.wst.Aborted;
-import com.arjuna.wst.Participant;
-import com.arjuna.wst.PersistableParticipant;
-import com.arjuna.wst.Prepared;
-import com.arjuna.wst.ReadOnly;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.Vote;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.CoordinatorEngine;
-
-public class ParticipantStub implements Participant, PersistableParticipant
-{
-    private static final QName QNAME_TWO_PC_PARTICIPANT = new QName("twoPCParticipant") ;
-    private CoordinatorEngine coordinator ;
-
-    public ParticipantStub(final String id, final boolean durable, final EndpointReferenceType twoPCParticipant)
-        throws Exception
-    {
-        coordinator = new CoordinatorEngine(id, durable, twoPCParticipant) ;
-    }
-
-    public Vote prepare()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * null - aborted or read only
-         * Active - illegal state
-         * Preparing - no answer
-         * Prepared - illegal state
-         * PreparedSuccess - prepared
-         * Committing - illegal state
-         * Aborting - aborting
-         */
-        final State state = coordinator.prepare() ;
-        if (state == State.STATE_PREPARED_SUCCESS)
-        {
-            return new Prepared() ;
-        }
-        else if (state == State.STATE_ABORTING)
-        {
-            return new Aborted() ;
-        }
-        else if (state == null)
-        {
-            if (coordinator.isReadOnly())
-            {
-                return new ReadOnly() ;
-            }
-            else
-            {
-                return new Aborted() ;
-            }
-        }
-        else if (state == State.STATE_PREPARING)
-        {
-            throw new SystemException() ;
-        }
-        else
-        {
-            throw new WrongStateException() ;
-        }
-    }
-
-    public void commit()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * null - committed
-         * Active - illegal state
-         * Preparing - illegal state
-         * Prepared - illegal state
-         * PreparedSuccess - illegal state
-         * Committing - no response
-         * Aborting - illegal state
-         */
-        final State state = coordinator.commit() ;
-        if (state != null)
-        {
-            if (state == State.STATE_COMMITTING)
-            {
-                // typically means no response from the remote end.
-                // throw a comm exception to distinguish this case from the
-                // one where the remote end itself threw a SystemException.
-                throw new SystemCommunicationException();
-            }
-            else
-            {
-                throw new WrongStateException() ;
-            }
-        }
-    }
-
-    public void rollback()
-        throws WrongStateException, SystemException
-    {
-        /*
-         * null - aborted
-         * Active - illegal state
-         * Preparing - illegal state
-         * Prepared - illegal state
-         * PreparedSuccess - illegal state
-         * Committing - illegal state
-         * Aborting - no response
-         */
-        final State state = coordinator.rollback() ;
-        if (state != null)
-        {
-            if (state == State.STATE_ABORTING)
-            {
-                throw new SystemException() ;
-            }
-            else
-            {
-                throw new WrongStateException() ;
-            }
-        }
-    }
-
-    public void unknown()
-        throws SystemException
-    {
-        error() ;
-    }
-
-    public void error()
-        throws SystemException
-    {
-        try
-        {
-            rollback() ;
-        }
-        catch (final WrongStateException wse) {} // ignore
-    }
-
-    /**
-     * @message com.arjuna.wst.stub.ParticipantStub_1 [com.arjuna.wst.stub.ParticipantStub_1] - Error persisting participant state
-     */
-    public boolean saveState(final OutputObjectState oos)
-    {
-        try
-        {
-            oos.packString(coordinator.getId()) ;
-            oos.packBoolean(coordinator.isDurable()) ;
-
-            final StringWriter sw = new StringWriter() ;
-            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
-            StreamHelper.writeStartElement(writer, QNAME_TWO_PC_PARTICIPANT) ;
-            coordinator.getParticipant().writeContent(writer) ;
-            StreamHelper.writeEndElement(writer, null, null) ;
-            writer.close() ;
-            sw.close();
-
-            String tmp = writer.toString();
-            String swString = sw.toString();
-            oos.packString(swString) ;
-
-            return true ;
-        }
-        catch (final Throwable th)
-        {
-            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.ParticipantStub_1", th) ;
-            return false ;
-        }
-    }
-
-    /**
-     * @message com.arjuna.wst.stub.ParticipantStub_2 [com.arjuna.wst.stub.ParticipantStub_2] - Error restoring participant state
-     */
-    public boolean restoreState(final InputObjectState ios)
-    {
-        try
-        {
-            final String id = ios.unpackString() ;
-            final boolean durable = ios.unpackBoolean() ;
-            final String eprValue = ios.unpackString() ;
-
-            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
-            StreamHelper.checkNextStartTag(reader, QNAME_TWO_PC_PARTICIPANT) ;
-            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
-
-            coordinator = new CoordinatorEngine(id, durable, endpointReferenceType, State.STATE_PREPARED_SUCCESS) ;
-            return true ;
-        }
-        catch (final Throwable th)
-        {
-            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.ParticipantStub_2", th) ;
-            return false ;
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Volatile2PCStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Volatile2PCStub.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Volatile2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,41 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (c) 2003, 2004,
- *
- * Arjuna Technologies Limited.
- *
- * $Id: Volatile2PCStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
- */
-
-package com.arjuna.wst.stub;
-
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.wst.Volatile2PCParticipant;
-
-public class Volatile2PCStub extends ParticipantStub implements Volatile2PCParticipant
-{
-    public Volatile2PCStub(final String id, final EndpointReferenceType twoPCParticipant)
-        throws Exception
-    {
-        super(id, false, twoPCParticipant) ;
-    }
-}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/NotificationType.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/NotificationType.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/NotificationType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/NotificationType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,60 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices.wsarjtx;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import com.arjuna.webservices.stax.AnyContentAnyAttributeSupport;
+
+/*
+ * <xsd:complexType name="Notification">
+ *   <xsd:sequence>
+ *     <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+ *   </xsd:sequence>
+ *   <xsd:anyAttribute namespace="##other" processContents="lax"/>
+ * </xsd:complexType>
+ */
+/**
+ * Representation of the Notification type.
+ * @author kevin
+ */
+public class NotificationType extends AnyContentAnyAttributeSupport
+{
+    /**
+     * Default constructor.
+     */
+    public NotificationType()
+    {
+    }
+    
+    /**
+     * Construct a notification from the input stream.
+     * 
+     * @param in The input stream.
+     * @throws XMLStreamException For errors during parsing.
+     */
+    public NotificationType(final XMLStreamReader in)
+        throws XMLStreamException
+    {
+        parse(in) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/client (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/client)

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/handlers (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/handlers)

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/policy (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/policy)

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/processors (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/processors)

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server)

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
 import com.arjuna.webservices.wsarjtx.policy.TerminationCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Terminator Participant service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Terminator participant.
-        TerminationCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Terminator participant.
+               TerminationCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsarjtx/server/TerminationParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
 import com.arjuna.webservices.wsarjtx.policy.TerminationParticipantPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Terminator Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Terminator coordinator.
-        TerminationParticipantPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Terminator coordinator.
+               TerminationParticipantPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat)

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat/server/CompletionCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsat.AtomicTransactionConstants;
 import com.arjuna.webservices.wsat.policy.CompletionCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Completion Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Completion coordinator.
-        CompletionCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COMPLETION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Completion coordinator.
+               CompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COMPLETION_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat/server/CompletionInitiatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CompletionInitiatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsat.AtomicTransactionConstants;
 import com.arjuna.webservices.wsat.policy.CompletionInitiatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Completion Initiator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Completion initiator.
-        CompletionInitiatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Completion initiator.
+               CompletionInitiatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat/server/CoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/CoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsat.AtomicTransactionConstants;
 import com.arjuna.webservices.wsat.policy.CoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add coordinator.
-        CoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add coordinator.
+               CoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsat/server/ParticipantInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsat/server/ParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsat.AtomicTransactionConstants;
 import com.arjuna.webservices.wsat.policy.ParticipantPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Participant service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Participant.
-        ParticipantPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_PARTICIPANT,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Participant.
+               ParticipantPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(AtomicTransactionConstants.SERVICE_PARTICIPANT,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba)

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsba.BusinessActivityConstants;
 import com.arjuna.webservices.wsba.policy.CoordinatorCompletionCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Coordinator Completion Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Coordinator Completion coordinator.
-        CoordinatorCompletionCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Coordinator Completion coordinator.
+               CoordinatorCompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba/server/CoordinatorCompletionParticipantInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/CoordinatorCompletionParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsba.BusinessActivityConstants;
 import com.arjuna.webservices.wsba.policy.CoordinatorCompletionParticipantPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Coordinator Completion Participant service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Coordinator Completion participant.
-        CoordinatorCompletionParticipantPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Coordinator Completion participant.
+               CoordinatorCompletionParticipantPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsba.BusinessActivityConstants;
 import com.arjuna.webservices.wsba.policy.ParticipantCompletionCoordinatorPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Participant Completion Coordinator service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Participant Completion coordinator.
-        ParticipantCompletionCoordinatorPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Participant Completion coordinator.
+               ParticipantCompletionCoordinatorPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/wsba/server/ParticipantCompletionParticipantInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/webservices/wsba/server/ParticipantCompletionParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,6 +30,7 @@
 import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
 import com.arjuna.webservices.wsba.BusinessActivityConstants;
 import com.arjuna.webservices.wsba.policy.ParticipantCompletionParticipantPolicy;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Activate the Participant Completion Participant service
@@ -43,18 +44,22 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
-        
-        // Add WS-Addressing
-        AddressingPolicy.register(handlerRegistry) ;
-        // Add Arjuna handlers
-        ArjunaPolicy.register(handlerRegistry) ;
-        // Add Participant Completion participant.
-        ParticipantCompletionParticipantPolicy.register(handlerRegistry) ;
-        
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT,
-            new SoapService(handlerRegistry)) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+               // Add WS-Addressing
+               AddressingPolicy.register(handlerRegistry) ;
+               // Add Arjuna handlers
+               ArjunaPolicy.register(handlerRegistry) ;
+               // Add Participant Completion participant.
+               ParticipantCompletionParticipantPolicy.register(handlerRegistry) ;
+
+               final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+               soapRegistry.registerSoapService(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT,
+                       new SoapService(handlerRegistry)) ;
+           }
+        };
     }
 
     /**

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/BAParticipantManager.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/BAParticipantManager.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/BAParticipantManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/BAParticipantManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
+ */
+
+package com.arjuna.wst;
+
+/**
+ * When a Business Activity participant registers with a BA transaction it
+ * gets a reference to the transaction coordinator that lets it callback
+ * into the transaction and drive the state-transition.
+ *
+ * One instance of this per transaction.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public interface BAParticipantManager
+{
+
+    /**
+     * The participant has exited the business activity. The participant
+     * uses this to inform the coordinator that is has left the activity.
+     * It will not be informed when (and how) the business activity terminates.
+     */
+
+    public void exit () throws WrongStateException, UnknownTransactionException, SystemException;
+
+    /**
+     * The participant has completed it works, but wishes to continue in
+     * the business activity, so that it will eventually be told when (and how)
+     * the activity terminates. The participant may later be asked to
+     * compensate for the work it has done.
+     */
+
+    public void completed () throws WrongStateException, UnknownTransactionException, SystemException;
+
+    /**
+     * Fault.
+     */
+
+    public void fault () throws SystemException;
+    
+    /**
+     * An unknown error has occurred that the participant wants to communicate
+     * to the coordinator.
+     */
+
+    public void unknown () throws SystemException;
+
+    /**
+     * An error has occurred during the execution of the protocol that the
+     * participant wants to communicate to the coordinator.
+     */
+
+    public void error () throws SystemException;
+
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging)

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CompletionCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/CompletionCoordinatorProcessorImpl.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CompletionCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -23,6 +23,7 @@
 import java.text.MessageFormat;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
 import com.arjuna.webservices.logging.WSTLogger;
@@ -121,7 +122,7 @@
                 catch (final UnknownTransactionException ute)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_1")) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -131,7 +132,7 @@
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_2") ;
                     final String message = MessageFormat.format(pattern, new Object[] {se}) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -142,7 +143,7 @@
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_3", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -157,7 +158,7 @@
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_4", new Object[] {instanceIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_5")) ;
                 CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
             }
@@ -192,7 +193,7 @@
                 catch (final UnknownTransactionException ute)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_6")) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -202,7 +203,7 @@
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_7") ;
                     final String message = MessageFormat.format(pattern, new Object[] {systemException}) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -213,7 +214,7 @@
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_8", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -228,7 +229,7 @@
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_9", new Object[] {instanceIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                     WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CompletionCoordinatorProcessorImpl_10")) ;
                 CompletionInitiatorClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
             }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/CoordinatorProcessorImpl.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/CoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -21,6 +21,7 @@
 package com.arjuna.wst.messaging;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
 import com.arjuna.webservices.logging.WSTLogger;
@@ -342,7 +343,7 @@
         try
         {
             final String message = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.CoordinatorProcessorImpl.sendInvalidState_1") ;
-            final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
+            final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
             ParticipantClient.getClient().sendSoapFault(responseAddressingContext, soapFault, instanceIdentifier) ;
         }
         catch (final Throwable th)

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/TerminatorParticipantProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/TerminatorParticipantProcessorImpl.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/TerminatorParticipantProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -23,6 +23,7 @@
 import java.text.MessageFormat;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
 import com.arjuna.webservices.logging.WSTLogger;
@@ -128,7 +129,7 @@
                 catch (final UnknownTransactionException ute)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_1")) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -138,7 +139,7 @@
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_2") ;
                     final String message = MessageFormat.format(pattern, new Object[] {se}) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -149,7 +150,7 @@
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_3", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -164,7 +165,7 @@
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_4", new Object[] {instanceIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                     WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_5")) ;
                 TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
             }
@@ -199,7 +200,7 @@
                 catch (final UnknownTransactionException ute)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_6")) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -207,7 +208,7 @@
                 catch (final TransactionRolledBackException trbe)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_7")) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -217,7 +218,7 @@
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_8") ;
                     final String message = MessageFormat.format(pattern, new Object[] {se}) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -228,7 +229,7 @@
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_9", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -243,7 +244,7 @@
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_10", new Object[] {instanceIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                     WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_11")) ;
                 TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
             }
@@ -284,7 +285,7 @@
                 catch (final UnknownTransactionException ute)
                 {
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                         WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_12")) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
@@ -294,7 +295,7 @@
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, messageId) ;
                     final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_13") ;
                     final String message = MessageFormat.format(pattern, new Object[] {se}) ;
-                    final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -305,7 +306,7 @@
                         WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_14", th) ;
                     }
                     final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                    final SoapFault soapFault = new SoapFault(th) ;
+                    final SoapFault soapFault = new SoapFault10(th) ;
                     TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
                     return ;
                 }
@@ -320,7 +321,7 @@
                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_15", new Object[] {instanceIdentifier}) ;
                 }
                 final AddressingContext faultAddressingContext = AddressingContext.createFaultContext(addressingContext, MessageId.getMessageId()) ;
-                final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
                     WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl_16")) ;
                 TerminationParticipantClient.getClient().sendSoapFault(faultAddressingContext, soapFault, instanceIdentifier) ;
             }

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/deploy/TransactionInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/deploy/TransactionInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/deploy/TransactionInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -40,6 +40,7 @@
 import com.arjuna.wst.messaging.ParticipantCompletionParticipantProcessorImpl;
 import com.arjuna.wst.messaging.ParticipantProcessorImpl;
 import com.arjuna.wst.messaging.TerminatorParticipantProcessorImpl;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Initialise the transaction services.
@@ -53,14 +54,20 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        CompletionCoordinatorProcessor.setProcessor(new CompletionCoordinatorProcessorImpl()) ;
-        ParticipantProcessor.setProcessor(new ParticipantProcessorImpl()) ;
-        CoordinatorProcessor.setProcessor(new CoordinatorProcessorImpl()) ;
-        TerminationCoordinatorProcessor.setProcessor(new TerminatorParticipantProcessorImpl()) ;
-        CoordinatorCompletionParticipantProcessor.setProcessor(new CoordinatorCompletionParticipantProcessorImpl()) ;
-        ParticipantCompletionParticipantProcessor.setProcessor(new ParticipantCompletionParticipantProcessorImpl()) ;
-        CoordinatorCompletionCoordinatorProcessor.setProcessor(new CoordinatorCompletionCoordinatorProcessorImpl()) ;
-        ParticipantCompletionCoordinatorProcessor.setProcessor(new ParticipantCompletionCoordinatorProcessorImpl()) ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10) {
+           public void run() {
+               CompletionCoordinatorProcessor.setProcessor(new CompletionCoordinatorProcessorImpl()) ;
+               ParticipantProcessor.setProcessor(new ParticipantProcessorImpl()) ;
+               CoordinatorProcessor.setProcessor(new CoordinatorProcessorImpl()) ;
+               TerminationCoordinatorProcessor.setProcessor(new TerminatorParticipantProcessorImpl()) ;
+               CoordinatorCompletionParticipantProcessor.setProcessor(new CoordinatorCompletionParticipantProcessorImpl()) ;
+               ParticipantCompletionParticipantProcessor.setProcessor(new ParticipantCompletionParticipantProcessorImpl()) ;
+               CoordinatorCompletionCoordinatorProcessor.setProcessor(new CoordinatorCompletionCoordinatorProcessorImpl()) ;
+               ParticipantCompletionCoordinatorProcessor.setProcessor(new ParticipantCompletionCoordinatorProcessorImpl()) ;
+           }
+        };
+        // this is the last WST callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WST10);
     }
 
     /**

Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/engines/CoordinatorEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/messaging/engines/CoordinatorEngine.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/messaging/engines/CoordinatorEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -25,6 +25,7 @@
 import javax.xml.namespace.QName;
 
 import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
 import com.arjuna.webservices.SoapFaultType;
 import com.arjuna.webservices.logging.WSTLogger;
 import com.arjuna.webservices.util.TransportTimer;
@@ -32,7 +33,7 @@
 import com.arjuna.webservices.wsaddr.AttributedURIType;
 import com.arjuna.webservices.wsaddr.EndpointReferenceType;
 import com.arjuna.webservices.wsaddr.RelationshipType;
-import com.arjuna.webservices.wsarj.ArjunaContext;
+import com.arjuna.webservices.wsarj.ArjunaContext;      
 import com.arjuna.webservices.wsarj.InstanceIdentifier;
 import com.arjuna.webservices.wsat.CoordinatorInboundEvents;
 import com.arjuna.webservices.wsat.NotificationType;
@@ -603,7 +604,7 @@
             }
             
             final String message = WSTLogger.log_mesg.getString("com.arjuna.wst.messaging.engines.CoordinatorEngine.sendInvalidState_1") ;
-            final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
+            final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
             ParticipantClient.getClient().sendSoapFault(responseContext, soapFault, instanceIdentifier) ;
         }
         catch (final Throwable th)

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BACoordinatorCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,109 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst.stub;
+
+import com.arjuna.webservices.wsba.State;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipantEngine;
+
+public class BACoordinatorCompletionParticipantManagerStub implements com.arjuna.wst.BAParticipantManager
+{
+    private final CoordinatorCompletionParticipantEngine coordinator ;
+    
+    public BACoordinatorCompletionParticipantManagerStub (final CoordinatorCompletionParticipantEngine coordinator)
+        throws Exception
+    {
+        this.coordinator = coordinator ;
+    }
+
+    public void exit ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state 
+         * Exiting -> no response
+         * Ended -> ended
+         */
+        final State state = coordinator.exit() ;
+        if (state == State.STATE_EXITING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void completed ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        // returns original state
+        final State state = coordinator.completed() ;
+        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void fault ()
+        throws SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> no response
+         * Faulting-Compensating -> no response 
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.fault() ;
+        if (state != State.STATE_ENDED)
+        {
+            throw new SystemException() ;
+        }
+    }
+
+    public void unknown()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public void error()
+        throws SystemException
+    {
+        fault() ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BAParticipantCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,109 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst.stub;
+
+import com.arjuna.webservices.wsba.State;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+
+public class BAParticipantCompletionParticipantManagerStub implements com.arjuna.wst.BAParticipantManager
+{
+    private final ParticipantCompletionParticipantEngine coordinator ;
+    
+    public BAParticipantCompletionParticipantManagerStub (final ParticipantCompletionParticipantEngine coordinator)
+        throws Exception
+    {
+        this.coordinator = coordinator ;
+    }
+
+    public synchronized void exit ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state 
+         * Exiting -> no response
+         * Ended -> ended
+         */
+        final State state = coordinator.exit() ;
+        if (state == State.STATE_EXITING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void completed ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        // returns original state
+        final State state = coordinator.completed() ;
+        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void fault ()
+        throws SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> no response
+         * Faulting-Compensating -> no response 
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.fault() ;
+        if (state != State.STATE_ENDED)
+        {
+            throw new SystemException() ;
+        }
+    }
+
+    public void unknown()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public void error()
+        throws SystemException
+    {
+        fault() ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessActivityTerminatorStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,386 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessActivityTerminatorStub.java,v 1.7.6.1 2005/11/22 10:35:29 kconner Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFault10;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.ArjunaContext;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsarjtx.NotificationType;
+import com.arjuna.webservices.wsarjtx.client.TerminationCoordinatorClient;
+import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantCallback;
+import com.arjuna.webservices.wsarjtx.processors.TerminationParticipantProcessor;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+public class BusinessActivityTerminatorStub implements com.arjuna.wst.BusinessActivityTerminator
+{
+    private EndpointReferenceType          _terminationParticipant         = null;
+    private final String _id ;
+    
+    public BusinessActivityTerminatorStub (final String id, final EndpointReferenceType terminationParticipant)
+        throws Exception
+    {
+        _terminationParticipant         = terminationParticipant;
+        _id = id ;
+    }
+
+    public void close ()
+        throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendClose(addressingContext, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminatorCoordinatorProcessor.removeCallback(_id) ;
+        }
+        
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedClosed())
+            {
+                return ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new TransactionRolledBackException();
+                }
+                else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public void cancel ()
+        throws FaultedException, UnknownTransactionException, SystemException
+    {
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendCancel(addressingContext, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminatorCoordinatorProcessor.removeCallback(_id) ;
+        }
+        
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCancelled())
+            {
+                return ;
+            }
+            else if (callback.receivedFaulted())
+            {
+                throw new FaultedException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public void complete ()
+        throws FaultedException, UnknownTransactionException, SystemException
+    {
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminatorCoordinatorProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminatorCoordinatorProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendComplete(addressingContext, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminatorCoordinatorProcessor.removeCallback(_id) ;
+        }
+        
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCompleted())
+            {
+                return ;
+            }
+            else if (callback.receivedFaulted())
+            {
+                throw new FaultedException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    /**
+     * @message com.arjuna.wst.stub.BusinessActivityTerminatorStub_1 [com.arjuna.wst.stub.BusinessActivityTerminatorStub_1] - Unknown error
+     */
+    public void error ()
+        throws SystemException
+    {
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_terminationParticipant, MessageId.getMessageId()) ;
+        final SoapFault soapFault = new SoapFault10(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME,
+                WSTLogger.log_mesg.getString("com.arjuna.wst.stub.BusinessActivityTerminatorStub_1")) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendSoapFault(addressingContext, soapFault, new InstanceIdentifier(_id)) ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+    }
+
+    private static class RequestCallback extends TerminationParticipantCallback
+    {
+        /**
+         * The addressing context.
+         */
+        private AddressingContext addressingContext ;
+        /**
+         * The arjuna context.
+         */
+        private ArjunaContext arjunaContext ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        /**
+         * The completed notification flag.
+         */
+        private boolean completed ;
+        /**
+         * The cancelled notification flag.
+         */
+        private boolean cancelled ;
+        /**
+         * The closed notification flag.
+         */
+        private boolean closed ;
+        /**
+         * The faulted notification flag.
+         */
+        private boolean faulted ;
+        
+        /**
+         * Get the addressing context.
+         * @return The addressing context.
+         */
+        AddressingContext getAddressingContext()
+        {
+            return addressingContext ;
+        }
+        
+        /**
+         * Get the arjuna context.
+         * @return The arjuna context.
+         */
+        ArjunaContext getArjunaContext()
+        {
+            return arjunaContext ;
+        }
+        
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+        
+        /**
+         * Did we receive a completed notification?
+         * @return True if completed, false otherwise.
+         */
+        boolean receivedCompleted()
+        {
+            return completed ;
+        }
+        
+        /**
+         * Did we receive a cancelled notification?
+         * @return True if cancelled, false otherwise.
+         */
+        boolean receivedCancelled()
+        {
+            return cancelled ;
+        }
+        
+        /**
+         * Did we receive a closed notification?
+         * @return True if closed, false otherwise.
+         */
+        boolean receivedClosed()
+        {
+            return closed ;
+        }
+        
+        /**
+         * Did we receive a faulted notification?
+         * @return True if faulted, false otherwise.
+         */
+        boolean receivedFaulted()
+        {
+            return faulted ;
+        }
+        
+        /**
+         * A completed response.
+         * @param completed The completed notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void completed(final NotificationType completed, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.completed = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A cancelled response.
+         * @param cancelled The cancelled notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void cancelled(final NotificationType cancelled, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.cancelled  = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A closed response.
+         * @param closed The closed notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void closed(final NotificationType closed, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.closed = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A faulted response.
+         * @param faulted The faulted notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void faulted(final NotificationType faulted, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.faulted = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+        
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.soapFault = soapFault ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithCoordinatorCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,255 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithCoordinatorCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import java.io.StringWriter;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices.util.StreamHelper;
+import com.arjuna.webservices.wsba.State;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.PersistableParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionCoordinatorEngine;
+
+public class BusinessAgreementWithCoordinatorCompletionStub implements BusinessAgreementWithCoordinatorCompletionParticipant, PersistableParticipant
+{
+    private static final QName QNAME_BACC_PARTICIPANT = new QName("baccParticipant") ;
+    private CoordinatorCompletionCoordinatorEngine participant ;
+
+    public BusinessAgreementWithCoordinatorCompletionStub (final CoordinatorCompletionCoordinatorEngine participant)
+        throws Exception
+    {
+        this.participant = participant ;
+    }
+
+    public synchronized void close ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> no response
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.close() ;
+        
+        if (state == State.STATE_CLOSING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void cancel ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> no response
+         * Canceling-Active -> no response
+         * Canceling-Completing -> no response
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.cancel() ;
+        
+        if ((state == State.STATE_CANCELING) || (state == State.STATE_CANCELING_ACTIVE) ||
+            (state == State.STATE_CANCELING_COMPLETING))
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void compensate ()
+        throws FaultedException, WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> no response
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.compensate() ;
+        if (state == State.STATE_COMPENSATING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state == State.STATE_FAULTING_COMPENSATING)
+        {
+            throw new FaultedException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void complete ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> canceling
+         * Completing -> no response
+         * Completed -> completed
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> exiting
+         * Ended -> illegal state
+         */
+        final State state = participant.complete() ;
+        if (state == State.STATE_COMPLETED)
+        {
+            return ;
+        }
+        else if ((state == State.STATE_FAULTING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) ||
+            (state == State.STATE_EXITING))
+        {
+            throw new SystemException() ;
+        }
+        throw new WrongStateException() ;
+    }
+
+    public String status ()
+        throws SystemException
+    {
+        final State state = participant.getStatus() ;
+        return (state == null ? null : state.getValue().getLocalPart()) ;
+    }
+
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public synchronized void error ()
+        throws SystemException
+    {
+        participant.cancel() ;
+    }
+    
+    /**
+     * @message com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2 [com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(participant.getId()) ;
+            
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_BACC_PARTICIPANT) ;
+            participant.getParticipant().writeContent(writer) ;
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+            
+            oos.packString(writer.toString()) ;
+            
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_2", th) ;
+            return false ;
+        }
+    }
+    
+    /**
+     * @message com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3 [com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        // KEV - rework
+        return false ;
+//        try
+//        {
+//            final String id = ios.unpackString() ;
+//            final String eprValue = ios.unpackString() ;
+//            
+//            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+//            StreamHelper.checkNextStartTag(reader, QNAME_BACC_PARTICIPANT) ;
+//            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
+//            
+//            _id = id ;
+//            _businessAgreementWithCoordinatorCompletionParticipant = endpointReferenceType ;
+//            return true ;
+//        }
+//        catch (final Throwable th)
+//        {
+//            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub_3", th) ;
+//            return false ;
+//        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/BusinessAgreementWithParticipantCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,215 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithParticipantCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import java.io.StringWriter;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices.util.StreamHelper;
+import com.arjuna.webservices.wsba.State;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.PersistableParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionCoordinatorEngine;
+
+public class BusinessAgreementWithParticipantCompletionStub implements BusinessAgreementWithParticipantCompletionParticipant, PersistableParticipant
+{
+    private static final QName QNAME_BAPC_PARTICIPANT = new QName("bapcParticipant") ;
+    
+    private ParticipantCompletionCoordinatorEngine participant ;
+    
+    public BusinessAgreementWithParticipantCompletionStub (final ParticipantCompletionCoordinatorEngine participant)
+        throws Exception
+    {
+        this.participant = participant ;
+    }
+
+    public synchronized void close ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> no response
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.close() ;
+        
+        if (state == State.STATE_CLOSING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void cancel ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> no response
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.cancel() ;
+        
+        if (state == State.STATE_CANCELING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void compensate ()
+        throws FaultedException, WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> no answer
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.compensate() ;
+        if (state == State.STATE_COMPENSATING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state == State.STATE_FAULTING_COMPENSATING)
+        {
+            throw new FaultedException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public String status ()
+        throws SystemException
+    {
+        final State state = participant.getStatus() ;
+        return (state == null ? null : state.getValue().getLocalPart()) ;
+    }
+
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public synchronized void error ()
+        throws SystemException
+    {
+        participant.cancel() ;
+    }
+    
+    /**
+     * @message com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2 [com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(participant.getId()) ;
+            
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_BAPC_PARTICIPANT) ;
+            participant.getParticipant().writeContent(writer) ;
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+            
+            oos.packString(writer.toString()) ;
+            
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_2", th) ;
+            return false ;
+        }
+    }
+    
+    /**
+     * @message com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3 [com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        // KEV - rework
+        return false ;
+//        try
+//        {
+//            final String id = ios.unpackString() ;
+//            final String eprValue = ios.unpackString() ;
+//            
+//            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+//            StreamHelper.checkNextStartTag(reader, QNAME_BAPC_PARTICIPANT) ;
+//            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
+//            
+//            _id = id ;
+//            _businessAgreementWithParticipantCompletionParticipant = endpointReferenceType ;
+//            return true ;
+//        }
+//        catch (final Throwable th)
+//        {
+//            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub_3", th) ;
+//            return false ;
+//        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/CompletionStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/CompletionStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/CompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/CompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,248 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ * 
+ * CompletionStub.java
+ */
+
+package com.arjuna.wst.stub;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsaddr.AddressingContext;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.ArjunaContext;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsat.NotificationType;
+import com.arjuna.webservices.wsat.client.CompletionCoordinatorClient;
+import com.arjuna.webservices.wsat.processors.CompletionInitiatorCallback;
+import com.arjuna.webservices.wsat.processors.CompletionInitiatorProcessor;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+public class CompletionStub implements
+		com.arjuna.wst.CompletionCoordinatorParticipant
+{
+    private EndpointReferenceType _completionCoordinator = null;
+    private String _id;
+
+	public CompletionStub (final String id, final EndpointReferenceType completionCoordinator)
+			throws Exception
+	{	
+		_completionCoordinator = completionCoordinator;
+		_id = id;
+	}
+
+	public void commit () throws TransactionRolledBackException,
+			UnknownTransactionException, SystemException
+	{
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_completionCoordinator, MessageId.getMessageId()) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
+        completionInitiator.registerCallback(_id, callback) ;
+        try
+        {
+            CompletionCoordinatorClient.getClient().sendCommit(addressingContext, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            th.printStackTrace() ;
+            throw new SystemException() ;
+        }
+        finally
+        {
+            completionInitiator.removeCallback(_id) ;
+        }
+        
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCommitted())
+            {
+                return ;
+            }
+            else if (callback.receivedAborted())
+            {
+                throw new TransactionRolledBackException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
+            {
+                throw new UnknownTransactionException();
+            }
+        }
+        
+        throw new SystemException() ;
+	}
+
+	public void rollback () throws UnknownTransactionException, SystemException
+	{
+        final AddressingContext addressingContext = AddressingContext.createRequestContext(_completionCoordinator, MessageId.getMessageId()) ;
+        
+        final RequestCallback callback = new RequestCallback() ;
+        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
+        completionInitiator.registerCallback(_id, callback) ;
+        try
+        {
+            CompletionCoordinatorClient.getClient().sendRollback(addressingContext, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            th.printStackTrace() ;
+            throw new SystemException() ;
+        }
+        finally
+        {
+            completionInitiator.removeCallback(_id) ;
+        }
+        
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedAborted())
+            {
+                return ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
+            {
+                throw new UnknownTransactionException();
+            }
+        }
+        
+        throw new SystemException() ;
+	}
+    
+    private static class RequestCallback extends CompletionInitiatorCallback
+    {
+        /**
+         * The addressing context.
+         */
+        private AddressingContext addressingContext ;
+        /**
+         * The arjuna context.
+         */
+        private ArjunaContext arjunaContext ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        /**
+         * The aborted notification flag.
+         */
+        private boolean aborted ;
+        /**
+         * The committed notification flag.
+         */
+        private boolean committed ;
+        
+        /**
+         * Get the addressing context.
+         * @return The addressing context.
+         */
+        AddressingContext getAddressingContext()
+        {
+            return addressingContext ;
+        }
+        
+        /**
+         * Get the arjuna context.
+         * @return The arjuna context.
+         */
+        ArjunaContext getArjunaContext()
+        {
+            return arjunaContext ;
+        }
+        
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+        
+        /**
+         * Did we receive a aborted notification?
+         * @return True if aborted, false otherwise.
+         */
+        boolean receivedAborted()
+        {
+            return aborted ;
+        }
+        
+        /**
+         * Did we receive a committed notification?
+         * @return True if committed, false otherwise.
+         */
+        boolean receivedCommitted()
+        {
+            return committed ;
+        }
+        
+        /**
+         * A aborted response.
+         * @param aborted The aborted notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void aborted(final NotificationType aborted, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.aborted = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * An committed response.
+         * @param committed The committed notification.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void committed(final NotificationType committed, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.committed  = true ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+        
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault.
+         * @param addressingContext The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingContext addressingContext,
+            final ArjunaContext arjunaContext)
+        {
+            this.soapFault = soapFault ;
+            this.addressingContext = addressingContext ;
+            this.arjunaContext = arjunaContext ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Durable2PCStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Durable2PCStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Durable2PCStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Durable2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,46 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: Durable2PCStub.java,v 1.1.2.3 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.wst.Durable2PCParticipant;
+
+public class Durable2PCStub extends ParticipantStub implements Durable2PCParticipant
+{
+    // default ctor for crash recovery
+    public Durable2PCStub() throws Exception {
+        super(null, true, null);
+    }
+
+    public Durable2PCStub(final String id, final EndpointReferenceType twoPCParticipant)
+        throws Exception
+    {
+        super(id, true, twoPCParticipant) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/ParticipantStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/ParticipantStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/ParticipantStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/ParticipantStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,234 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: ParticipantStub.java,v 1.1.2.1 2005/11/22 10:35:28 kconner Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices.util.StreamHelper;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsat.State;
+import com.arjuna.wst.Aborted;
+import com.arjuna.wst.Participant;
+import com.arjuna.wst.PersistableParticipant;
+import com.arjuna.wst.Prepared;
+import com.arjuna.wst.ReadOnly;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.Vote;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.CoordinatorEngine;
+
+public class ParticipantStub implements Participant, PersistableParticipant
+{
+    private static final QName QNAME_TWO_PC_PARTICIPANT = new QName("twoPCParticipant") ;
+    private CoordinatorEngine coordinator ;
+
+    public ParticipantStub(final String id, final boolean durable, final EndpointReferenceType twoPCParticipant)
+        throws Exception
+    {
+        coordinator = new CoordinatorEngine(id, durable, twoPCParticipant) ;
+    }
+
+    public Vote prepare()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - aborted or read only
+         * Active - illegal state
+         * Preparing - no answer
+         * Prepared - illegal state
+         * PreparedSuccess - prepared
+         * Committing - illegal state
+         * Aborting - aborting
+         */
+        final State state = coordinator.prepare() ;
+        if (state == State.STATE_PREPARED_SUCCESS)
+        {
+            return new Prepared() ;
+        }
+        else if (state == State.STATE_ABORTING)
+        {
+            return new Aborted() ;
+        }
+        else if (state == null)
+        {
+            if (coordinator.isReadOnly())
+            {
+                return new ReadOnly() ;
+            }
+            else
+            {
+                return new Aborted() ;
+            }
+        }
+        else if (state == State.STATE_PREPARING)
+        {
+            throw new SystemException() ;
+        }
+        else
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void commit()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - committed
+         * Active - illegal state
+         * Preparing - illegal state
+         * Prepared - illegal state
+         * PreparedSuccess - illegal state
+         * Committing - no response
+         * Aborting - illegal state
+         */
+        final State state = coordinator.commit() ;
+        if (state != null)
+        {
+            if (state == State.STATE_COMMITTING)
+            {
+                // typically means no response from the remote end.
+                // throw a comm exception to distinguish this case from the
+                // one where the remote end itself threw a SystemException.
+                throw new SystemCommunicationException();
+            }
+            else
+            {
+                throw new WrongStateException() ;
+            }
+        }
+    }
+
+    public void rollback()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - aborted
+         * Active - illegal state
+         * Preparing - illegal state
+         * Prepared - illegal state
+         * PreparedSuccess - illegal state
+         * Committing - illegal state
+         * Aborting - no response
+         */
+        final State state = coordinator.rollback() ;
+        if (state != null)
+        {
+            if (state == State.STATE_ABORTING)
+            {
+                throw new SystemException() ;
+            }
+            else
+            {
+                throw new WrongStateException() ;
+            }
+        }
+    }
+
+    public void unknown()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public void error()
+        throws SystemException
+    {
+        try
+        {
+            rollback() ;
+        }
+        catch (final WrongStateException wse) {} // ignore
+    }
+
+    /**
+     * @message com.arjuna.wst.stub.ParticipantStub_1 [com.arjuna.wst.stub.ParticipantStub_1] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(coordinator.getId()) ;
+            oos.packBoolean(coordinator.isDurable()) ;
+
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_TWO_PC_PARTICIPANT) ;
+            coordinator.getParticipant().writeContent(writer) ;
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+            sw.close();
+
+            String tmp = writer.toString();
+            String swString = sw.toString();
+            oos.packString(swString) ;
+
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.ParticipantStub_1", th) ;
+            return false ;
+        }
+    }
+
+    /**
+     * @message com.arjuna.wst.stub.ParticipantStub_2 [com.arjuna.wst.stub.ParticipantStub_2] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        try
+        {
+            final String id = ios.unpackString() ;
+            final boolean durable = ios.unpackBoolean() ;
+            final String eprValue = ios.unpackString() ;
+
+            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+            StreamHelper.checkNextStartTag(reader, QNAME_TWO_PC_PARTICIPANT) ;
+            final EndpointReferenceType endpointReferenceType = new EndpointReferenceType(reader) ;
+
+            coordinator = new CoordinatorEngine(id, durable, endpointReferenceType, State.STATE_PREPARED_SUCCESS) ;
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst.stub.ParticipantStub_2", th) ;
+            return false ;
+        }
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Volatile2PCStub.java (from rev 19476, labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/wst/stub/Volatile2PCStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Volatile2PCStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/Volatile2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, 2004,
+ *
+ * Arjuna Technologies Limited.
+ *
+ * $Id: Volatile2PCStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst.stub;
+
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.wst.Volatile2PCParticipant;
+
+public class Volatile2PCStub extends ParticipantStub implements Volatile2PCParticipant
+{
+    public Volatile2PCStub(final String id, final EndpointReferenceType twoPCParticipant)
+        throws Exception
+    {
+        super(id, false, twoPCParticipant) ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ExceptionType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ExceptionType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ExceptionType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,180 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for ExceptionType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ExceptionType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="soapFaultType" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;element name="subCode" type="{http://www.w3.org/2001/XMLSchema}QName"/>
+ *         &lt;element name="reason" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "ExceptionType", propOrder = {
+    "soapFaultType",
+    "subCode",
+    "reason",
+    "any"
+})
+public class ExceptionType {
+
+    @XmlElement(required = true)
+    protected String soapFaultType;
+    @XmlElement(required = true)
+    protected QName subCode;
+    @XmlElement(required = true)
+    protected String reason;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the soapFaultType property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getSoapFaultType() {
+        return soapFaultType;
+    }
+
+    /**
+     * Sets the value of the soapFaultType property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setSoapFaultType(String value) {
+        this.soapFaultType = value;
+    }
+
+    /**
+     * Gets the value of the subCode property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link QName }
+     *     
+     */
+    public QName getSubCode() {
+        return subCode;
+    }
+
+    /**
+     * Sets the value of the subCode property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link QName }
+     *     
+     */
+    public void setSubCode(QName value) {
+        this.subCode = value;
+    }
+
+    /**
+     * Gets the value of the reason property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link String }
+     *     
+     */
+    public String getReason() {
+        return reason;
+    }
+
+    /**
+     * Sets the value of the reason property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link String }
+     *     
+     */
+    public void setReason(String value) {
+        this.reason = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/NotificationType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/NotificationType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/NotificationType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,95 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for NotificationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="NotificationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "NotificationType", propOrder = {
+    "any"
+})
+public class NotificationType {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ObjectFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ObjectFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/ObjectFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,131 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the com.arjuna.schemas.ws._2005._10.wsarjtx package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Close_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Close");
+    private final static QName _Closed_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Closed");
+    private final static QName _Cancel_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Cancel");
+    private final static QName _Completed_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Completed");
+    private final static QName _Faulted_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Faulted");
+    private final static QName _Cancelled_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Cancelled");
+    private final static QName _Complete_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Complete");
+    private final static QName _Fault_QNAME = new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "Fault");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.arjuna.schemas.ws._2005._10.wsarjtx
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link ExceptionType }
+     * 
+     */
+    public ExceptionType createExceptionType() {
+        return new ExceptionType();
+    }
+
+    /**
+     * Create an instance of {@link NotificationType }
+     * 
+     */
+    public NotificationType createNotificationType() {
+        return new NotificationType();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Close")
+    public JAXBElement<NotificationType> createClose(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Close_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Closed")
+    public JAXBElement<NotificationType> createClosed(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Closed_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Cancel")
+    public JAXBElement<NotificationType> createCancel(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Cancel_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Completed")
+    public JAXBElement<NotificationType> createCompleted(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Completed_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Faulted")
+    public JAXBElement<NotificationType> createFaulted(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Faulted_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Cancelled")
+    public JAXBElement<NotificationType> createCancelled(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Cancelled_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Complete")
+    public JAXBElement<NotificationType> createComplete(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Complete_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ExceptionType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", name = "Fault")
+    public JAXBElement<ExceptionType> createFault(ExceptionType value) {
+        return new JAXBElement<ExceptionType>(_Fault_QNAME, ExceptionType.class, null, value);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,52 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "TerminationCoordinatorPortType", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface TerminationCoordinatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompleteOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Complete")
+    @Oneway
+    public void completeOperation(
+        @WebParam(name = "Complete", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationCoordinatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "TerminationCoordinatorService", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", wsdlLocation = "wsdl/wsarjtx-termination-coordinator-binding.wsdl")
+public class TerminationCoordinatorService
+    extends Service21
+{
+
+    private final static URL TERMINATIONCOORDINATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsarjtx-termination-coordinator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsarjtx-termination-coordinator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        TERMINATIONCOORDINATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public TerminationCoordinatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public TerminationCoordinatorService() {
+        super(TERMINATIONCOORDINATORSERVICE_WSDL_LOCATION, new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationCoordinatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns TerminationCoordinatorPortType
+     */
+    @WebEndpoint(name = "TerminationCoordinatorPortType")
+    public TerminationCoordinatorPortType getTerminationCoordinatorPortType() {
+        return super.getPort(new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationCoordinatorPortType"), TerminationCoordinatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,72 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "TerminationParticipantPortType", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface TerminationParticipantPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelledOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancelled")
+    @Oneway
+    public void cancelledOperation(
+        @WebParam(name = "Cancelled", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FaultedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted")
+    @Oneway
+    public void faultedOperation(
+        @WebParam(name = "Faulted", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FaultOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Fault")
+    @Oneway
+    public void faultOperation(
+        @WebParam(name = "Fault", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        ExceptionType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/TerminationParticipantService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package com.arjuna.schemas.ws._2005._10.wsarjtx;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "TerminationParticipantService", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", wsdlLocation = "wsdl/wsarjtx-termination-participant-binding.wsdl")
+public class TerminationParticipantService
+    extends Service21
+{
+
+    private final static URL TERMINATIONPARTICIPANTSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsarjtx-termination-participant-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsarjtx-termination-participant-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        TERMINATIONPARTICIPANTSERVICE_WSDL_LOCATION = url;
+    }
+
+    public TerminationParticipantService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public TerminationParticipantService() {
+        super(TERMINATIONPARTICIPANTSERVICE_WSDL_LOCATION, new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationParticipantService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns TerminationParticipantPortType
+     */
+    @WebEndpoint(name = "TerminationParticipantPortType")
+    public TerminationParticipantPortType getTerminationParticipantPortType() {
+        return super.getPort(new QName("http://schemas.arjuna.com/ws/2005/10/wsarjtx", "TerminationParticipantPortType"), TerminationParticipantPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/package-info.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/package-info.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/schemas/ws/_2005/_10/wsarjtx/package-info.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,2 @@
+ at javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package com.arjuna.schemas.ws._2005._10.wsarjtx;

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/ArjunaTX11Constants.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/ArjunaTX11Constants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/ArjunaTX11Constants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,68 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx;
+
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing Arjuna WS constants.
+ */
+public interface ArjunaTX11Constants
+{
+
+    /**
+     * The termination participant service name.
+     */
+    public String TERMINATION_PARTICIPANT_SERVICE_NAME = "TerminationParticipantService" ;
+    /**
+     * The termination participant service qname.
+     */
+    public QName TERMINATION_PARTICIPANT_SERVICE_QNAME = new QName(ArjunaTXConstants.WSARJTX_NAMESPACE, TERMINATION_PARTICIPANT_SERVICE_NAME, ArjunaTXConstants.WSARJTX_PREFIX) ;
+
+    /**
+     * The termination participant soap service port name
+     */
+     public String TERMINATION_PARTICIPANT_PORT_NAME = "TerminationParticipantPortType";
+    /**
+     * The termination participant soap service port qname
+     */
+     public QName TERMINATION_PARTICIPANT_PORT_QNAME = new QName(ArjunaTXConstants.WSARJTX_NAMESPACE, TERMINATION_PARTICIPANT_PORT_NAME, ArjunaTXConstants.WSARJTX_PREFIX);
+
+    /**
+     * The termination coordinator service name.
+     */
+    public String TERMINATION_COORDINATOR_SERVICE_NAME = "TerminationCoordinatorService" ;
+    /**
+     * The termination coordinator service qname.
+     */
+    public QName TERMINATION_COORDINATOR_SERVICE_QNAME = new QName(ArjunaTXConstants.WSARJTX_NAMESPACE, TERMINATION_COORDINATOR_SERVICE_NAME, ArjunaTXConstants.WSARJTX_PREFIX) ;
+
+    /**
+     * The termination coordinator soap service port name
+     */
+     public String TERMINATION_COORDINATOR_PORT_NAME = "TerminationCoordinatorPortType";
+    /**
+     * The termination coordinator soap service port qname
+     */
+     public QName TERMINATION_COORDINATOR_PORT_QNAME = new QName(ArjunaTXConstants.WSARJTX_NAMESPACE, TERMINATION_COORDINATOR_PORT_NAME, ArjunaTXConstants.WSARJTX_PREFIX);
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,70 @@
+package com.arjuna.webservices11.wsarjtx.client;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.*;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.handler.Handler;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Nov 16, 2007
+ * Time: 6:02:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class TerminationClient
+{
+    // we need a service per thread
+
+    private static ThreadLocal<TerminationParticipantService> terminationParticipantService = new ThreadLocal<TerminationParticipantService>();
+
+    private static ThreadLocal<TerminationCoordinatorService> terminationCoordinatorService = new ThreadLocal<TerminationCoordinatorService>();
+
+    private static TerminationParticipantService getTerminationParticipantService()
+    {
+        if (terminationParticipantService.get() == null) {
+            terminationParticipantService.set(new TerminationParticipantService());
+        }
+        return terminationParticipantService.get();
+    }
+
+    private static TerminationCoordinatorService getTerminationCoordinatorService()
+    {
+        if (terminationCoordinatorService.get() == null) {
+            terminationCoordinatorService.set(new TerminationCoordinatorService());
+        }
+        return terminationCoordinatorService.get();
+    }
+
+    public static TerminationParticipantPortType getTerminationParticipantPort(AddressingProperties addressingProperties)
+    {
+        TerminationParticipantService service = getTerminationParticipantService();
+        TerminationParticipantPortType port = service.getPort(TerminationParticipantPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+
+    public static TerminationCoordinatorPortType getRegistrationPort(AddressingProperties addressingProperties)
+    {
+        TerminationCoordinatorService service = getTerminationCoordinatorService();
+        TerminationCoordinatorPortType port = service.getPort(TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
+        BindingProvider bindingProvider = (BindingProvider)port;
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addressingProperties);
+	    // jbossws should do this for us . . .
+	    requestContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addressingProperties);
+
+        return port;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationCoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,148 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.client;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorPortType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Terminator Participant.
+ * @author kevin
+ */
+public class TerminationCoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final TerminationCoordinatorClient CLIENT = new TerminationCoordinatorClient() ;
+
+    /**
+     * The complete action.
+     */
+    private AttributedURI completeAction = null;
+    /**
+     * The close action.
+     */
+    private AttributedURI closeAction = null;
+    /**
+     * The cancel action.
+     */
+    private AttributedURI cancelAction = null;
+
+    /**
+     * Construct the terminator participant client.
+     */
+    private TerminationCoordinatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            completeAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_COMPLETE);
+            closeAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_CLOSE);
+            cancelAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_CANCEL);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        //final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        //AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        //ClientPolicy.register(handlerRegistry) ;
+    }
+
+    /**
+     * Send a complete request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendComplete(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, completeAction);
+        final NotificationType complete = new NotificationType();
+
+        port.completeOperation(complete);
+    }
+
+    /**
+     * Send a close request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClose(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, closeAction);
+        final NotificationType close = new NotificationType();
+
+        port.closeOperation(close);
+    }
+
+    /**
+     * Send a cancel request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancel(final W3CEndpointReference coordinator, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationCoordinatorPortType port = getPort(coordinator, addressingProperties, identifier, cancelAction);
+        final NotificationType cancel = new NotificationType();
+
+        port.cancelOperation(cancel);
+    }
+
+    /**
+     * Get the Terminator Coordinator client singleton.
+     * @return The Terminator Coordinator client singleton.
+     */
+    public static TerminationCoordinatorClient getClient()
+    {
+        return CLIENT ;
+    }
+
+    private TerminationCoordinatorPortType getPort(final W3CEndpointReference endpoint,
+                                                   final AddressingProperties addressingProperties,
+                                                   final InstanceIdentifier identifier,
+                                                   final AttributedURI action)
+    {
+        // we only need the message id from the addressing properties as the address is already wrapped up
+        // in the ednpoint reference. also the identifier should already be installed in the endpoint
+        // reference as a reference parameter so we don't need that either
+        return WSARJTXClient.getTerminationCoordinatorPort(endpoint, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/TerminationParticipantClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.client;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.ExceptionType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Terminator Coordinator.
+ * @author kevin
+ */
+public class TerminationParticipantClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final TerminationParticipantClient CLIENT = new TerminationParticipantClient() ;
+
+    /**
+     * The completed action.
+     */
+    private AttributedURI completedAction = null;
+    /**
+     * The closed action.
+     */
+    private AttributedURI closedAction = null;
+    /**
+     * The cancelled action.
+     */
+    private AttributedURI cancelledAction = null;
+    /**
+     * The faulted action.
+     */
+    private AttributedURI faultedAction = null;
+    /**
+     * The SOAP fault action.
+     */
+    private AttributedURI soapFaultAction = null;
+
+    /**
+     * Construct the terminator coordinator client.
+     */
+    private TerminationParticipantClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            completedAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_COMPLETED);
+            closedAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_CLOSED);
+            cancelledAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_CANCELLED);
+            faultedAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_FAULTED);
+            soapFaultAction = builder.newURI(ArjunaTXConstants.WSARJTX_ACTION_SOAP_FAULT);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+    }
+
+    /**
+     * Send a completed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompleted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, completedAction);
+        final NotificationType completed = new NotificationType();
+
+        port.completedOperation(completed);
+    }
+
+    /**
+     * Send a closed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClosed(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, closedAction);
+        final NotificationType closed = new NotificationType();
+
+        port.closedOperation(closed);
+    }
+
+    /**
+     * Send a cancelled request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancelled(final W3CEndpointReference participant,final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, cancelledAction);
+        final NotificationType cancelled = new NotificationType();
+
+        port.cancelledOperation(cancelled);
+    }
+
+    /**
+     * Send a faulted request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendFaulted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, faultedAction);
+        final NotificationType faulted = new NotificationType();
+
+        port.faultedOperation(faulted);
+    }
+
+    /**
+     * Send a fault.
+     * @param addressingProperties The addressing context.
+     * @param soapFault The SOAP fault.
+     * @param identifier The arjuna  instance identifier.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendSoapFault(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        final TerminationParticipantPortType port = getPort(participant, addressingProperties, identifier, soapFaultAction);
+        final ExceptionType fault = new ExceptionType();
+        // we pass the fault type, reason and subcode. we cannot pass the detail and header elements as they are
+        // built from Kev's element types rather than dom element types. this is all we need anyway since we only
+        // see faults containing those values
+        fault.setSoapFaultType(soapFault.getSoapFaultType().getValue());
+        fault.setReason(soapFault.getReason());
+        fault.setSubCode(soapFault.getSubcode());
+
+        port.faultOperation(fault);
+    }
+
+    /**
+     * Get the Terminator Coordinator client singleton.
+     * @return The Terminator Coordinator client singleton.
+     */
+    public static TerminationParticipantClient getClient()
+    {
+        return CLIENT ;
+    }
+
+    private TerminationParticipantPortType getPort(final W3CEndpointReference endpoint,
+                                                   final AddressingProperties addressingProperties,
+                                                   final InstanceIdentifier identifier,
+                                                   final AttributedURI action)
+    {
+        // we only need the message id from the addressing properties as the address is already wrapped up
+        // in the ednpoint reference. also the identifier should already be installed in the endpoint
+        // reference as a reference parameter so we don't need that either
+        return WSARJTXClient.getTerminationParticipantPort(endpoint, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/WSARJTXClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/WSARJTXClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/client/WSARJTXClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,150 @@
+package com.arjuna.webservices11.wsarjtx.client;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorPortType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorService;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantService;
+import com.arjuna.webservices11.wsarj.handler.InstanceIdentifierHandler;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.net.URISyntaxException;
+
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSARJTXClient
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread termination coordinator service instance
+     */
+    private static ThreadLocal<TerminationCoordinatorService> terminationCoordinatorService = new ThreadLocal<TerminationCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread termination participant service instance
+     */
+    private static ThreadLocal<TerminationParticipantService> terminationParticipantService = new ThreadLocal<TerminationParticipantService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a termination coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized TerminationCoordinatorService getTerminationCoordinatorService()
+    {
+        if (terminationCoordinatorService.get() == null) {
+            terminationCoordinatorService.set(new TerminationCoordinatorService());
+        }
+        return terminationCoordinatorService.get();
+    }
+
+    /**
+     * fetch a termination participant service unique to the current thread
+     * @return
+     */
+    private static synchronized TerminationParticipantService getTerminationParticipantService()
+    {
+        if (terminationParticipantService.get() == null) {
+            terminationParticipantService.set(new TerminationParticipantService());
+        }
+        return terminationParticipantService.get();
+    }
+
+    public static TerminationCoordinatorPortType getTerminationCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                                AttributedURI action,
+                                                                                AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        TerminationCoordinatorService service = getTerminationCoordinatorService();
+        // TerminationCoordinatorPortType port = service.getPort(endpointReference, TerminationCoordinatorPortType.class, new AddressingFeature(true, true));
+        TerminationCoordinatorPortType port = service.getPort(endpointReference, TerminationCoordinatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static TerminationParticipantPortType getTerminationParticipantPort(W3CEndpointReference endpointReference,
+                                                                               AttributedURI action,
+                                                                               AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        TerminationParticipantService service = getTerminationParticipantService();
+        // TerminationParticipantPortType port = service.getPort(endpointReference, TerminationParticipantPortType.class, new AddressingFeature(true, true));
+        TerminationParticipantPortType port = service.getPort(endpointReference, TerminationParticipantPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         * TODO - not sure about this?
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,108 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.processors;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.wst11.BusinessActivityTerminator;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Terminator Participant processor.
+ * @author kevin
+ */
+public abstract class TerminationCoordinatorProcessor
+{
+    /**
+     * The participant processor.
+     */
+    private static TerminationCoordinatorProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static TerminationCoordinatorProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static TerminationCoordinatorProcessor setProcessor(final TerminationCoordinatorProcessor processor)
+    {
+        final TerminationCoordinatorProcessor origProcessor = PROCESSOR ;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public abstract void activateParticipant(final BusinessActivityTerminator participant, final String identifier) ;
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public abstract void deactivateParticipant(final BusinessActivityTerminator participant) ;
+
+    /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    public abstract BusinessActivityTerminator getParticipant(final InstanceIdentifier instanceIdentifier) ;
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancel(final NotificationType cancel, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void close(final NotificationType close, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Complete.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void complete(final NotificationType complete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantCallback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantCallback.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantCallback.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,80 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.processors;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Terminator Coordinator callback.
+ * @author kevin
+ */
+public abstract class TerminationParticipantCallback extends Callback
+{
+    /**
+     * A cancelled response.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A closed response.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void closed(final NotificationType closed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A completed response.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A faulted response.
+     * @param faulted The faulted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void faulted(final NotificationType faulted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A SOAP fault response.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/processors/TerminationParticipantProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,140 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.processors;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.processor.BaseNotificationProcessor;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Terminator Coordinator processor.
+ * @author kevin
+ */
+public class TerminationParticipantProcessor extends BaseNotificationProcessor
+{
+    /**
+     * The coordinator processor.
+     */
+    private static final TerminationParticipantProcessor PROCESSOR = new TerminationParticipantProcessor() ;
+
+    /**
+     * Get the processor singleton.
+     * @return The singleton.
+     */
+    public static TerminationParticipantProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Handle a cancelled response.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleCancelled(final NotificationType cancelled, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((TerminationParticipantCallback)callback).cancelled(cancelled, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a closed response.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleClosed(final NotificationType closed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((TerminationParticipantCallback)callback).closed(closed, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a completed response.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleCompleted(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((TerminationParticipantCallback)callback).completed(completed, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a faulted response.
+     * @param faulted The faulted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleFaulted(final NotificationType faulted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((TerminationParticipantCallback)callback).faulted(faulted, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a SOAP fault response.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleSoapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((TerminationParticipantCallback)callback).soapFault(soapFault, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Register a callback for the specific instance identifier.
+     * @param instanceIdentifier The instance identifier.
+     * @param callback The callback for the response.
+     */
+    public void registerCallback(final String instanceIdentifier, final TerminationParticipantCallback callback)
+    {
+        register(instanceIdentifier, callback) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationCoordinatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,110 @@
+
+package com.arjuna.webservices11.wsarjtx.sei;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationCoordinatorPortType;
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "TerminationCoordinatorPortType", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx",
+        wsdlLocation = "/WEB-INF/wsdl/wsarjtx-termination-coordinator-binding.wsdl",
+        serviceName = "TerminationCoordinatorService",
+        portName = "TerminationCoordinatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class TerminationCoordinatorPortTypeImpl implements TerminationCoordinatorPortType
+{
+
+    @Resource
+     private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompleteOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Complete")
+    @Oneway
+    public void completeOperation(
+        @WebParam(name = "Complete", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType complete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationCoordinatorProcessor.getProcessor().complete(complete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType close = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationCoordinatorProcessor.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancel = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationCoordinatorProcessor.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationParticipantPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/sei/TerminationParticipantPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,175 @@
+
+package com.arjuna.webservices11.wsarjtx.sei;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.ExceptionType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.schemas.ws._2005._10.wsarjtx.TerminationParticipantPortType;
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantProcessor;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "TerminationParticipantPortType", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx",
+        wsdlLocation = "/WEB-INF/wsdl/wsarjtx-termination-participant-binding.wsdl",
+        serviceName = "TerminationParticipantService",
+        portName = "TerminationParticipantPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class TerminationParticipantPortTypeImpl implements TerminationParticipantPortType
+{
+
+    @Resource
+     private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType completed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationParticipantProcessor.getProcessor().handleCompleted(completed, inboundAddressProperties, arjunaContext);
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType closed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationParticipantProcessor.getProcessor().handleClosed(closed, inboundAddressProperties, arjunaContext);
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelledOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Cancelled")
+    @Oneway
+    public void cancelledOperation(
+        @WebParam(name = "Cancelled", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancelled = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationParticipantProcessor.getProcessor().handleCancelled(cancelled, inboundAddressProperties, arjunaContext);
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "FaultedOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Faulted")
+    @Oneway
+    public void faultedOperation(
+        @WebParam(name = "Faulted", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType faulted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationParticipantProcessor.getProcessor().handleFaulted(faulted, inboundAddressProperties, arjunaContext);
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     *
+     * @message com.arjuna.webservices11.wsarjtx.sei.TerminationParticipantPortTypeImpl_1 [com.arjuna.webservices11.wsarjtx.sei.TerminationParticipantPortTypeImpl_1] - Invalid soap fault type
+     */
+    @WebMethod(operationName = "FaultOperation", action = "http://schemas.arjuna.com/ws/2005/10/wsarjtx/Fault")
+    @Oneway
+    public void faultOperation(
+        @WebParam(name = "Fault", targetNamespace = "http://schemas.arjuna.com/ws/2005/10/wsarjtx", partName = "parameters")
+        ExceptionType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        String soapFaultTypeName = parameters.getSoapFaultType();
+        String reason = parameters.getReason();
+        QName subcode = parameters.getSubCode();
+        final SoapFault soapFault;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+        try {
+            SoapFaultType soapFaultType = SoapFaultType.toState(soapFaultTypeName);
+            soapFault = new SoapFault11(soapFaultType, subcode, reason);
+        } catch (Exception e) {
+            String message = WSTLogger.log_mesg.getString("com.arjuna.webservices11.wsarjtx.sei.TerminationParticipantPortTypeImpl_1");
+            throw new WebServiceException(message, e);
+        }
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                TerminationParticipantProcessor.getProcessor().handleSoapFault(soapFault, inboundAddressProperties, arjunaContext);
+            }
+        }) ;
+    }
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.server;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
+import com.arjuna.webservices11.ServiceRegistry;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Activate the Terminator Participant service
+ * @author kevin
+ */
+public class TerminationCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsarjtx/server/TerminationParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsarjtx.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Terminator Coordinator service
+ * @author kevin
+ */
+public class TerminationParticipantInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/AtomicTransactionConstants.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/AtomicTransactionConstants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/AtomicTransactionConstants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,227 @@
+package com.arjuna.webservices11.wsat;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-AtomicTransaction constants.
+ */
+public interface AtomicTransactionConstants
+{
+    /**
+     * The Namespace.
+     */
+    public String WSAT_NAMESPACE = "http://docs.oasis-open.org/ws-tx/wsat/2006/06";
+    /**
+     * The Attribute Namespace.
+     */
+    public String WSAT_ATTRIBUTE_NAMESPACE = "" ;
+    /**
+     * The namespace prefix.
+     */
+    public String WSAT_PREFIX = "wsat" ;
+    /**
+     * The attribute namespace prefix.
+     */
+    public String WSAT_ATTRIBUTE_PREFIX = "" ;
+
+    /**
+     * The completion coordinator service name.
+     */
+    public String COMPLETION_COORDINATOR_SERVICE_NAME = "CompletionCoordinatorService" ;
+    /**
+     * The completion coordinator service qname.
+     */
+    public QName COMPLETION_COORDINATOR_SERVICE_QNAME = new QName(WSAT_NAMESPACE, COMPLETION_COORDINATOR_SERVICE_NAME, WSAT_PREFIX);
+
+     /**
+     * The WSAT Completion Cordinator Port Name.
+     */
+    public String COMPLETION_COORDINATOR_PORT_NAME = "CompletionCoordinatorPortType";
+    /**
+     * The WSAT Completion Cordinator Port QName.
+     */
+    public QName COMPLETION_COORDINATOR_PORT_QNAME = new QName(WSAT_NAMESPACE, COMPLETION_COORDINATOR_PORT_NAME, WSAT_PREFIX);
+
+    /**
+      * The completion initiator service name.
+      */
+     public String COMPLETION_INITIATOR_SERVICE_NAME = "CompletionInitiatorService" ;
+     /**
+      * The completion initiator service qname.
+      */
+     public QName COMPLETION_INITIATOR_SERVICE_QNAME = new QName(WSAT_NAMESPACE, COMPLETION_INITIATOR_SERVICE_NAME, WSAT_PREFIX);
+    /**
+     * The WSAT Completion Initiator Port Name.
+     */
+    public String COMPLETION_INITIATOR_PORT_NAME = "CompletionInitiatorPortType";
+    /**
+     * The WSAT Completion Initiator Port QName.
+     */
+    public QName COMPLETION_INITIATOR_PORT_QNAME = new QName(WSAT_NAMESPACE, COMPLETION_INITIATOR_PORT_NAME, WSAT_PREFIX);
+
+    /**
+     * The coordinator service name.
+     */
+    public String COORDINATOR_SERVICE_NAME = "CoordinatorService" ;
+    /**
+     * The coordinator service qname.
+     */
+    public QName COORDINATOR_SERVICE_QNAME = new QName(WSAT_NAMESPACE, COORDINATOR_SERVICE_NAME, WSAT_PREFIX);
+    /**
+     * The WSAT Cordinator Port Name.
+     */
+    public String COORDINATOR_PORT_NAME = "CoordinatorPortType";
+    /**
+     * The WSAT Cordinator Port QName.
+     */
+    public QName COORDINATOR_PORT_QNAME = new QName(WSAT_NAMESPACE, COORDINATOR_PORT_NAME, WSAT_PREFIX);
+
+    /**
+     * The participant service name.
+     */
+    public String PARTICIPANT_SERVICE_NAME = "ParticipantService" ;
+    /**
+     * The participant service qname.
+     */
+    public QName PARTICIPANT_SERVICE_QNAME = new QName(WSAT_NAMESPACE, PARTICIPANT_SERVICE_NAME, WSAT_PREFIX);
+    /**
+     * The WSAT Participant Port Name.
+     */
+    public String PARTICIPANT_PORT_NAME = "ParticipantPortType";
+    /**
+     * The WSAT Participant Port QName.
+     */
+    public QName PARTICIPANT_PORT_QNAME = new QName(WSAT_NAMESPACE, PARTICIPANT_PORT_NAME, WSAT_PREFIX);
+
+    /**
+     * The Prepare element.
+     */
+    public String WSAT_ELEMENT_PREPARE = "Prepare" ;
+    /**
+     * The Prepare QName.
+     */
+    public QName WSAT_ELEMENT_PREPARE_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_PREPARE, WSAT_PREFIX) ;
+    /**
+     * The Prepare Action.
+     */
+    public String WSAT_ACTION_PREPARE = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_PREPARE ;
+    /**
+     * The Prepared element.
+     */
+    public String WSAT_ELEMENT_PREPARED = "Prepared" ;
+    /**
+     * The Prepared QName.
+     */
+    public QName WSAT_ELEMENT_PREPARED_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_PREPARED, WSAT_PREFIX) ;
+    /**
+     * The Prepared Action.
+     */
+    public String WSAT_ACTION_PREPARED = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_PREPARED ;
+    /**
+     * The Aborted element.
+     */
+    public String WSAT_ELEMENT_ABORTED = "Aborted" ;
+    /**
+     * The Aborted QName.
+     */
+    public QName WSAT_ELEMENT_ABORTED_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_ABORTED, WSAT_PREFIX) ;
+    /**
+     * The Aborted Action.
+     */
+    public String WSAT_ACTION_ABORTED = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_ABORTED ;
+    /**
+     * The ReadOnly element.
+     */
+    public String WSAT_ELEMENT_READ_ONLY = "ReadOnly" ;
+    /**
+     * The ReadOnly QName.
+     */
+    public QName WSAT_ELEMENT_READ_ONLY_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_READ_ONLY, WSAT_PREFIX) ;
+    /**
+     * The ReadOnly Action.
+     */
+    public String WSAT_ACTION_READ_ONLY = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_READ_ONLY ;
+    /**
+     * The Commit element.
+     */
+    public String WSAT_ELEMENT_COMMIT = "Commit" ;
+    /**
+     * The Commit QName.
+     */
+    public QName WSAT_ELEMENT_COMMIT_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_COMMIT, WSAT_PREFIX) ;
+    /**
+     * The Commit Action.
+     */
+    public String WSAT_ACTION_COMMIT = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_COMMIT ;
+    /**
+     * The Rollback element.
+     */
+    public String WSAT_ELEMENT_ROLLBACK = "Rollback" ;
+    /**
+     * The Rollback QName.
+     */
+    public QName WSAT_ELEMENT_ROLLBACK_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_ROLLBACK, WSAT_PREFIX) ;
+    /**
+     * The Rollback Action.
+     */
+    public String WSAT_ACTION_ROLLBACK = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_ROLLBACK ;
+    /**
+     * The Committed element.
+     */
+    public String WSAT_ELEMENT_COMMITTED = "Committed" ;
+    /**
+     * The Committed QName.
+     */
+    public QName WSAT_ELEMENT_COMMITTED_QNAME = new QName(WSAT_NAMESPACE, WSAT_ELEMENT_COMMITTED, WSAT_PREFIX) ;
+    /**
+     * The Committed Action.
+     */
+    public String WSAT_ACTION_COMMITTED = WSAT_NAMESPACE + "/" + WSAT_ELEMENT_COMMITTED ;
+    /**
+     * The Fault Action.
+     */
+    public String WSAT_ACTION_FAULT = WSAT_NAMESPACE + "/fault" ;
+
+    /**
+     * The vote attribute.
+     */
+    public String WSAT_ATTRIBUTE_VOTE = "vote" ;
+    /**
+     * The vote QName.
+     */
+    public QName WSAT_ATTRIBUTE_VOTE_QNAME = new QName(WSAT_ATTRIBUTE_NAMESPACE, WSAT_ATTRIBUTE_VOTE, WSAT_ATTRIBUTE_PREFIX) ;
+    /**
+     * The outcome attribute.
+     */
+    public String WSAT_ATTRIBUTE_OUTCOME = "outcome" ;
+    /**
+     * The outcome QName.
+     */
+    public QName WSAT_ATTRIBUTE_OUTCOME_QNAME = new QName(WSAT_ATTRIBUTE_NAMESPACE, WSAT_ATTRIBUTE_OUTCOME, WSAT_ATTRIBUTE_PREFIX) ;
+
+    /**
+     * The InconsistentInternalState error code.
+     */
+    public String WSAT_ERROR_CODE_INCONSISTENT_INTERNAL_STATE = "InconsistentInternalState" ;
+    /**
+     * The InconsistentInternalState error code QName.
+     */
+    public QName WSAT_ERROR_CODE_INCONSISTENT_INTERNAL_STATE_QNAME = new QName(WSAT_NAMESPACE, WSAT_ERROR_CODE_INCONSISTENT_INTERNAL_STATE, WSAT_PREFIX) ;
+
+    /**
+     * The atomic transaction protocol.
+     */
+    public String WSAT_PROTOCOL = WSAT_NAMESPACE ;
+    /**
+     * The atomic transaction completion protocol.
+     */
+    public String WSAT_SUB_PROTOCOL_COMPLETION = WSAT_NAMESPACE + "/Completion" ;
+    /**
+     * The atomic transaction durable 2PC protocol.
+     */
+    public String WSAT_SUB_PROTOCOL_DURABLE_2PC = WSAT_NAMESPACE + "/Durable2PC" ;
+    /**
+     * The atomic transaction volatile 2PC protocol.
+     */
+    public String WSAT_SUB_PROTOCOL_VOLATILE_2PC = WSAT_NAMESPACE + "/Volatile2PC" ;
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/CoordinatorInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/CoordinatorInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/CoordinatorInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,61 @@
+package com.arjuna.webservices11.wsat;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices.SoapFault;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/**
+ * The Coordinator events.
+ */
+public interface CoordinatorInboundEvents
+{
+    /**
+     * Handle the aborted event.
+     * @param aborted The aborted notification.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void aborted(final Notification aborted, final AddressingProperties addressingContext, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the committed event.
+     * @param committed The committed notification.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void committed(final Notification committed, final AddressingProperties addressingContext, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the prepared event.
+     * @param prepared The prepared notification.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void prepared(final Notification prepared, final AddressingProperties addressingContext, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the readOnly event.
+     * @param readOnly The readOnly notification.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void readOnly(final Notification readOnly, final AddressingProperties addressingContext, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingContext, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Get the participant endpoint reference
+     * @return The participant endpoint reference
+     */
+    public W3CEndpointReference getParticipant();
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/ParticipantInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/ParticipantInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/ParticipantInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,52 @@
+package com.arjuna.webservices11.wsat;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices.SoapFault;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/**
+ * The Participant events.
+ */
+public interface ParticipantInboundEvents
+{
+    /**
+     * Handle the commit event.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void commit(final Notification commit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the prepare event.
+     * @param prepare The prepare notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void prepare(final Notification prepare, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the rollback event.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void rollback(final Notification rollback, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+    /**
+     * Return the endpoint reference for the coordinator associated with this participant.
+     * @return the coordinator endpoint reference
+     */
+    public W3CEndpointReference getCoordinator();
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/State.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/State.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/State.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,118 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsat;
+
+import java.text.MessageFormat;
+import java.util.Map;
+
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.Enumerated;
+import com.arjuna.webservices.util.InvalidEnumerationException;
+
+/**
+ * Class representing AT state enumerations.
+ * @author kevin
+ */
+public class State extends Enumerated
+{
+    /**
+     * The Active state.
+     */
+    public static final State STATE_ACTIVE = new State("Active") ;
+    /**
+     * The Preparing state.
+     */
+    public static final State STATE_PREPARING = new State("Preparing") ;
+    /**
+     * The Prepared state.
+     */
+    public static final State STATE_PREPARED = new State("Prepared") ;
+    /**
+     * The PreparedSuccess state.
+     */
+    public static final State STATE_PREPARED_SUCCESS = new State("PreparedSuccess") ;
+    /**
+     * The Committing state.
+     */
+    public static final State STATE_COMMITTING = new State("Committing") ;
+    /**
+     * The Aborting state.
+     */
+    public static final State STATE_ABORTING = new State("Aborting") ;
+
+    /**
+     * The map of enumerations.
+     */
+    private static final Map ENUM_MAP = generateMap(new Enumerated[] {
+        STATE_ACTIVE, STATE_PREPARING, STATE_PREPARED, STATE_PREPARED_SUCCESS,
+        STATE_COMMITTING, STATE_ABORTING
+    }) ;
+
+    /**
+     * Construct the state enumeration with the specified value.
+     * @param value The localName of the state enumeration.
+     */
+    private State(final String value)
+    {
+        super(value) ;
+    }
+
+    /**
+     * Get the value of this enumeration.
+     * @return the value.
+     */
+    public String getValue()
+    {
+        return (String)getKey() ;
+    }
+
+    /**
+     * Resolve the enumeration for the specified value.
+     * @param value The value.
+     * @return The enumeration.
+     * @throws com.arjuna.webservices.util.InvalidEnumerationException if the value is not valid.
+     */
+    protected Enumerated resolveEnum(final Object value)
+        throws InvalidEnumerationException
+    {
+        return toState11((String)value) ;
+    }
+
+    /**
+     * Return the enumeration for the specified value.
+     * @param value The value.
+     * @return The enumeration.
+     * @throws com.arjuna.webservices.util.InvalidEnumerationException if the value is not valid.
+     * @message com.arjuna.webservices11.wsat.State_1 [com.arjuna.webservices11.wsat.State_1] - Invalid fault type enumeration: {0}
+     */
+    public static State toState11(final String value)
+        throws InvalidEnumerationException
+    {
+        final Object state = ENUM_MAP.get(value) ;
+        if (state == null)
+        {
+            final String pattern = WSTLogger.log_mesg.getString("com.arjuna.webservices11.wsat.State_1") ;
+            final String message = MessageFormat.format(pattern, new Object[] {value}) ;
+            throw new InvalidEnumerationException(message) ;
+        }
+        return (State)state ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionCoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,126 @@
+package com.arjuna.webservices11.wsat.client;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsat.client.WSATClient;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Completion Coordinator.
+ * @author kevin
+ */
+public class CompletionCoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final CompletionCoordinatorClient CLIENT = new CompletionCoordinatorClient() ;
+
+    /**
+     * The commit action.
+     */
+    private AttributedURI commitAction = null;
+    /**
+     * The rollback action.
+     */
+    private AttributedURI rollbackAction = null;
+
+    /**
+     * The completion initiator URI for replies.
+     */
+    private AttributedURI completionInitiator ;
+
+    /**
+     * Construct the completion coordinator client.
+     */
+    private CompletionCoordinatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            commitAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMIT);
+            rollbackAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ROLLBACK);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String completionInitiatorURI =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME) ;
+        try {
+            completionInitiator = builder.newURI(completionInitiatorURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a commit request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCommit(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CompletionCoordinatorPortType port = getPort(endpoint, addressingProperties, commitAction);
+        Notification commit = new Notification();
+
+        port.commitOperation(commit);
+    }
+
+    /**
+     * Send a rollback request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendRollback(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CompletionCoordinatorPortType port = getPort(endpoint, addressingProperties, rollbackAction);
+        Notification rollback = new Notification();
+                
+        port.rollbackOperation(rollback);
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static CompletionCoordinatorClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param endpoint
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private CompletionCoordinatorPortType getPort(final W3CEndpointReference endpoint,
+                                                  final AddressingProperties addressingProperties,
+                                                  final AttributedURI action)
+    {
+        return WSATClient.getCompletionCoordinatorPort(endpoint, action, addressingProperties);
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CompletionInitiatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,145 @@
+package com.arjuna.webservices11.wsat.client;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsat.client.WSATClient;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionInitiatorPortType;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Completion Initiator.
+ * @author kevin
+ */
+public class CompletionInitiatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final CompletionInitiatorClient CLIENT = new CompletionInitiatorClient() ;
+
+    /**
+     * The committed action.
+     */
+    private AttributedURI committedAction = null;
+    /**
+     * The aborted action.
+     */
+    private AttributedURI abortedAction = null;
+    /**
+     * The fault action.
+     */
+    private AttributedURI faultAction = null;
+
+    /**
+     * The completion coordinator URI for replies.
+     */
+    private AttributedURI completionCoordinator ;
+
+    /**
+     * Construct the completion initiator client.
+     */
+    private CompletionInitiatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
+            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
+            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String completionCoordinatorURI =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME) ;
+        try {
+            completionCoordinator = builder.newURI(completionCoordinatorURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a committed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCommitted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CompletionInitiatorPortType port = getPort(participant, addressingProperties, committedAction);
+        Notification commited = new Notification();
+
+        port.committedOperation(commited);
+    }
+
+    /**
+     * Send an aborted request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendAborted(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CompletionInitiatorPortType port = getPort(participant, addressingProperties, abortedAction);
+        Notification aborted = new Notification();
+
+        port.abortedOperation(aborted);
+    }
+
+    /**
+     * Send a fault.
+     * @param addressingProperties The addressing context.
+     * @param soapFault The SOAP fault.
+     * @param identifier The arjuna instance identifier.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendSoapFault(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        // TODO - we only get here if we have no endpoitn so all we can do is log an error!
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static CompletionInitiatorClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private CompletionInitiatorPortType getPort(final W3CEndpointReference participant,
+                                                final AddressingProperties addressingProperties,
+                                                final AttributedURI action)
+    {
+        return WSATClient.getCompletionInitiatorPort(participant, action, addressingProperties);
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/CoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,187 @@
+package com.arjuna.webservices11.wsat.client;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsat.client.WSATClient;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Coordinator.
+ * @author kevin
+ */
+public class CoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final CoordinatorClient CLIENT = new CoordinatorClient() ;
+
+    /**
+     * The prepared action.
+     */
+    private AttributedURI preparedAction = null;
+    /**
+     * The aborted action.
+     */
+    private AttributedURI abortedAction = null;
+    /**
+     * The read only action.
+     */
+    private AttributedURI readOnlyAction = null;
+    /**
+     * The committed action.
+     */
+    private AttributedURI committedAction = null;
+    /**
+     * The fault action.
+     */
+    private AttributedURI faultAction = null;
+
+    /**
+     * The participant URI for replies.
+     */
+    private AttributedURI participant ;
+
+    /**
+     * Construct the coordinator client.
+     */
+    private CoordinatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            preparedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARED);
+            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
+            readOnlyAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_READ_ONLY);
+            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
+            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String participantURI =
+            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME);
+        try {
+            participant = builder.newURI(participantURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a prepared request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any SOAP errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendPrepared(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CoordinatorPortType port = getPort(endpoint, addressingProperties, preparedAction);
+        Notification prepared = new Notification();
+
+        port.preparedOperation(prepared);
+    }
+
+    /**
+     * Send an aborted request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any SOAP errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendAborted(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CoordinatorPortType port = getPort(endpoint, addressingProperties, abortedAction);
+        Notification aborted = new Notification();
+
+        port.abortedOperation(aborted);
+    }
+
+    /**
+     * Send a read only request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any SOAP errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendReadOnly(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CoordinatorPortType port = getPort(endpoint, addressingProperties, readOnlyAction);
+        Notification readOnly = new Notification();
+
+        port.readOnlyOperation(readOnly);
+    }
+
+    /**
+     * Send a committed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any SOAP errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCommitted(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        CoordinatorPortType port = getPort(endpoint, addressingProperties, committedAction);
+        Notification committed = new Notification();
+
+        port.committedOperation(committed);
+    }
+
+    /**
+     * Send a fault.
+     * @param addressingProperties The addressing context.
+     * @param soapFault The SOAP fault.
+     * @param identifier The arjuna instance identifier.
+     * @throws com.arjuna.webservices.SoapFault For any SOAP errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendSoapFault(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        // TODO - we cannot do this without an endpoint so all we can do is log a message!
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static CoordinatorClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private CoordinatorPortType getPort(final W3CEndpointReference participant,
+                                                final AddressingProperties addressingProperties,
+                                                final AttributedURI action)
+    {
+        return WSATClient.getCoordinatorPort(participant, action, addressingProperties);
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/ParticipantClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,165 @@
+package com.arjuna.webservices11.wsat.client;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsat.client.WSATClient;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantPortType;
+
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Participant.
+ * @author kevin
+ */
+public class ParticipantClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final ParticipantClient CLIENT = new ParticipantClient() ;
+
+    /**
+     * The prepare action.
+     */
+    private AttributedURI prepareAction = null;
+    /**
+     * The commit action.
+     */
+    private AttributedURI commitAction = null;
+    /**
+     * The rollback action.
+     */
+    private AttributedURI rollbackAction = null;
+    /**
+     * The SOAP fault action.
+     */
+    private AttributedURI faultAction;
+
+    /**
+     * The coordinator URI for replies.
+     */
+    private AttributedURI coordinator ;
+
+    /**
+     * Construct the completion initiator client.
+     */
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            prepareAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARE);
+            commitAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMIT);
+            rollbackAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ROLLBACK);
+            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String coordinatorURI = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME);
+        try {
+            coordinator = builder.newURI(coordinatorURI);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+
+    }
+
+    /**
+     * Send a prepare request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendPrepare(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        ParticipantPortType port = getPort(endpoint, addressingProperties, prepareAction);
+        Notification prepare = new Notification();
+
+        port.prepareOperation(prepare);
+    }
+
+    /**
+     * Send a commit request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCommit(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        ParticipantPortType port = getPort(endpoint, addressingProperties, commitAction);
+        Notification commit = new Notification();
+
+        port.commitOperation(commit);
+    }
+
+    /**
+     * Send a rollback request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendRollback(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        ParticipantPortType port = getPort(endpoint, addressingProperties, rollbackAction);
+        Notification rollback = new Notification();
+
+        port.rollbackOperation(rollback);
+    }
+
+    /**
+     * Send a fault.
+     * @param addressingProperties The addressing context.
+     * @param soapFault The SOAP fault.
+     * @param identifier The arjuna instance identifier.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendSoapFault(final W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final SoapFault soapFault, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        // TODO - we cannot do this without an ednpoint so all we can do is log an error message!
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static ParticipantClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private ParticipantPortType getPort(final W3CEndpointReference participant,
+                                                final AddressingProperties addressingProperties,
+                                                final AttributedURI action)
+    {
+        return WSATClient.getParticipantPort(participant, action, addressingProperties);
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/WSATClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/WSATClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/client/WSATClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,252 @@
+package com.arjuna.webservices11.wsat.client;
+
+import com.arjuna.webservices11.wsarj.handler.InstanceIdentifierHandler;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.*;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSATClient
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread coordinator service instance
+     */
+    private static ThreadLocal<CoordinatorService> coordinatorService = new ThreadLocal<CoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread participant service instance
+     */
+    private static ThreadLocal<ParticipantService> participantService = new ThreadLocal<ParticipantService>();
+
+    /**
+     *  thread local which maintains a per thread completion coordinator service instance
+     */
+    private static ThreadLocal<CompletionCoordinatorService> completionCoordinatorService = new ThreadLocal<CompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread completion initiator service instance
+     */
+    private static ThreadLocal<CompletionInitiatorService> completionInitiatorService = new ThreadLocal<CompletionInitiatorService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized CoordinatorService getCoordinatorService()
+    {
+        if (coordinatorService.get() == null) {
+            coordinatorService.set(new CoordinatorService());
+        }
+        return coordinatorService.get();
+    }
+
+    /**
+     * fetch a participant service unique to the current thread
+     * @return
+     */
+    private static synchronized ParticipantService getParticipantService()
+    {
+        if (participantService.get() == null) {
+            participantService.set(new ParticipantService());
+        }
+        return participantService.get();
+    }
+
+    /**
+     * fetch a completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized CompletionCoordinatorService getCompletionCoordinatorService()
+    {
+        if (completionCoordinatorService.get() == null) {
+            completionCoordinatorService.set(new CompletionCoordinatorService());
+        }
+        return completionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a completion initiator service unique to the current thread
+     * @return
+     */
+    private static synchronized CompletionInitiatorService getCompletionInitiatorService()
+    {
+        if (completionInitiatorService.get() == null) {
+            completionInitiatorService.set(new CompletionInitiatorService());
+        }
+        return completionInitiatorService.get();
+    }
+
+    public static CoordinatorPortType getCoordinatorPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        CoordinatorService service = getCoordinatorService();
+        // CoordinatorPortType port = service.getPort(endpointReference, CoordinatorPortType.class, new AddressingFeature(true, true));
+        CoordinatorPortType port = service.getPort(endpointReference, CoordinatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static ParticipantPortType getParticipantPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        ParticipantService service = getParticipantService();
+        // ParticipantPortType port = service.getPort(endpointReference, ParticipantPortType.class, new AddressingFeature(true, true));
+        ParticipantPortType port = service.getPort(endpointReference, ParticipantPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context
+         * TODO - don't think this is correct here
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    public static CompletionCoordinatorPortType getCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                             AttributedURI action,
+                                                                             AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        CompletionCoordinatorService service = getCompletionCoordinatorService();
+        // CompletionCoordinatorPortType port = service.getPort(endpointReference, CompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        CompletionCoordinatorPortType port = service.getPort(endpointReference, CompletionCoordinatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    public static CompletionInitiatorPortType getCompletionInitiatorPort(W3CEndpointReference endpointReference,
+                                                                         AttributedURI action,
+                                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        CompletionInitiatorService service = getCompletionInitiatorService();
+        // CompletionInitiatorPortType port = service.getPort(endpointReference, CompletionInitiatorPortType.class, new AddressingFeature(true, true));
+        CompletionInitiatorPortType port = service.getPort(endpointReference, CompletionInitiatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         * TODO - don't think this is correct here
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,72 @@
+package com.arjuna.webservices11.wsat.processors;
+
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/**
+ * The Completion Coordinator processor.
+ * @author kevin
+ */
+public abstract class CompletionCoordinatorProcessor
+{
+    /**
+     * The coordinator processor.
+     */
+    private static CompletionCoordinatorProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static synchronized CompletionCoordinatorProcessor getProcessor()
+    {
+        return PROCESSOR;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized CompletionCoordinatorProcessor setProcessor(final CompletionCoordinatorProcessor processor)
+    {
+        final CompletionCoordinatorProcessor origProcessor = PROCESSOR;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public abstract void activateParticipant(final CompletionCoordinatorParticipant participant, final String identifier) ;
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public abstract void deactivateParticipant(final CompletionCoordinatorParticipant participant) ;
+
+    /**
+     * Commit.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void commit(final Notification commit, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Rollback.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void rollback(final Notification rollback, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorCallback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorCallback.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorCallback.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+package com.arjuna.webservices11.wsat.processors;
+
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices.SoapFault;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Completion Initiator callback.
+ * @author kevin
+ */
+public abstract class CompletionInitiatorCallback extends Callback
+{
+    /**
+     * An aborted response.
+     * @param aborted The aborted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void aborted(final Notification aborted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A committed response.
+     * @param committed The committed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void committed(final Notification committed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * A SOAP fault response.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CompletionInitiatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,89 @@
+package com.arjuna.webservices11.wsat.processors;
+
+import com.arjuna.webservices11.wsarj.processor.BaseNotificationProcessor;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorCallback;
+import com.arjuna.webservices.base.processors.Callback;
+import com.arjuna.webservices.SoapFault;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Completion Initiator processor.
+ * @author kevin
+ */
+public class CompletionInitiatorProcessor extends BaseNotificationProcessor
+{
+    /**
+     * The initiator singleton.
+     */
+    private static final CompletionInitiatorProcessor PROCESSOR = new CompletionInitiatorProcessor() ;
+
+    /**
+     * Get the processor singleton.
+     * @return The singleton.
+     */
+    public static CompletionInitiatorProcessor getProcessor()
+    {
+        return PROCESSOR;
+    }
+
+    /**
+     * Handle an aborted response.
+     * @param aborted The aborted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleAborted(final Notification aborted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((CompletionInitiatorCallback)callback).aborted(aborted, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a committed response.
+     * @param committed The committed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleCommitted(final Notification committed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((CompletionInitiatorCallback)callback).committed(committed, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Handle a SOAP fault response.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void handleSoapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        handleCallbacks(new CallbackExecutorAdapter() {
+            public void execute(final Callback callback) {
+                ((CompletionInitiatorCallback)callback).soapFault(soapFault, addressingProperties, arjunaContext) ;
+            }
+        }, getIDs(addressingProperties, arjunaContext)) ;
+    }
+
+    /**
+     * Register a callback for the specific instance identifier.
+     * @param instanceIdentifier The instance identifier.
+     * @param callback The callback for the response.
+     */
+    public void registerCallback(final String instanceIdentifier, final CompletionInitiatorCallback callback)
+    {
+        register(instanceIdentifier, callback) ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/CoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,100 @@
+package com.arjuna.webservices11.wsat.processors;
+
+import com.arjuna.webservices11.wsat.CoordinatorInboundEvents;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices.SoapFault;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/**
+ * The Coordinator processor.
+ * @author kevin
+ */
+public abstract class CoordinatorProcessor
+{
+    /**
+     * The coordinator processor.
+     */
+    private static CoordinatorProcessor PROCESSOR ;
+
+    /**
+     * Get the processor singleton.
+     * @return The singleton.
+     */
+    public static synchronized CoordinatorProcessor getProcessor()
+    {
+        return PROCESSOR;
+    }
+
+    /**
+     * Set the processor singleton.
+     * @param processor The processor.
+     * @return The previous singleton.
+     */
+    public static synchronized CoordinatorProcessor setProcessor(final CoordinatorProcessor processor)
+    {
+        final CoordinatorProcessor origProcessor = PROCESSOR;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public abstract void activateCoordinator(final CoordinatorInboundEvents coordinator, final String identifier) ;
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public abstract void deactivateCoordinator(final CoordinatorInboundEvents coordinator) ;
+
+    /**
+     * Aborted.
+     * @param aborted The aborted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void aborted(final Notification aborted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Committed.
+     * @param committed The committed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void committed(final Notification committed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Prepared.
+     * @param prepared The prepared notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void prepared(final Notification prepared, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Read only.
+     * @param readOnly The read only notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void readOnly(final Notification readOnly, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingContext The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingContext,
+        final ArjunaContext arjunaContext) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/ParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/ParticipantProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/processors/ParticipantProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,91 @@
+package com.arjuna.webservices11.wsat.processors;
+
+import com.arjuna.webservices11.wsat.ParticipantInboundEvents;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices.SoapFault;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public abstract class ParticipantProcessor
+{
+    /**
+     * The participant processor.
+     */
+    private static ParticipantProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static synchronized ParticipantProcessor getProcessor()
+    {
+        return PROCESSOR;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized ParticipantProcessor setProcessor(final ParticipantProcessor processor)
+    {
+        final ParticipantProcessor origProcessor = PROCESSOR;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public abstract void activateParticipant(final ParticipantInboundEvents participant, final String identifier) ;
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public abstract void deactivateParticipant(final ParticipantInboundEvents participant) ;
+
+    /**
+     * Commit.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void commit(final Notification commit, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Prepare.
+     * @param prepare The prepare notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void prepare(final Notification prepare, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Rollback.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void rollback(final Notification rollback, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP Fault.
+     * @param soapFault The SOAP fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionCoordinatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionCoordinatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,85 @@
+package com.arjuna.webservices11.wsat.sei;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorPortType;
+
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.services.framework.task.Task;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "CompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsat-completion-coordinator-binding.wsdl",
+        serviceName = "CompletionCoordinatorService",
+        portName = "CompletionCoordinatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class CompletionCoordinatorPortTypeImpl implements CompletionCoordinatorPortType
+{
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
+    @Oneway
+    public void commitOperation(
+        @WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification commit = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CompletionCoordinatorProcessor.getProcessor().commit(commit, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "RollbackOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback")
+    @Oneway
+    public void rollbackOperation(
+        @WebParam(name = "Rollback", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification rollback = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CompletionCoordinatorProcessor.getProcessor().rollback(rollback, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionInitiatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionInitiatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CompletionInitiatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,86 @@
+package com.arjuna.webservices11.wsat.sei;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionInitiatorPortType;
+
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorProcessor;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.services.framework.task.Task;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "CompletionInitiatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsat-completion-initiator-binding.wsdl",
+        serviceName = "CompletionInitiatorService",
+        portName = "CompletionInitiatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class CompletionInitiatorPortTypeImpl implements CompletionInitiatorPortType
+{
+
+    @Resource
+     private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
+    @Oneway
+    public void committedOperation(
+        @WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification committed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CompletionInitiatorProcessor.getProcessor().handleCommitted(committed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "AbortedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted")
+    @Oneway
+    public void abortedOperation(
+        @WebParam(name = "Aborted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification aborted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CompletionInitiatorProcessor.getProcessor().handleAborted(aborted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CoordinatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/CoordinatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,132 @@
+package com.arjuna.webservices11.wsat.sei;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorPortType;
+
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.services.framework.task.Task;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "CoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsat-coordinator-binding.wsdl",
+        serviceName = "CoordinatorService",
+        portName = "CoordinatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class CoordinatorPortTypeImpl implements CoordinatorPortType
+{
+
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "PreparedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
+    @Oneway
+    public void preparedOperation(
+        @WebParam(name = "Prepared", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification prepared = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorProcessor.getProcessor().prepared(prepared, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "AbortedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted")
+    @Oneway
+    public void abortedOperation(
+        @WebParam(name = "Aborted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification aborted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorProcessor.getProcessor().aborted(aborted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ReadOnlyOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
+    @Oneway
+    public void readOnlyOperation(
+        @WebParam(name = "ReadOnly", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification readOnly = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorProcessor.getProcessor().readOnly(readOnly, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
+    @Oneway
+    public void committedOperation(
+        @WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification committed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorProcessor.getProcessor().committed(committed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/ParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/ParticipantPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/sei/ParticipantPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,109 @@
+package com.arjuna.webservices11.wsat.sei;
+
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantPortType;
+
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.services.framework.task.Task;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "ParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsat-participant-binding.wsdl",
+        serviceName = "ParticipantService",
+        portName = "ParticipantPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class ParticipantPortTypeImpl implements ParticipantPortType
+{
+
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "PrepareOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepare")
+    @Oneway
+    public void prepareOperation(
+        @WebParam(name = "Prepare", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification prepare = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantProcessor.getProcessor().prepare(prepare, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
+    @Oneway
+    public void commitOperation(
+        @WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification commit = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantProcessor.getProcessor().commit(commit, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "RollbackOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback")
+    @Oneway
+    public void rollbackOperation(
+        @WebParam(name = "Rollback", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final Notification rollback = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantProcessor.getProcessor().rollback(rollback, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsat.server;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Activate the Completion Coordinator service
+ * @author kevin
+ */
+public class CompletionCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CompletionInitiatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsat.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Completion Initiator service
+ * @author kevin
+ */
+public class CompletionInitiatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/CoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsat.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Coordinator service
+ * @author kevin
+ */
+public class CoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsat/server/ParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsat.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Participant service
+ * @author kevin
+ */
+public class ParticipantInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/BusinessActivityConstants.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/BusinessActivityConstants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/BusinessActivityConstants.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,362 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Interface containing WS-BusinessActivity constants.
+ */
+public interface BusinessActivityConstants
+{
+    /**
+     * The Namespace.
+     */
+    public String WSBA_NAMESPACE = "http://docs.oasis-open.org/ws-tx/wsba/2006/06";
+    /**
+     * The namespace prefix.
+     */
+    public String WSBA_PREFIX = "wsba";
+
+    /**
+     * The WSBA Participant Completion Cordinator Service Name.
+     */
+    public String PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME = "BusinessAgreementWithParticipantCompletionCoordinatorService";
+    /**
+     * The WSBA Participant Completion Cordinator Service QName.
+     */
+    public QName PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_QNAME = new QName(WSBA_NAMESPACE, PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, WSBA_PREFIX);
+    /**
+     * The WSBA Participant Completion Cordinator Port Name.
+     */
+    public String PARTICIPANT_COMPLETION_COORDINATOR_PORT_NAME = "BusinessAgreementWithParticipantCompletionCoordinatorPortType";
+    /**
+     * The WSBA Participant Completion Cordinator Port QName.
+     */
+    public QName PARTICIPANT_COMPLETION_COORDINATOR_PORT_QNAME = new QName(WSBA_NAMESPACE, PARTICIPANT_COMPLETION_COORDINATOR_PORT_NAME, WSBA_PREFIX);
+
+    /**
+     * The WSBA Participant Completion Participant Service Name.
+     */
+    public String PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME = "BusinessAgreementWithParticipantCompletionParticipantService";
+    /**
+     * The WSBA Participant Completion Participant Service QName.
+     */
+    public QName PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME = new QName(WSBA_NAMESPACE, PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, WSBA_PREFIX);
+    /**
+     * The WSBA Participant Completion Participant Port Name.
+     */
+    public String PARTICIPANT_COMPLETION_PARTICIPANT_PORT_NAME = "BusinessAgreementWithParticipantCompletionParticipantPortType";
+    /**
+     * The WSBA Participant Completion Participant Port QName.
+     */
+    public QName PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME = new QName(WSBA_NAMESPACE, PARTICIPANT_COMPLETION_PARTICIPANT_PORT_NAME, WSBA_PREFIX);
+
+    /**
+     * The WSBA Coordinator Completion Coordinator Service Name.
+     */
+    public String COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME = "BusinessAgreementWithCoordinatorCompletionCoordinatorService";
+    /**
+     * The WSBA Coordinator Completion Coordinator Service QName.
+     */
+    public QName COORDINATOR_COMPLETION_COORDINATOR_SERVICE_QNAME = new QName(WSBA_NAMESPACE, COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, WSBA_PREFIX);
+    /**
+     * The WSBA Coordinator Completion Coordinator Port Name.
+     */
+    public String COORDINATOR_COMPLETION_COORDINATOR_PORT_NAME = "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType";
+    /**
+     * The WSBA Coordinator Completion Coordinator Port QName.
+     */
+    public QName COORDINATOR_COMPLETION_COORDINATOR_PORT_QNAME = new QName(WSBA_NAMESPACE, COORDINATOR_COMPLETION_COORDINATOR_PORT_NAME, WSBA_PREFIX);
+
+    /**
+     * The WSBA Coordinator Completion Participant Service Name.
+     */
+    public String COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME = "BusinessAgreementWithCoordinatorCompletionParticipantService";
+    /**
+     * The WSBA Coordinator Completion Participant Service QName.
+     */
+    public QName COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME = new QName(WSBA_NAMESPACE, COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, WSBA_PREFIX);
+    /**
+     * The WSBA Cordinator Completion Participant Port Name.
+     */
+    public String COORDINATOR_COMPLETION_PARTICIPANT_PORT_NAME = "BusinessAgreementWithCoordinatorCompletionParticipantPortType";
+    /**
+     * The WSBA Cordinator Completion Participant Port QName.
+     */
+    public QName COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME = new QName(WSBA_NAMESPACE, COORDINATOR_COMPLETION_PARTICIPANT_PORT_NAME, WSBA_PREFIX);
+
+    /* extra ops for 1.1. protocol*/
+
+    /**
+     * The Fail element.
+     */
+    public String WSBA_ELEMENT_FAIL = "Fail" ;
+    /**
+     * The Fail QName.
+     */
+    public QName WSBA_ELEMENT_FAIL_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_FAIL, WSBA_PREFIX) ;
+    /**
+     * The Fail Action.
+     */
+    public String WSBA_ACTION_FAIL = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_FAIL ;
+
+    /**
+     * The ExceptionIdentifier element.
+     */
+    public String WSBA_ELEMENT_EXCEPTION_IDENTIFIER = "ExceptionIdentifier" ;
+    /**
+     * The ExceptionIdentifier QName.
+     */
+    public QName WSBA_ELEMENT_EXCEPTION_IDENTIFIER_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_EXCEPTION_IDENTIFIER, WSBA_PREFIX) ;
+    /**
+     * The Canceled element.
+     */
+    public String WSBA_ELEMENT_CANCELLED = "Canceled" ;
+    /**
+     * The Canceled QName.
+     */
+    public QName WSBA_ELEMENT_CANCELLED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_CANCELLED, WSBA_PREFIX) ;
+    /**
+     * The Canceled Action.
+     */
+    public String WSBA_ACTION_CANCELLED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_CANCELLED ;
+    /**
+     * The Closed element.
+     */
+    public String WSBA_ELEMENT_CLOSED = "Closed" ;
+    /**
+     * The Closed QName.
+     */
+    public QName WSBA_ELEMENT_CLOSED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_CLOSED, WSBA_PREFIX) ;
+    /**
+     * The Closed Action.
+     */
+    public String WSBA_ACTION_CLOSED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_CLOSED ;
+    /**
+     * The Compensated element.
+     */
+    public String WSBA_ELEMENT_COMPENSATED = "Compensated" ;
+    /**
+     * The Compensated QName.
+     */
+    public QName WSBA_ELEMENT_COMPENSATED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_COMPENSATED, WSBA_PREFIX) ;
+    /**
+     * The Compensated Action.
+     */
+    public String WSBA_ACTION_COMPENSATED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_COMPENSATED ;
+    /**
+     * The Completed element.
+     */
+    public String WSBA_ELEMENT_COMPLETED = "Completed" ;
+    /**
+     * The Completed QName.
+     */
+    public QName WSBA_ELEMENT_COMPLETED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_COMPLETED, WSBA_PREFIX) ;
+    /**
+     * The Completed Action.
+     */
+    public String WSBA_ACTION_COMPLETED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_COMPLETED ;
+    /**
+     * The Exit element.
+     */
+    public String WSBA_ELEMENT_EXIT = "Exit" ;
+    /**
+     * The Exit QName.
+     */
+    public QName WSBA_ELEMENT_EXIT_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_EXIT, WSBA_PREFIX) ;
+    /**
+     * The Exit Action.
+     */
+    public String WSBA_ACTION_EXIT = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_EXIT ;
+    /**
+     * The Fault element.
+     */
+    public String WSBA_ELEMENT_FAULT = "Fault" ;
+    /**
+     * The Fault QName.
+     */
+    public QName WSBA_ELEMENT_FAULT_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_FAULT, WSBA_PREFIX) ;
+    /**
+     * The Fault Action.
+     */
+    public String WSBA_ACTION_FAULT = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_FAULT ;
+    /**
+     * The Cancel element.
+     */
+    public String WSBA_ELEMENT_CANCEL = "Cancel" ;
+    /**
+     * The Cancel QName.
+     */
+    public QName WSBA_ELEMENT_CANCEL_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_CANCEL, WSBA_PREFIX) ;
+    /**
+     * The Cancel Action.
+     */
+    public String WSBA_ACTION_CANCEL = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_CANCEL ;
+    /**
+     * The Close element.
+     */
+    public String WSBA_ELEMENT_CLOSE = "Close" ;
+    /**
+     * The Close QName.
+     */
+    public QName WSBA_ELEMENT_CLOSE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_CLOSE, WSBA_PREFIX) ;
+    /**
+     * The Close Action.
+     */
+    public String WSBA_ACTION_CLOSE = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_CLOSE ;
+    /**
+     * The Compensate element.
+     */
+    public String WSBA_ELEMENT_COMPENSATE = "Compensate" ;
+    /**
+     * The Compensate QName.
+     */
+    public QName WSBA_ELEMENT_COMPENSATE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_COMPENSATE, WSBA_PREFIX) ;
+    /**
+     * The Compensate Action.
+     */
+    public String WSBA_ACTION_COMPENSATE = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_COMPENSATE ;
+    /**
+     * The Complete element.
+     */
+    public String WSBA_ELEMENT_COMPLETE = "Complete" ;
+    /**
+     * The Complete QName.
+     */
+    public QName WSBA_ELEMENT_COMPLETE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_COMPLETE, WSBA_PREFIX) ;
+    /**
+     * The Complete Action.
+     */
+    public String WSBA_ACTION_COMPLETE = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_COMPLETE ;
+    /**
+     * The CannotComplete element.
+     */
+    public String WSBA_ELEMENT_CANNOT_COMPLETE = "CannotComplete" ;
+    /**
+     * The CannotComplete QName.
+     */
+    public QName WSBA_ELEMENT_CANNOT_COMPLETE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_CANNOT_COMPLETE, WSBA_PREFIX) ;
+    /**
+     * The CannotComplete Action.
+     */
+    public String WSBA_ACTION_CANNOT_COMPLETE = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_CANNOT_COMPLETE ;
+
+    /**
+     * The Failed element.
+     */
+    public String WSBA_ELEMENT_FAILED = "Failed" ;
+    /**
+     * The Failed QName.
+     */
+    public QName WSBA_ELEMENT_FAILED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_FAILED, WSBA_PREFIX) ;
+    /**
+     * The Failed Action.
+     */
+    public String WSBA_ACTION_FAILED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_FAILED ;
+
+    /**
+     * The NotCompleted element.
+     */
+    public String WSBA_ELEMENT_NOT_COMPLETED = "NotCompleted" ;
+    /**
+     * The NotCompleted QName.
+     */
+    public QName WSBA_ELEMENT_NOT_COMPLETED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_NOT_COMPLETED, WSBA_PREFIX) ;
+    /**
+     * The NotCompleted Action.
+     */
+    public String WSBA_ACTION_NOT_COMPLETED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_NOT_COMPLETED ;
+    /**
+     * The Exited element.
+     */
+    public String WSBA_ELEMENT_EXITED = "Exited" ;
+    /**
+     * The Exited QName.
+     */
+    public QName WSBA_ELEMENT_EXITED_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_EXITED, WSBA_PREFIX) ;
+    /**
+     * The Exited Action.
+     */
+    public String WSBA_ACTION_EXITED = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_EXITED ;
+    /**
+     * The GetStatus element.
+     */
+    public String WSBA_ELEMENT_GET_STATUS = "GetStatus" ;
+    /**
+     * The GetStatus QName.
+     */
+    public QName WSBA_ELEMENT_GET_STATUS_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_GET_STATUS, WSBA_PREFIX) ;
+    /**
+     * The GetStatus Action.
+     */
+    public String WSBA_ACTION_GET_STATUS = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_GET_STATUS ;
+    /**
+     * The State element.
+     */
+    public String WSBA_ELEMENT_STATE = "State" ;
+    /**
+     * The State QName.
+     */
+    public QName WSBA_ELEMENT_STATE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_STATE, WSBA_PREFIX) ;
+    /**
+     * The State Action.
+     */
+    public String WSBA_ACTION_STATE = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_STATE ;
+    /**
+     * The Status element.
+     */
+    public String WSBA_ELEMENT_STATUS = "Status" ;
+    /**
+     * The Status QName.
+     */
+    public QName WSBA_ELEMENT_STATUS_QNAME = new QName(WSBA_NAMESPACE, WSBA_ELEMENT_STATUS, WSBA_PREFIX) ;
+    /**
+     * The Status Action.
+     */
+    public String WSBA_ACTION_STATUS = WSBA_NAMESPACE + "/" + WSBA_ELEMENT_STATUS ;
+
+    /**
+     * The InconsistentInternalState error code.
+     */
+    public String WSBA_ERROR_CODE_INCONSISTENT_INTERNAL_STATE = "InconsistentInternalState" ;
+    /**
+     * The InconsistentInternalState error code QName.
+     */
+    public QName WSBA_ERROR_CODE_INCONSISTENT_INTERNAL_STATE_QNAME = new QName(WSBA_NAMESPACE, WSBA_ERROR_CODE_INCONSISTENT_INTERNAL_STATE, WSBA_PREFIX) ;
+
+    /**
+     * The business activity atomic outcome protocol.
+     */
+    public String WSBA_PROTOCOL_ATOMIC_OUTCOME = WSBA_NAMESPACE + "/AtomicOutcome" ;
+    /**
+     * The business activity mixed outcome protocol.
+     */
+    public String WSBA_PROTOCOL_MIXED_OUTCOME = WSBA_NAMESPACE + "/MixedOutcome" ;
+    /**
+     * The participant completion protocol.
+     */
+    public String WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION = WSBA_NAMESPACE + "/ParticipantCompletion" ;
+    /**
+     * The coordinator completion protocol.
+     */
+    public String WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION = WSBA_NAMESPACE + "/CoordinatorCompletion" ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionCoordinatorInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionCoordinatorInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionCoordinatorInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,119 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant events.
+ */
+public interface CoordinatorCompletionCoordinatorInboundEvents
+{
+    /**
+     * Handle the cancelled event.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the closed event.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the compensated event.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the completed event.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the exit event.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the fail event.
+     * @param fail The fail exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the cannotComplete event.
+     * @param cannotComplete The cannotComplete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the status event.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,115 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+
+/**
+ * The Participant events.
+ */
+public interface CoordinatorCompletionParticipantInboundEvents
+{
+    /**
+     * Handle the cancel event.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the close event.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the compensate event.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the complete event.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void complete(final NotificationType complete, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the exited event.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the failed event.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the not completed event.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the status event.
+     * @param status The status type.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionCoordinatorInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionCoordinatorInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionCoordinatorInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,119 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant events.
+ */
+public interface ParticipantCompletionCoordinatorInboundEvents
+{
+    /**
+     * Handle the cancelled event.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the closed event.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the compensated event.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the completed event.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the exit event.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the fail event.
+     * @param fail The fail exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the cannotComplete event.
+     * @param cannotComplete The cannotComplete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the status event.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionParticipantInboundEvents.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionParticipantInboundEvents.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/ParticipantCompletionParticipantInboundEvents.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,107 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant events.
+ */
+public interface ParticipantCompletionParticipantInboundEvents
+{
+    /**
+     * Handle the cancel event.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the close event.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the compensate event.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the exited event.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the failed event.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the not completed event.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the status event.
+     * @param status The status type.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/State.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/State.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/State.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,209 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba;
+
+import java.text.MessageFormat;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.Enumerated;
+import com.arjuna.webservices.util.InvalidEnumerationException;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+
+/*
+ * <xsd:simpleType name="StateType">
+ *   <xsd:restriction base="xsd:QName">
+ *     <xsd:enumeration value="wsba:Active"/>
+ *     <xsd:enumeration value="wsba:Canceling"/>
+ *     <xsd:enumeration value="wsba:Canceling-Active"/>
+ *     <xsd:enumeration value="wsba:Canceling-Completing"/>
+ *     <xsd:enumeration value="wsba:Completing"/>
+ *     <xsd:enumeration value="wsba:Completed"/>
+ *     <xsd:enumeration value="wsba:Closing"/>
+ *     <xsd:enumeration value="wsba:Compensating"/>
+ *     <xsd:enumeration value="wsba:Failing-Active"/>
+ *     <xsd:enumeration value="wsba:Failing-Canceling"/>
+ *     <xsd:enumeration value="wsba:Failing-Completing"/>
+ *     <xsd:enumeration value="wsba:Failing-Compensating"/>
+ *     <xsd:enumeration value="wsba:NotCompleting"/>
+ *     <xsd:enumeration value="wsba:Exiting"/>
+ *     <xsd:enumeration value="wsba:Ended"/>
+ *   </xsd:restriction>
+ * </xsd:simpleType>
+ */
+/**
+ * Class representing state enumerations.
+ * @author kevin
+ */
+public class State extends Enumerated
+{
+    /**
+     * Serial version UID for serialisation.
+     */
+
+    /**
+     * The Active state.
+     */
+    public static final State STATE_ACTIVE = new State("Active") ;
+    /**
+     * The Canceling state.
+     */
+    public static final State STATE_CANCELING = new State("Canceling") ;
+    /**
+     * The Canceling-Active state.
+     */
+    public static final State STATE_CANCELING_ACTIVE = new State("Canceling-Active") ;
+    /**
+     * The Canceling-Completing state.
+     */
+    public static final State STATE_CANCELING_COMPLETING = new State("Canceling-Completing") ;
+    /**
+     * The Completing state.
+     */
+    public static final State STATE_COMPLETING = new State("Completing") ;
+    /**
+     * The Completed state.
+     */
+    public static final State STATE_COMPLETED = new State("Completed") ;
+    /**
+     * The Closing state.
+     */
+    public static final State STATE_CLOSING = new State("Closing") ;
+    /**
+     * The Compensating state.
+     */
+    public static final State STATE_COMPENSATING = new State("Compensating") ;
+    /**
+     * The Failing-Active state.
+     */
+    public static final State STATE_FAILING_ACTIVE = new State("Failing-Active") ;
+    /**
+     * The Failing-Canceling state.
+     */
+    public static final State STATE_FAILING_CANCELING = new State("Failing-Canceling") ;
+    /**
+     * The Failing-Completing state.
+     */
+    public static final State STATE_FAILING_COMPLETING = new State("Failing-Completing") ;
+    /**
+     * The Failing-Compensating state.
+     */
+    public static final State STATE_FAILING_COMPENSATING = new State("Failing-Compensating") ;
+    /**
+     * The Exiting state.
+     */
+    public static final State STATE_EXITING = new State("Exiting") ;
+    /**
+     * The NotCompleting state.
+     */
+    public static final State STATE_NOT_COMPLETING = new State("NotCompleting") ;
+
+    /**
+     * The Ended state.
+     */
+    public static final State STATE_ENDED = new State("Ended") ;
+
+    /**
+     * The map of enumerations.
+     */
+    private static final Map ENUM_MAP = generateMap(new Enumerated[] {
+        STATE_ACTIVE, STATE_CANCELING, STATE_CANCELING_ACTIVE,
+        STATE_CANCELING_COMPLETING, STATE_COMPLETING, STATE_COMPLETED,
+        STATE_CLOSING, STATE_COMPENSATING, STATE_FAILING_ACTIVE, STATE_FAILING_CANCELING,
+        STATE_FAILING_COMPLETING, STATE_FAILING_COMPENSATING, STATE_EXITING,
+        STATE_NOT_COMPLETING, STATE_ENDED
+    }) ;
+
+    /**
+     * Construct the state enumeration with the specified value.
+     * @param value The localName of the state enumeration.
+     */
+    private State(final String value)
+    {
+        super(getQualifiedName(value)) ;
+    }
+
+    /**
+     * Get the value of this enumeration.
+     * @return the value.
+     */
+    public QName getValue()
+    {
+        return (QName)getKey() ;
+    }
+
+    /**
+     * Resolve the enumeration for the specified value.
+     * @param value The value.
+     * @return The enumeration.
+     * @throws com.arjuna.webservices.util.InvalidEnumerationException if the value is not valid.
+     */
+    protected Enumerated resolveEnum(final Object value)
+        throws InvalidEnumerationException
+    {
+        return toState11((QName)value) ;
+    }
+
+    /**
+     * Return the enumeration for the specified value.
+     * @param name The name.
+     * @return The enumeration.
+     * @throws com.arjuna.webservices.util.InvalidEnumerationException if the name is not valid.
+     */
+    public static State toState11(final String name)
+        throws InvalidEnumerationException
+    {
+        return toState11(getQualifiedName(name)) ;
+    }
+
+    /**
+     * Return the enumeration for the specified value.
+     * @param qName The qName value.
+     * @return The enumeration.
+     * @throws com.arjuna.webservices.util.InvalidEnumerationException if the value is not valid.
+     * @message com.arjuna.webservices11.wsba.State_1 [com.arjuna.webservices11.wsba.State_1] - Invalid state enumeration: {0}
+     */
+    public static State toState11(final QName qName)
+        throws InvalidEnumerationException
+    {
+        final Object state = ENUM_MAP.get(qName) ;
+        if (state == null)
+        {
+            final String pattern = WSTLogger.log_mesg.getString("com.arjuna.webservices11.wsba.State_1") ;
+            final String message = MessageFormat.format(pattern, new Object[] {qName}) ;
+            throw new InvalidEnumerationException(message) ;
+        }
+        return (State)state ;
+    }
+
+    /**
+     * Get the qualified name.
+     * @param name The name to qualify.
+     * @return The qualified name.
+     */
+    private static QName getQualifiedName(final String name)
+    {
+        return new QName(BusinessActivityConstants.WSBA_NAMESPACE,
+                name, BusinessActivityConstants.WSBA_PREFIX) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionCoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,308 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.client;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsba.client.WSBAClient;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Coordinator Completion Coordinator.
+ * @author kevin
+ */
+public class CoordinatorCompletionCoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final CoordinatorCompletionCoordinatorClient CLIENT = new CoordinatorCompletionCoordinatorClient() ;
+
+    /**
+     * The completed action.
+     */
+    private AttributedURI completedAction = null;
+    /**
+     * The fault action.
+     */
+    private AttributedURI failAction = null;
+    /**
+     * The compensated action.
+     */
+    private AttributedURI compensatedAction = null;
+    /**
+     * The closed action.
+     */
+    private AttributedURI closedAction = null;
+    /**
+     * The cancelled action.
+     */
+    private AttributedURI cancelledAction = null;
+    /**
+     * The exit action.
+     */
+    private AttributedURI cannotCompleteAction = null;
+    /**
+     * The exit action.
+     */
+    private AttributedURI exitAction = null;
+    /**
+     * The get status action.
+     */
+    private AttributedURI getStatusAction = null;
+    /**
+     * The status action.
+     */
+    private AttributedURI statusAction = null;
+
+    /**
+     * The coordinator completion participant URI for replies.
+     */
+    private AttributedURI coordinatorCompletionParticipant = null;
+
+    /**
+     * Construct the participant completion coordinator client.
+     */
+    private CoordinatorCompletionCoordinatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            completedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETED);
+            failAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_FAIL);
+            compensatedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
+            closedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSED);
+            cancelledAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCELLED);
+            exitAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXIT);
+            cannotCompleteAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANNOT_COMPLETE);
+            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        //final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        //AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        //ClientPolicy.register(handlerRegistry) ;
+
+        final String coordinatorCompletionParticipantURI =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME) ;
+        try {
+            coordinatorCompletionParticipant = builder.newURI(coordinatorCompletionParticipantURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a completed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, completedAction);
+        NotificationType completed = new NotificationType();
+
+        port.completedOperation(completed);
+    }
+
+    /**
+     * Send a fail request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendFail(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName exceptionIdentifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, failAction);
+        ExceptionType fail = new ExceptionType();
+        fail.setExceptionIdentifier(exceptionIdentifier);
+
+        port.failOperation(fail);
+    }
+
+    /**
+     * Send a compensated request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompensated(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, compensatedAction);
+        NotificationType compensated = new NotificationType();
+
+        port.compensatedOperation(compensated);
+    }
+
+    /**
+     * Send a closed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClosed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, closedAction);
+        NotificationType closed = new NotificationType();
+
+        port.closedOperation(closed);
+    }
+
+    /**
+     * Send a cancelled request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancelled(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, cancelledAction);
+        NotificationType camcelled = new NotificationType();
+
+        port.canceledOperation(camcelled);
+    }
+
+    /**
+     * Send an exit request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendExit(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, exitAction);
+        NotificationType exited = new NotificationType();
+
+        port.exitOperation(exited);
+    }
+
+    /**
+     * Send a cannot complete request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCannotComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, cannotCompleteAction);
+        NotificationType cannotComplete = new NotificationType();
+
+        port.cannotComplete(cannotComplete);
+    }
+
+    /**
+     * Send a get status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, getStatusAction);
+        NotificationType getStatus = new NotificationType();
+
+        port.getStatusOperation(getStatus);
+    }
+
+    /**
+     * Send a status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName state)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, statusAction);
+        StatusType status = new StatusType();
+        status.setState(state);
+
+        port.statusOperation(status);
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static CoordinatorCompletionCoordinatorClient getClient()
+    {
+        return CLIENT ;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private BusinessAgreementWithCoordinatorCompletionCoordinatorPortType
+    getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
+    {
+        return WSBAClient.getCoordinatorCompletionCoordinatorPort(participant, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/CoordinatorCompletionParticipantClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,305 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.client;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsba.client.WSBAClient;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Coordinator Participant Coordinator.
+ * @author kevin
+ */
+public class CoordinatorCompletionParticipantClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final CoordinatorCompletionParticipantClient CLIENT = new CoordinatorCompletionParticipantClient() ;
+
+    /**
+     * The complete action.
+     */
+    private AttributedURI completeAction = null;
+    /**
+     * The close action.
+     */
+    private AttributedURI closeAction = null;
+    /**
+     * The cancel action.
+     */
+    private AttributedURI cancelAction = null;
+    /**
+     * The compensat action.
+     */
+    private AttributedURI compensateAction = null;
+    /**
+     * The faulted action.
+     */
+    private AttributedURI failedAction = null;
+    /**
+     * The exited action.
+     */
+    private AttributedURI exitedAction = null;
+    /**
+     * The not completed action.
+     */
+    private AttributedURI notCompletedAction = null;
+    /**
+     * The get status action.
+     */
+    private AttributedURI getStatusAction = null;
+    /**
+     * The status action.
+     */
+    private AttributedURI statusAction = null;
+
+    /**
+     * The coordinator completion coordinator URI for replies.
+     */
+    private AttributedURI coordinatorCompletionCoordinator = null;
+
+    /**
+     * Construct the participant completion coordinator client.
+     */
+    private CoordinatorCompletionParticipantClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            completeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETE);
+            closeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSE);
+            cancelAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCEL);
+            compensateAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATE);
+            failedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_FAILED);
+            exitedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXITED);
+            notCompletedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_NOT_COMPLETED);
+            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String coordinatorCompletionCoordinatorURI =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME) ;
+        try {
+            coordinatorCompletionCoordinator = builder.newURI(coordinatorCompletionCoordinatorURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a complete request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, completeAction);
+        NotificationType complete = new NotificationType();
+
+        port.completeOperation(complete);
+    }
+
+    /**
+     * Send a close request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClose(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, closeAction);
+        NotificationType close = new NotificationType();
+
+        port.closeOperation(close);
+    }
+
+    /**
+     * Send a cancel request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancel(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, cancelAction);
+        NotificationType cancel = new NotificationType();
+
+        port.cancelOperation(cancel);
+    }
+
+    /**
+     * Send a compensate request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompensate(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, compensateAction);
+        NotificationType compensate = new NotificationType();
+
+        port.compensateOperation(compensate);
+    }
+
+    /**
+     * Send a failed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendFailed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, failedAction);
+        NotificationType failed = new NotificationType();
+
+        port.failedOperation(failed);
+    }
+
+    /**
+     * Send an exited request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendExited(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, exitedAction);
+        NotificationType exit = new NotificationType();
+
+        port.exitedOperation(exit);
+    }
+
+    /**
+     * Send an exited request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendNotCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, notCompletedAction);
+        NotificationType notCompleted = new NotificationType();
+
+        port.notCompleted(notCompleted);
+    }
+
+    /**
+     * Send a get status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, getStatusAction);
+        NotificationType getStatus = new NotificationType();
+
+        port.getStatusOperation(getStatus);
+    }
+
+    /**
+     * Send a status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName state)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, statusAction);
+        StatusType status = new StatusType();
+        status.setState(state);
+
+        port.statusOperation(status);
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static CoordinatorCompletionParticipantClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private BusinessAgreementWithCoordinatorCompletionParticipantPortType
+    getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
+    {
+        return WSBAClient.getCoordinatorCompletionParticipantPort(participant, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionCoordinatorClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,308 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.client;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsba.client.WSBAClient;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Participant Completion Coordinator.
+ * @author kevin
+ */
+public class ParticipantCompletionCoordinatorClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final ParticipantCompletionCoordinatorClient CLIENT = new ParticipantCompletionCoordinatorClient() ;
+
+    /**
+     * The completed action.
+     */
+    private AttributedURI completedAction = null;
+    /**
+     * The fault action.
+     */
+    private AttributedURI failAction = null;
+    /**
+     * The compensated action.
+     */
+    private AttributedURI compensatedAction = null;
+    /**
+     * The closed action.
+     */
+    private AttributedURI closedAction = null;
+    /**
+     * The cancelled action.
+     */
+    private AttributedURI cancelledAction = null;
+    /**
+     * The exit action.
+     */
+    private AttributedURI exitAction = null;
+    /**
+     * The cannot complete action.
+     */
+    private AttributedURI cannotCompleteAction = null;
+    /**
+     * The get status action.
+     */
+    private AttributedURI getStatusAction = null;
+    /**
+     * The status action.
+     */
+    private AttributedURI statusAction = null;
+
+    /**
+     * The participant completion participant URI for replies.
+     */
+    private AttributedURI participantCompletionParticipant = null;
+
+    /**
+     * Construct the participant completion coordinator client.
+     */
+    private ParticipantCompletionCoordinatorClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            completedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPLETED);
+            failAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_FAIL);
+            compensatedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATED);
+            closedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSED);
+            cancelledAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCELLED);
+            exitAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXIT);
+            cannotCompleteAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANNOT_COMPLETE);
+            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String participantCompletionParticipantURI =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME) ;
+        try {
+            participantCompletionParticipant = builder.newURI(participantCompletionParticipantURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a completed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, completedAction);
+        NotificationType completed = new NotificationType();
+
+        port.completedOperation(completed);
+    }
+
+    /**
+     * Send a fault request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendFail(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName exceptionIdentifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, failAction);
+        ExceptionType fail = new ExceptionType();
+        fail.setExceptionIdentifier(exceptionIdentifier);
+
+        port.failOperation(fail);
+    }
+
+    /**
+     * Send a compensated request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompensated(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, compensatedAction);
+        NotificationType compensated = new NotificationType();
+
+        port.compensatedOperation(compensated);
+    }
+
+    /**
+     * Send a closed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClosed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, closedAction);
+        NotificationType closed = new NotificationType();
+
+        port.closedOperation(closed);
+    }
+
+    /**
+     * Send a cancelled request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancelled(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, cancelledAction);
+        NotificationType cancelled = new NotificationType();
+
+        port.canceledOperation(cancelled);
+    }
+
+    /**
+     * Send an exit request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendExit(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, exitAction);
+        NotificationType exit = new NotificationType();
+
+        port.exitOperation(exit);
+    }
+
+    /**
+     * Send a cannot complete request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCannotComplete(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, cannotCompleteAction);
+        NotificationType cannotComplete = new NotificationType();
+
+        port.cannotComplete(cannotComplete);
+    }
+
+    /**
+     * Send a get status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, getStatusAction);
+        NotificationType getStatus = new NotificationType();
+
+        port.getStatusOperation(getStatus);
+    }
+
+    /**
+     * Send a status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName state)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
+        port = getPort(endpoint, addressingProperties, statusAction);
+        StatusType status = new StatusType();
+        status.setState(state);
+
+        port.statusOperation(status);
+    }
+
+    /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static ParticipantCompletionCoordinatorClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private BusinessAgreementWithParticipantCompletionCoordinatorPortType
+    getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
+    {
+        return WSBAClient.getParticipantCompletionCoordinatorPort(participant, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/ParticipantCompletionParticipantClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,283 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.client;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsba.client.WSBAClient;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+/**
+ * The Client side of the Participant Participant Coordinator.
+ * @author kevin
+ */
+public class ParticipantCompletionParticipantClient
+{
+    /**
+     * The client singleton.
+     */
+    private static final ParticipantCompletionParticipantClient CLIENT = new ParticipantCompletionParticipantClient() ;
+
+    /**
+     * The close action.
+     */
+    private AttributedURI closeAction = null;
+    /**
+     * The cancel action.
+     */
+    private AttributedURI cancelAction = null;
+    /**
+     * The compensat action.
+     */
+    private AttributedURI compensateAction = null;
+    /**
+     * The failed action.
+     */
+    private AttributedURI failedAction = null;
+    /**
+     * The exited action.
+     */
+    private AttributedURI exitedAction = null;
+    /**
+     * The not completed action.
+     */
+    private AttributedURI notCompletedAction = null;
+    /**
+     * The get status action.
+     */
+    private AttributedURI getStatusAction = null;
+    /**
+     * The status action.
+     */
+    private AttributedURI statusAction = null;
+
+    /**
+     * The participant completion coordinator URI for replies.
+     */
+    private AttributedURI participantCompletionCoordinator = null;
+
+    /**
+     * Construct the participant completion coordinator client.
+     */
+    private ParticipantCompletionParticipantClient()
+    {
+        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+        try {
+            closeAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CLOSE);
+            cancelAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_CANCEL);
+            compensateAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_COMPENSATE);
+            failedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_FAILED);
+            exitedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_EXITED);
+            notCompletedAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_NOT_COMPLETED);
+            getStatusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_GET_STATUS);
+            statusAction = builder.newURI(BusinessActivityConstants.WSBA_ACTION_STATUS);
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;
+
+        // Add WS-Addressing
+        // AddressingPolicy.register(handlerRegistry) ;
+        // Add client policies
+        // ClientPolicy.register(handlerRegistry) ;
+
+        final String participantCompletionCoordinatorURI =
+            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME) ;
+        try {
+            participantCompletionCoordinator = builder.newURI(participantCompletionCoordinatorURI) ;
+        } catch (URISyntaxException use) {
+            // TODO - log fault and throw exception
+        }
+    }
+
+    /**
+     * Send a close request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendClose(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, closeAction);
+        NotificationType close = new NotificationType();
+
+        port.closeOperation(close);
+    }
+
+    /**
+     * Send a cancel request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCancel(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, cancelAction);
+        NotificationType cancel = new NotificationType();
+
+        port.cancelOperation(cancel);
+    }
+
+    /**
+     * Send a compensate request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendCompensate(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, compensateAction);
+        NotificationType compensate = new NotificationType();
+
+        port.compensateOperation(compensate);
+    }
+
+    /**
+     * Send a failed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendFailed(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, failedAction);
+        NotificationType failed = new NotificationType();
+
+        port.failedOperation(failed);
+    }
+
+    /**
+     * Send an exited request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendExited(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, exitedAction);
+        NotificationType exited = new NotificationType();
+
+        port.exitedOperation(exited);
+    }
+
+    /**
+     * Send a not completed request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendNotCompleted(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, notCompletedAction);
+        NotificationType notCompleted = new NotificationType();
+
+        port.notCompleted(notCompleted);
+    }
+
+    /**
+     * Send a get status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendGetStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, getStatusAction);
+        NotificationType getStatus = new NotificationType();
+
+        port.getStatusOperation(getStatus);
+    }
+
+    /**
+     * Send a status request.
+     * @param addressingProperties addressing context initialised with to and message ID.
+     * @param identifier The identifier of the initiator.
+     * @throws com.arjuna.webservices.SoapFault For any errors.
+     * @throws java.io.IOException for any transport errors.
+     */
+    public void sendStatus(W3CEndpointReference endpoint, final AddressingProperties addressingProperties, final InstanceIdentifier identifier,
+        final QName state)
+        throws SoapFault, IOException
+    {
+        BusinessAgreementWithParticipantCompletionParticipantPortType port;
+        port = getPort(endpoint, addressingProperties, statusAction);
+        StatusType status = new StatusType();
+        status.setState(state);
+
+        port.statusOperation(status);
+    }
+
+   /**
+     * Get the Completion Coordinator client singleton.
+     * @return The Completion Coordinator client singleton.
+     */
+    public static ParticipantCompletionParticipantClient getClient()
+    {
+        return CLIENT;
+    }
+
+    /**
+     * obtain a port from the participant endpoint configured with the instance identifier handler and the supplied
+     * addressing properties supplemented with the given action
+     * @param participant
+     * @param addressingProperties
+     * @param action
+     * @return
+     */
+    private BusinessAgreementWithParticipantCompletionParticipantPortType
+    getPort(final W3CEndpointReference participant, final AddressingProperties addressingProperties, final AttributedURI action)
+    {
+        return WSBAClient.getParticipantCompletionParticipantPort(participant, action, addressingProperties);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/WSBAClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/WSBAClient.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/client/WSBAClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,255 @@
+package com.arjuna.webservices11.wsba.client;
+
+import com.arjuna.webservices11.wsarj.handler.InstanceIdentifierHandler;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.*;
+import org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.AddressingFeature;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 7, 2007
+ * Time: 3:14:28 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class WSBAClient
+{
+    // TODO -- do we really need a thread local here or can we just use one service?
+    /**
+     *  thread local which maintains a per thread participant completion coordinator service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithParticipantCompletionCoordinatorService> participantCompletionCoordinatorService = new ThreadLocal<BusinessAgreementWithParticipantCompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread participant completion participant service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithParticipantCompletionParticipantService> participantCompletionParticipantService = new ThreadLocal<BusinessAgreementWithParticipantCompletionParticipantService>();
+
+    /**
+     *  thread local which maintains a per thread coordinator completion coordinator service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithCoordinatorCompletionCoordinatorService> coordinatorCompletionCoordinatorService = new ThreadLocal<BusinessAgreementWithCoordinatorCompletionCoordinatorService>();
+
+    /**
+     *  thread local which maintains a per thread coordinator completion participant service instance
+     */
+    private static ThreadLocal<BusinessAgreementWithCoordinatorCompletionParticipantService> coordinatorCompletionParticipantService = new ThreadLocal<BusinessAgreementWithCoordinatorCompletionParticipantService>();
+
+    /**
+     *  builder used to construct addressing info for calls
+     */
+    private static AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+
+    /**
+     * fetch a participant completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithParticipantCompletionCoordinatorService getParticipantCompletionCoordinatorService()
+    {
+        if (participantCompletionCoordinatorService.get() == null) {
+            participantCompletionCoordinatorService.set(new BusinessAgreementWithParticipantCompletionCoordinatorService());
+        }
+        return participantCompletionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a participant completion participant service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithParticipantCompletionParticipantService getParticipantCompletionParticipantService()
+    {
+        if (participantCompletionParticipantService.get() == null) {
+            participantCompletionParticipantService.set(new BusinessAgreementWithParticipantCompletionParticipantService());
+        }
+        return participantCompletionParticipantService.get();
+    }
+
+    /**
+     * fetch a coordinator completion coordinator service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithCoordinatorCompletionCoordinatorService getCoordinatorCompletionCoordinatorService()
+    {
+        if (coordinatorCompletionCoordinatorService.get() == null) {
+            coordinatorCompletionCoordinatorService.set(new BusinessAgreementWithCoordinatorCompletionCoordinatorService());
+        }
+        return coordinatorCompletionCoordinatorService.get();
+    }
+
+    /**
+     * fetch a coordinator completion participant service unique to the current thread
+     * @return
+     */
+    private static synchronized BusinessAgreementWithCoordinatorCompletionParticipantService getCoordinatorCompletionParticipantService()
+    {
+        if (coordinatorCompletionParticipantService.get() == null) {
+            coordinatorCompletionParticipantService.set(new BusinessAgreementWithCoordinatorCompletionParticipantService());
+        }
+        return coordinatorCompletionParticipantService.get();
+    }
+
+    public static BusinessAgreementWithParticipantCompletionCoordinatorPortType getParticipantCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        BusinessAgreementWithParticipantCompletionCoordinatorService service = getParticipantCompletionCoordinatorService();
+        // BusinessAgreementWithParticipantCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        BusinessAgreementWithParticipantCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionCoordinatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    // don't think we ever need this as we get a registration port from the endpoint ref returned by
+    // the activation port request
+    public static BusinessAgreementWithParticipantCompletionParticipantPortType getParticipantCompletionParticipantPort(W3CEndpointReference endpointReference,
+                                                         AttributedURI action,
+                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        BusinessAgreementWithParticipantCompletionParticipantService service = getParticipantCompletionParticipantService();
+        // BusinessAgreementWithParticipantCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionParticipantPortType.class, new AddressingFeature(true, true));
+        BusinessAgreementWithParticipantCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithParticipantCompletionParticipantPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         * TODO - don't think this is correct here
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    public static BusinessAgreementWithCoordinatorCompletionCoordinatorPortType getCoordinatorCompletionCoordinatorPort(W3CEndpointReference endpointReference,
+                                                                             AttributedURI action,
+                                                                             AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        BusinessAgreementWithCoordinatorCompletionCoordinatorService service = getCoordinatorCompletionCoordinatorService();
+        // BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.class, new AddressingFeature(true, true));
+        BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+
+    public static BusinessAgreementWithCoordinatorCompletionParticipantPortType getCoordinatorCompletionParticipantPort(W3CEndpointReference endpointReference,
+                                                                         AttributedURI action,
+                                                                         AddressingProperties addressingProperties)
+    {
+        // TODO - we need the 2.1 verison of Service so we can specify that we want to use the WS Addressing feature
+        BusinessAgreementWithCoordinatorCompletionParticipantService service = getCoordinatorCompletionParticipantService();
+        // BusinessAgreementWithCoordinatorCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionParticipantPortType.class, new AddressingFeature(true, true));
+        BusinessAgreementWithCoordinatorCompletionParticipantPortType port = service.getPort(endpointReference, BusinessAgreementWithCoordinatorCompletionParticipantPortType.class);
+        BindingProvider bindingProvider = (BindingProvider)port;
+        /*
+         * we need to configure an instance identifier handler for this port to pass the tx context either
+         * outgoing or returning.
+         * TODO - don't think this is correct here
+         */
+        List<Handler> customHandlerChain = new ArrayList<Handler>();
+        customHandlerChain.add(new InstanceIdentifierHandler());
+        /*
+         * we also have to add the JaxWS WSAddressingClientHandler because we cannoy specify the WSAddressing feature
+         */
+		customHandlerChain.add(new WSAddressingClientHandler());
+		bindingProvider.getBinding().setHandlerChain(customHandlerChain);
+        // ok, JBossWS native has hacked this by pulling the address and reference parameters out of the endpoint
+        // and storing them in an AddressingProperties instance hung off the context under CLIENT_ADDRESSING_PROPERTIES_OUTBOUND.
+        // we still need to set the action and message id and possibly relatesTo -- this is all distinctly non-portable :-/
+        // n.b. Metro installs the address in requestContext under ENDPOINT_ADDRESS_PROPERTY. it also seems to ensure
+        // that the reference parameters get installed -- but how?
+
+        // the address will have been pulled out of the endpoint by getPort but we still have to set it in the
+        // addressing properties along with the action and message id
+        Map<String, Object> requestContext = bindingProvider.getRequestContext();
+        AddressingProperties requestProperties = (AddressingProperties)requestContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND);
+        addressingProperties.setAction(action);
+        AddressingHelper.installCallerProperties(addressingProperties, requestProperties);
+        // we should not need to do this but JBossWS does not pick up the value in the addressing properties
+        requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, requestProperties.getTo().getURI().toString());
+        return port;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,160 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Coordinator Completion Coordinator processor.
+ * @author kevin
+ */
+public abstract class CoordinatorCompletionCoordinatorProcessor
+{
+    /**
+     * The coordinator processor.
+     */
+    private static CoordinatorCompletionCoordinatorProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The singleton.
+     */
+    public static synchronized CoordinatorCompletionCoordinatorProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized CoordinatorCompletionCoordinatorProcessor setProcessor(final CoordinatorCompletionCoordinatorProcessor processor)
+    {
+        final CoordinatorCompletionCoordinatorProcessor origProcessor = PROCESSOR ;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public abstract void activateCoordinator(final CoordinatorCompletionCoordinatorInboundEvents coordinator, final String identifier) ;
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public abstract void deactivateCoordinator(final CoordinatorCompletionCoordinatorInboundEvents coordinator) ;
+
+    /**
+     * Cancelled.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Closed.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Compensated.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Fail.
+     * @param fail The fail exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void fail(final ExceptionType fail, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Completed.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Exit.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Cannot complete.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionParticipantProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/CoordinatorCompletionParticipantProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,157 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Coordinator Completion Participant processor.
+ * @author kevin
+ */
+public abstract class CoordinatorCompletionParticipantProcessor
+{
+    /**
+     * The participant processor.
+     */
+    private static CoordinatorCompletionParticipantProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static synchronized CoordinatorCompletionParticipantProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized CoordinatorCompletionParticipantProcessor setProcessor(final CoordinatorCompletionParticipantProcessor processor)
+    {
+        final CoordinatorCompletionParticipantProcessor origProcessor = PROCESSOR ;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public abstract void activateParticipant(final CoordinatorCompletionParticipantInboundEvents participant, final String identifier) ;
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public abstract void deactivateParticipant(final CoordinatorCompletionParticipantInboundEvents participant) ;
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Compensate.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Complete.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void complete(final NotificationType complete, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Exited.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Failed.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionCoordinatorProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionCoordinatorProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionCoordinatorProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,160 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant Completion Coordinator processor.
+ * @author kevin
+ */
+public abstract class ParticipantCompletionCoordinatorProcessor
+{
+    /**
+     * The coordinator processor.
+     */
+    private static ParticipantCompletionCoordinatorProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static synchronized ParticipantCompletionCoordinatorProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized ParticipantCompletionCoordinatorProcessor setProcessor(final ParticipantCompletionCoordinatorProcessor processor)
+    {
+        final ParticipantCompletionCoordinatorProcessor origProcessor = PROCESSOR ;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public abstract void activateCoordinator(final ParticipantCompletionCoordinatorInboundEvents coordinator, final String identifier) ;
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public abstract void deactivateCoordinator(final ParticipantCompletionCoordinatorInboundEvents coordinator) ;
+
+    /**
+     * Cancelled.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Closed.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Compensated.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Completed.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Completed.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext);
+
+    /**
+     * Exit.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Fault.
+     * @param fail The fault exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionParticipantProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionParticipantProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/processors/ParticipantCompletionParticipantProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,148 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.processors;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Participant Completion Participant processor.
+ * @author kevin
+ */
+public abstract class ParticipantCompletionParticipantProcessor
+{
+    /**
+     * The participant processor.
+     */
+    private static ParticipantCompletionParticipantProcessor PROCESSOR ;
+
+    /**
+     * Get the processor.
+     * @return The processor.
+     */
+    public static synchronized ParticipantCompletionParticipantProcessor getProcessor()
+    {
+        return PROCESSOR ;
+    }
+
+    /**
+     * Set the processor.
+     * @param processor The processor.
+     * @return The previous processor.
+     */
+    public static synchronized ParticipantCompletionParticipantProcessor setProcessor(final ParticipantCompletionParticipantProcessor processor)
+    {
+        final ParticipantCompletionParticipantProcessor origProcessor = PROCESSOR ;
+        PROCESSOR = processor ;
+        return origProcessor ;
+    }
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public abstract void activateParticipant(final ParticipantCompletionParticipantInboundEvents participant, final String identifier) ;
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public abstract void deactivateParticipant(final ParticipantCompletionParticipantInboundEvents participant) ;
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Compensate.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Exited.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Faulted.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext) ;
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public abstract void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext) ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,248 @@
+
+package com.arjuna.webservices11.wsba.sei;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsba-coordinator-completion-coordinator-binding.wsdl",
+        serviceName = "BusinessAgreementWithCoordinatorCompletionCoordinatorService",
+        portName = "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl implements BusinessAgreementWithCoordinatorCompletionCoordinatorPortType
+{
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType completed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().completed(completed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
+    @Oneway
+    public void failOperation(
+        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        ExceptionType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final ExceptionType fail = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().fail(fail, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensatedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated")
+    @Oneway
+    public void compensatedOperation(
+        @WebParam(name = "Compensated", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensated = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().compensated(compensated, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType closed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().closed(closed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CanceledOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled")
+    @Oneway
+    public void canceledOperation(
+        @WebParam(name = "Canceled", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType canceled = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().cancelled(canceled, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit")
+    @Oneway
+    public void exitOperation(
+        @WebParam(name = "Exit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exit = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().exit(exit, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CannotComplete", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete")
+    @Oneway
+    public void cannotComplete(
+        @WebParam(name = "CannotComplete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cannotComplete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().cannotComplete(cannotComplete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionCoordinatorProcessor.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,247 @@
+
+package com.arjuna.webservices11.wsba.sei;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "BusinessAgreementWithCoordinatorCompletionParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsba-coordinator-completion-participant-binding.wsdl",
+        serviceName = "BusinessAgreementWithCoordinatorCompletionParticipantService",
+        portName = "BusinessAgreementWithCoordinatorCompletionParticipantPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl implements BusinessAgreementWithCoordinatorCompletionParticipantPortType
+{
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompleteOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/mplete")
+    @Oneway
+    public void completeOperation(
+        @WebParam(name = "Complete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType complete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().complete(complete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType close = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancel = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensateOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void compensateOperation(
+        @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensate = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().compensate(compensate, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed")
+    @Oneway
+    public void failedOperation(
+        @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType failed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().failed(failed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited")
+    @Oneway
+    public void exitedOperation(
+        @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exited = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().exited(exited, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "NotCompleted", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted")
+    @Oneway
+    public void notCompleted(
+        @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType notCompleted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().notCompleted(notCompleted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                CoordinatorCompletionParticipantProcessor.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,247 @@
+
+package com.arjuna.webservices11.wsba.sei;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "BusinessAgreementWithParticipantCompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsba-participant-completion-coordinator-binding.wsdl",
+        serviceName = "BusinessAgreementWithParticipantCompletionCoordinatorService",
+        portName = "BusinessAgreementWithParticipantCompletionCoordinatorPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl implements BusinessAgreementWithParticipantCompletionCoordinatorPortType
+{
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType completed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().completed(completed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
+    @Oneway
+    public void failOperation(
+        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        ExceptionType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final ExceptionType fail = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().fail(fail, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensatedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated")
+    @Oneway
+    public void compensatedOperation(
+        @WebParam(name = "Compensated", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensated = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().compensated(compensated, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType closed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().closed(closed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CanceledOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled")
+    @Oneway
+    public void canceledOperation(
+        @WebParam(name = "Canceled", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancelled = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().cancelled(cancelled, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit")
+    @Oneway
+    public void exitOperation(
+        @WebParam(name = "Exit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exit = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().exit(exit, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CannotComplete", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete")
+    @Oneway
+    public void cannotComplete(
+        @WebParam(name = "CannotComplete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cannotComplete = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().cannotComplete(cannotComplete, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionCoordinatorProcessor.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/sei/BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,223 @@
+
+package com.arjuna.webservices11.wsba.sei;
+
+import com.arjuna.services.framework.task.Task;
+import com.arjuna.services.framework.task.TaskManager;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantPortType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.annotation.Resource;
+import javax.jws.*;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.JAXWSAConstants;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.soap.Addressing;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.1-b03-
+ * Generated source version: 2.0
+ *
+ */
+ at WebService(name = "BusinessAgreementWithParticipantCompletionParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06",
+        wsdlLocation = "/WEB-INF/wsdl/wsba-participant-completion-participant-binding.wsdl",
+        serviceName = "BusinessAgreementWithParticipantCompletionParticipantService",
+        portName = "BusinessAgreementWithParticipantCompletionParticipantPortType"
+)
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at HandlerChain(file="handlers.xml")
+ at Addressing(required=true)
+public class BusinessAgreementWithParticipantCompletionParticipantPortTypeImpl implements BusinessAgreementWithParticipantCompletionParticipantPortType
+{
+    @Resource
+    private WebServiceContext webServiceCtx;
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType close = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().close(close, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType cancel = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().cancel(cancel, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensateOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensate")
+    @Oneway
+    public void compensateOperation(
+        @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType compensate = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().compensate(compensate, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed")
+    @Oneway
+    public void failedOperation(
+        @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType failed = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().failed(failed, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited")
+    @Oneway
+    public void exitedOperation(
+        @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType exited = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().exited(exited, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "NotCompleted", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted")
+    @Oneway
+    public void notCompleted(
+        @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType notCompleted = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().notCompleted(notCompleted, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final NotificationType getStatus = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().getStatus(getStatus, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+
+    /**
+     *
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters)
+    {
+        MessageContext ctx = webServiceCtx.getMessageContext();
+        final StatusType status = parameters;
+        final AddressingProperties inboundAddressProperties
+            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
+        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
+
+        TaskManager.getManager().queueTask(new Task() {
+            public void executeTask() {
+                ParticipantCompletionParticipantProcessor.getProcessor().status(status, inboundAddressProperties, arjunaContext) ;
+            }
+        }) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.server;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Activate the Coordinator Completion Coordinator service
+ * @author kevin
+ */
+public class CoordinatorCompletionCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/CoordinatorCompletionParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Coordinator Completion Participant service
+ * @author kevin
+ */
+public class CoordinatorCompletionParticipantInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionCoordinatorInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Participant Completion Coordinator service
+ * @author kevin
+ */
+public class ParticipantCompletionCoordinatorInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/webservices11/wsba/server/ParticipantCompletionParticipantInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.webservices11.wsba.server;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
+
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.services.framework.startup.Sequencer;
+
+/**
+ * Activate the Participant Completion Participant service
+ * @author kevin
+ */
+public class ParticipantCompletionParticipantInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        ServletContext context = servletContextEvent.getServletContext();
+        String baseURI = context.getInitParameter("BaseURI");
+        final String uri = baseURI + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+               serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, uri) ;
+           }
+        };
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BAParticipantManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BAParticipantManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BAParticipantManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,83 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
+ */
+
+package com.arjuna.wst11;
+
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.SystemException;
+
+import javax.xml.namespace.QName;
+
+/**
+ * When a Business Activity participant registers with a BA transaction it
+ * gets a reference to the transaction coordinator that lets it callback
+ * into the transaction and drive the state-transition.
+ *
+ * One instance of this per transaction.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BAParticipantManager.java,v 1.5 2004/09/09 08:48:33 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public interface BAParticipantManager
+{
+
+    /**
+     * The participant has exited the business activity. The participant
+     * uses this to inform the coordinator that is has left the activity.
+     * It will not be informed when (and how) the business activity terminates.
+     */
+
+    public void exit () throws WrongStateException, UnknownTransactionException, SystemException;
+
+    /**
+     * The participant has completed it works, but wishes to continue in
+     * the business activity, so that it will eventually be told when (and how)
+     * the activity terminates. The participant may later be asked to
+     * compensate for the work it has done.
+     */
+
+    public void completed () throws WrongStateException, UnknownTransactionException, SystemException;
+
+    /**
+     * Cannot complete.
+     */
+
+    public void cannotComplete () throws WrongStateException, UnknownTransactionException, SystemException;
+
+    /**
+     * Fault.
+     */
+
+    public void fail (final QName exceptionIdentifier) throws SystemException;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BusinessActivityTerminator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BusinessActivityTerminator.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/BusinessActivityTerminator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,47 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityTerminator.java,v 1.4 2004/09/09 08:48:32 kconner Exp $
+ */
+
+package com.arjuna.wst11;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Not in the 1.1 specification. Supposed to use participant interface.
+ */
+
+public interface BusinessActivityTerminator extends com.arjuna.wst.BusinessActivityTerminator
+{
+    /**
+     * return either the terminator or participant endpoint depending upon what type of terminator strub this is
+     * @return
+     */
+    public W3CEndpointReference getEndpoint() ;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/CompletionCoordinatorParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/CompletionCoordinatorParticipant.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/CompletionCoordinatorParticipant.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,11 @@
+package com.arjuna.wst11;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ */
+
+public interface CompletionCoordinatorParticipant extends com.arjuna.wst.CompletionCoordinatorParticipant
+{
+    public W3CEndpointReference getParticipant();
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CompletionCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CompletionCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CompletionCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,221 @@
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.client.CompletionInitiatorClient;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import java.text.MessageFormat;
+
+/**
+ * The Completion Coordinator processor.
+ * @author kevin
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_1 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_1] - Unknown transaction
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_2 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_2] - Unknown error: {0}
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_3 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_3] - Unexpected exception thrown from commit:
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_4 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_4] - Commit called on unknown participant: {0}
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_5 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_5] - Unknown participant
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_6 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_6] - Unknown transaction
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_7 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_7] - Unknown error: {0}
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_8 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_8] - Unexpected exception thrown from rollback:
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_9 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_9] - Rollback called on unknown participant: {0}
+ * @message com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_10 [com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_10] - Unknown participant
+ */
+public class CompletionCoordinatorProcessorImpl extends CompletionCoordinatorProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public void activateParticipant(final CompletionCoordinatorParticipant participant, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(participant, identifier) ;
+    }
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public void deactivateParticipant(final CompletionCoordinatorParticipant participant)
+    {
+        activatedObjectProcessor.deactivateObject(participant) ;
+    }
+
+    /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    private CompletionCoordinatorParticipant getParticipant(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (CompletionCoordinatorParticipant)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Commit.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void commit(final Notification commit, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CompletionCoordinatorParticipant participant = getParticipant(instanceIdentifier) ;
+
+        try
+        {
+            if (participant != null)
+            {
+                final String messageId = MessageId.getMessageId() ;
+                try
+                {
+                    participant.commit() ;
+                }
+                catch (final TransactionRolledBackException trbe)
+                {
+                    final AddressingProperties responseAddressingContext =
+                        AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+                    CompletionInitiatorClient.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final UnknownTransactionException ute)
+                {
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_1")) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final SystemException se)
+                {
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_2") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {se}) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final Throwable th)
+                {
+                    if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_3", th) ;
+                    }
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                    final SoapFault soapFault = new SoapFault11(th) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                final AddressingProperties responseAddressingContext = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+                CompletionInitiatorClient.getClient().sendCommitted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
+            }
+            else
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_4", new Object[] {instanceIdentifier}) ;
+                }
+                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_5")) ;
+                CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+        }
+    }
+
+    /**
+     * Rollback.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void rollback(final Notification rollback, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CompletionCoordinatorParticipant participant = getParticipant(instanceIdentifier) ;
+
+        try
+        {
+            if (participant != null)
+            {
+                final String messageId = MessageId.getMessageId() ;
+                try
+                {
+                    participant.rollback() ;
+                }
+                catch (final UnknownTransactionException ute)
+                {
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_6")) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (SystemException systemException)
+                {
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_7") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {systemException}) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final Throwable th)
+                {
+                    if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_8", th) ;
+                    }
+                    final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                    final SoapFault soapFault = new SoapFault11(th) ;
+                    CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                final AddressingProperties responseAddressingContext = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+                CompletionInitiatorClient.getClient().sendAborted(participant.getParticipant(), responseAddressingContext, instanceIdentifier) ;
+            }
+            else
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_9", new Object[] {instanceIdentifier}) ;
+                }
+                final AddressingProperties faultAddressingContext = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                    WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CompletionCoordinatorProcessorImpl_10")) ;
+                CompletionInitiatorClient.getClient().sendSoapFault(participant.getParticipant(), faultAddressingContext, soapFault, instanceIdentifier) ;
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,484 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Coordinator Completion Coordinator processor.
+ * @author kevin
+ */
+public class CoordinatorCompletionCoordinatorProcessorImpl extends CoordinatorCompletionCoordinatorProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public void activateCoordinator(final CoordinatorCompletionCoordinatorInboundEvents coordinator, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(coordinator, identifier) ;
+    }
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public void deactivateCoordinator(final CoordinatorCompletionCoordinatorInboundEvents coordinator)
+    {
+        activatedObjectProcessor.deactivateObject(coordinator) ;
+    }
+
+    /**
+     * Get the coordinator associated with the specified identifier.
+     * @param instanceIdentifier The coordinator identifier.
+     * @return The coordinator or null if not known.
+     */
+    private CoordinatorCompletionCoordinatorInboundEvents getCoordinator(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (CoordinatorCompletionCoordinatorInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Cancelled.
+     * @param cancelled The canceled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.canceled_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cancelled_1] - Unexpected exception thrown from cancelled:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.canceled_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cancelled_2] - Cancelled called on unknown coordinator: {0}
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.cancelled(cancelled, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.canceled_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.canceled_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Closed.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_1] - Unexpected exception thrown from closed:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_2] - Closed called on unknown coordinator: {0}
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.closed(closed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.closed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Compensated.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_1] - Unexpected exception thrown from compensated:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_2] - Compensated called on unknown coordinator: {0}
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.compensated(compensated, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.compensated_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+      * Fail.
+      * @param fail The fail exceptionnotification.
+      * @param addressingProperties The addressing context.
+      * @param arjunaContext The arjuna context.
+      *
+      * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_1] - Unexpected exception thrown from compensated:
+      * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_2] - Compensated called on unknown coordinator: {0}
+      */
+     public void fail(final ExceptionType fail, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+     {
+         final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+         final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+         if (coordinator != null)
+         {
+             try
+             {
+                 coordinator.fail(fail, addressingProperties, arjunaContext) ;
+             }
+             catch (final Throwable th)
+             {
+                 if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                 {
+                     WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_1", th) ;
+                 }
+             }
+         }
+         else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+         {
+             WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.fail_2", new Object[] {instanceIdentifier}) ;
+         }
+     }
+    
+    /**
+     * Completed.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_1] - Unexpected exception thrown from completed:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_2] - Completed called on unknown coordinator: {0}
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.completed(completed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.completed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Exit.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_1] - Unexpected exception thrown from exit:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_2] - Exit called on unknown coordinator: {0}
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.exit(exit, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.exit_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendExited(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * FaulCannot completet.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_1] - Unexpected exception thrown from fault:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_2] - Fault called on unknown coordinator: {0}
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.cannotComplete(cannotComplete, addressingProperties, arjunaContext); ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.cannotComplete_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendFailed(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_1] - Unexpected exception thrown from getStatus:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_2] - GetStatus called on unknown coordinator: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.getStatus(getStatus, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.getStatus_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_1] - Unexpected exception thrown from status:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_2] - Status called on unknown coordinator: {0}
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.status(status, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.status_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_2] - SoapFault called on unknown coordinator: {0}
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.soapFault(soapFault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Send an exited message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendExited_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendExited_1] - Unexpected exception while sending Exited
+     */
+    private void sendExited(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO cannot do this without an endpoint so we have to log an error message!
+            // CoordinatorCompletionParticipantClient.getClient().sendExited(responseAddressingContext, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendExited_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a faulted message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFailed_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFailed_1] - Unexpected exception while sending Faulted
+     */
+    private void sendFailed(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO cannot do this without an endpoint so we have to log an error message!
+            // CoordinatorCompletionParticipantClient.getClient().sendFailed(responseAddressingContext, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFailed_1", th) ;
+            }
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionParticipantProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionParticipantProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorCompletionParticipantProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,549 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Coordinator Completion Participant processor.
+ * @author kevin
+ */
+public class CoordinatorCompletionParticipantProcessorImpl extends CoordinatorCompletionParticipantProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public void activateParticipant(final CoordinatorCompletionParticipantInboundEvents participant, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(participant, identifier) ;
+    }
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public void deactivateParticipant(final CoordinatorCompletionParticipantInboundEvents participant)
+    {
+        activatedObjectProcessor.deactivateObject(participant) ;
+    }
+
+    /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    private CoordinatorCompletionParticipantInboundEvents getParticipant(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (CoordinatorCompletionParticipantInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_1] - Unexpected exception thrown from cancel:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_2] - Cancel called on unknown participant: {0}
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.cancel(cancel, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.cancel_2", new Object[] {instanceIdentifier}) ;
+            }
+            // TODO - cannot do this as we don't have an endpoint
+            // sendCancelled(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_1] - Unexpected exception thrown from close:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_2] - Close called on unknown participant: {0}
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.close(close, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.close_2", new Object[] {instanceIdentifier}) ;
+            }
+            // TODO - cannot do this as we don't have an endpoint
+            // sendClosed(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Compensate.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_1] - Unexpected exception thrown from compensate:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_2] - Compensate called on unknown participant: {0}
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.compensate(compensate, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.compensate_2", new Object[] {instanceIdentifier}) ;
+            }
+            // TODO - cannot do this as we don't have an endpoint
+            // sendCompensated(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Complete.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_1] - Unexpected exception thrown from complete:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_2] - Complete called on unknown participant: {0}
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_3 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_3] - Complete called on unknown participant
+     */
+    public void complete(final NotificationType complete, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.complete(complete, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_2", new Object[] {instanceIdentifier}) ;
+            }
+            // TODO - cannot do this as we don't have an endpoint
+            // sendFault(addressingProperties, arjunaContext, WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.complete_3")) ;
+        }
+    }
+
+    /**
+     * Exited.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_1] - Unexpected exception thrown from exited:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_2] - Exited called on unknown participant: {0}
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.exited(exited, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.exited_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_1] - Unexpected exception thrown from notCompleted:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_2] - NotCompleted called on unknown participant: {0}
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.notCompleted(notCompleted, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.notCompleted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Failed.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.failed_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.failed_1] - Unexpected exception thrown from failed:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.failed_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.failed_2] - Failed called on unknown participant: {0}
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.failed(failed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.faulted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.faulted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_1] - Unexpected exception thrown from getStatus:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_2] - GetStatus called on unknown participant: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.getStatus(getStatus, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.getStatus_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_1] - Unexpected exception thrown from status:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_2] - Status called on unknown participant: {0}
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.status(status, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.status_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * SOAP Fault.
+     * @param fault The SOAP fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_2] - SoapFault called on unknown participant: {0}
+     */
+    public void soapFault(final SoapFault fault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.soapFault(fault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionParticipantProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Send a cancelled message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCancelled_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCancelled_1] - Unexpected exception while sending Cancelled
+     */
+    private void sendCancelled(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - have to just log an error as we cannot do this without a client endpoint
+            // CoordinatorCompletionCoordinatorClient.getClient().sendCancelled(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCancelled_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a closed message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendClosed_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendClosed_1] - Unexpected exception while sending Closed
+     */
+    private void sendClosed(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - have to just log an error as we cannot do this without a client endpoint
+            // CoordinatorCompletionCoordinatorClient.getClient().sendClosed(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendClosed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a compensated message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCompensated_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCompensated_1] - Unexpected exception while sending Compensated
+     */
+    private void sendCompensated(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - have to just log an error as we cannot do this without a client endpoint
+            // CoordinatorCompletionCoordinatorClient.getClient().sendCompensated(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendCompensated_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a fault message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     * @param exceptionIdentifier The exception identifier.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFault_1 [com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFault_1] - Unexpected exception while sending Fail
+     */
+    private void sendFault(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext, final String exceptionIdentifier)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - have to just log an error as we cannot do this without a client endpoint
+            // CoordinatorCompletionCoordinatorClient.getClient().sendFault(responseAddressingProperties, arjunaContext.getInstanceIdentifier(), exceptionIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorCompletionCoordinatorProcessorImpl.sendFault_1", th) ;
+            }
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/CoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,319 @@
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.CoordinatorInboundEvents;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Coordinator processor.
+ * @author kevin
+ */
+public class CoordinatorProcessorImpl extends CoordinatorProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public void activateCoordinator(final CoordinatorInboundEvents coordinator, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(coordinator, identifier) ;
+    }
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public void deactivateCoordinator(final CoordinatorInboundEvents coordinator)
+    {
+        activatedObjectProcessor.deactivateObject(coordinator) ;
+    }
+
+    /**
+     * Get the coordinator with the specified identifier.
+     * @param instanceIdentifier The coordinator identifier.
+     * @return The coordinator or null if not known.
+     */
+    private CoordinatorInboundEvents getCoordinator(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (CoordinatorInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Aborted.
+     * @param aborted The aborted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_1] - Unexpected exception thrown from aborted:
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_2] - Aborted called on unknown coordinator: {0}
+     */
+    public void aborted(final Notification aborted, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.aborted(aborted, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+        {
+            WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.aborted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Committed.
+     * @param committed The committed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_1] - Unexpected exception thrown from committed:
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_2] - Committed called on unknown coordinator: {0}
+     */
+    public void committed(final Notification committed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.committed(committed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+        {
+            WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.committed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Prepared.
+     * @param prepared The prepared notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_1] - Unexpected exception thrown from prepared:
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_2] - Prepared called on unknown coordinator: {0}
+     */
+    public void prepared(final Notification prepared, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.prepared(prepared, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.prepared_2", new Object[] {instanceIdentifier}) ;
+            }
+
+            final String identifierValue = instanceIdentifier.getInstanceIdentifier() ;
+            if ((identifierValue != null) && (identifierValue.length() > 0) && (identifierValue.charAt(0) == 'D'))
+            {
+        	    sendRollback(addressingProperties, arjunaContext) ;
+            }
+            else
+            {
+                sendInvalidState(addressingProperties, arjunaContext) ;
+            }
+        }
+    }
+
+    /**
+     * Read only.
+     * @param readOnly The read only notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_1] - Unexpected exception thrown from readOnly:
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_2] - ReadOnly called on unknown coordinator: {0}
+     */
+    public void readOnly(final Notification readOnly, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.readOnly(readOnly, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+        {
+            WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.readOnly_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * SOAP Fault.
+     * @param fault The SOAP fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_2] - SoapFault called on unknown coordinator: {0}
+     */
+    public void soapFault(final SoapFault fault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final CoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.soapFault(fault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+            }
+        }
+    }
+
+    /**
+     * Send an unknown transaction fault.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_1] - Unknown Transaction.
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_2 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_2] - Unexpecting exception while sending InvalidState
+     */
+    private void sendInvalidState(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String responseMessageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(responseMessageId) ;
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+
+        /*
+         * TODO - fix this. cannot send invalid state fault as we have no participant end point!
+
+        final AttributedURI requestMessageId = addressingProperties.getMessageID() ;
+        if (requestMessageId != null)
+        {
+            AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+            Relationship relatesToValue = builder.newRelationship(requestMessageId.getURI());
+            Relationship[] relatesToSet = { relatesToValue };
+            responseAddressingContext.setRelatesTo(relatesToSet);
+        }
+
+        try {
+            final String message = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_1") ;
+            final SoapFault soapFault = new SoapFault(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
+            ParticipantClient.getClient().sendSoapFault(responseAddressingContext, soapFault, instanceIdentifier) ;
+        } catch (final Throwable th) {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendInvalidState_2", th) ;
+            }
+        }
+        */
+    }
+
+    /**
+     * Send a rollback message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendRollback_1 [com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendRollback_1] - Unexpected exception while sending Rollback
+     */
+    private void sendRollback(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingContext = AddressingHelper.createNotificationContext(messageId) ;
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        /*
+         * TODO - fix this. cannot send rollback as we have no participant end point!
+
+        try
+        {
+            ParticipantClient.getClient().sendRollback(responseAddressingContext, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.CoordinatorProcessorImpl.sendRollback_1", th) ;
+            }
+        }
+        */
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,485 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant Completion Coordinator processor.
+ * @author kevin
+ */
+public class ParticipantCompletionCoordinatorProcessorImpl extends ParticipantCompletionCoordinatorProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the coordinator.
+     * @param coordinator The coordinator.
+     * @param identifier The identifier.
+     */
+    public void activateCoordinator(final ParticipantCompletionCoordinatorInboundEvents coordinator, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(coordinator, identifier) ;
+    }
+
+    /**
+     * Deactivate the coordinator.
+     * @param coordinator The coordinator.
+     */
+    public void deactivateCoordinator(final ParticipantCompletionCoordinatorInboundEvents coordinator)
+    {
+        activatedObjectProcessor.deactivateObject(coordinator) ;
+    }
+
+    /**
+     * Get the coordinator with the specified identifier.
+     * @param instanceIdentifier The coordinator identifier.
+     * @return The coordinator or null if not known.
+     */
+    private ParticipantCompletionCoordinatorInboundEvents getCoordinator(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (ParticipantCompletionCoordinatorInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Cancelled.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_1] - Unexpected exception thrown from cancelled:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_2] - Cancelled called on unknown coordinator: {0}
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.cancelled(cancelled, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cancelled_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Closed.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_1] - Unexpected exception thrown from closed:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_2] - Closed called on unknown coordinator: {0}
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.closed(closed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.closed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Compensated.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_1] - Unexpected exception thrown from compensated:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_2] - Compensated called on unknown coordinator: {0}
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.compensated(compensated, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.compensated_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Completed.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_1] - Unexpected exception thrown from completed:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_2] - Completed called on unknown coordinator: {0}
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.completed(completed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Completed.
+     * @param cannotComplete The cannot complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cannotComplete_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cannotComplete_1] - Unexpected exception thrown from cannot complete:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cannotComplete_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.cannotComplete_2] - Cannot complete called on unknown coordinator: {0}
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.cannotComplete(cannotComplete, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.completed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Exit.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_1] - Unexpected exception thrown from exit:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_2] - Exit called on unknown coordinator: {0}
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.exit(exit, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.exit_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendExited(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Fault.
+     * @param fail The fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_1] - Unexpected exception thrown from fault:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_2] - Fault called on unknown coordinator: {0}
+     */
+    public void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.fail(fail, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.fault_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendFailed(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_1] - Unexpected exception thrown from getStatus:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_2] - GetStatus called on unknown coordinator: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.getStatus(getStatus, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.getStatus_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Status.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_1] - Unexpected exception thrown from status:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_2] - Status called on unknown coordinator: {0}
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.status(status, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.status_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * SOAP fault.
+     * @param soapFault The SOAP fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_2] - SoapFault called on unknown coordinator: {0}
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier) ;
+
+        if (coordinator != null)
+        {
+            try
+            {
+                coordinator.soapFault(soapFault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Send an exited message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendExited_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendExited_1] - Unexpected exception while sending Exited
+     */
+    private void sendExited(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // cannot do this without a coordinator endpoint and that is the only way it gets called
+            // ParticipantCompletionParticipantClient.getClient().sendExited(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendExited_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a faulted message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendFaulted_1 [com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendFaulted_1] - Unexpected exception while sending Faulted
+     */
+    private void sendFailed(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(  messageId) ;
+        try
+        {
+            // cannot do this without a coordinator endpoint and that is the only way it gets called
+            // ParticipantCompletionParticipantClient.getClient().sendFaulted(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionCoordinatorProcessorImpl.sendFailed_1", th) ;
+            }
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionParticipantProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionParticipantProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantCompletionParticipantProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,478 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+
+/**
+ * The Participant Completion Participant processor.
+ * @author kevin
+ */
+public class ParticipantCompletionParticipantProcessorImpl extends ParticipantCompletionParticipantProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public void activateParticipant(final ParticipantCompletionParticipantInboundEvents participant, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(participant, identifier) ;
+    }
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public void deactivateParticipant(final ParticipantCompletionParticipantInboundEvents participant)
+    {
+        activatedObjectProcessor.deactivateObject(participant) ;
+    }
+
+    /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    private ParticipantCompletionParticipantInboundEvents getParticipant(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (ParticipantCompletionParticipantInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_1] - Unexpected exception thrown from cancel:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_2] - Cancel called on unknown participant: {0}
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.cancel(cancel, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.cancel_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendCancelled(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_1] - Unexpected exception thrown from close:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_2] - Close called on unknown participant: {0}
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.close(close, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.close_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendClosed(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Compensate.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_1] - Unexpected exception thrown from compensate:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_2] - Compensate called on unknown participant: {0}
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.compensate(compensate, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.compensate_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendCompensated(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Exited.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_1] - Unexpected exception thrown from exited:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_2] - Exited called on unknown participant: {0}
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.exited(exited, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.exited_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Not Completed.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_1] - Unexpected exception thrown from notCompleted:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_2] - Exited called on unknown participant: {0}
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.notCompleted(notCompleted, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.notCompleted_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Failed.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_1] - Unexpected exception thrown from failed:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_2] - Failed called on unknown participant: {0}
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.failed(failed, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.failed_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Get Status.
+     * @param getStatus The get status notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_1] - Unexpected exception thrown from getStatus:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_2] - Complete called on unknown participant: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.getStatus(getStatus, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.getStatus_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Status.
+     * @param status The status type.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_1] - Unexpected exception thrown from status:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_2] - Status called on unknown participant: {0}
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.status(status, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.status_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * SOAP Fault.
+     * @param fault The SOAP fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_2] - SoapFault called on unknown participant: {0}
+     */
+    public void soapFault(final SoapFault fault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantCompletionParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.soapFault(fault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+        }
+    }
+
+    /**
+     * Send a cancelled message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCancelled_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCancelled_1] - Unexpected exception while sending Cancelled
+     */
+    private void sendCancelled(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - cannot do this without a coordinator endpoint and this only gets called when we don't have one
+            // ParticipantCompletionCoordinatorClient.getClient().sendCancelled(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCancelled_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a closed message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendClosed_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendClosed_1] - Unexpected exception while sending Closed
+     */
+    private void sendClosed(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - cannot do this without a coordinator endpoint and this only gets called when we don't have one
+            // ParticipantCompletionCoordinatorClient.getClient().sendClosed(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendClosed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send a compensated message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCompensated_1 [com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCompensated_1] - Unexpected exception while sending Compensated
+     */
+    private void sendCompensated(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+        try
+        {
+            // TODO - cannot do this without a coordinator endpoint and this only gets called when we don't have one
+            // ParticipantCompletionCoordinatorClient.getClient().sendCompensated(responseAddressingProperties, arjunaContext.getInstanceIdentifier()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantCompletionParticipantProcessorImpl.sendCompensated_1", th) ;
+            }
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/ParticipantProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,271 @@
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices11.wsat.ParticipantInboundEvents;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+
+/**
+ * The Participant processor.
+ * @author kevin
+ */
+public class ParticipantProcessorImpl extends ParticipantProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public void activateParticipant(final ParticipantInboundEvents participant, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(participant, identifier) ;
+    }
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public void deactivateParticipant(final ParticipantInboundEvents participant)
+    {
+        activatedObjectProcessor.deactivateObject(participant) ;
+    }
+
+    /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    private ParticipantInboundEvents getParticipant(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (ParticipantInboundEvents)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Commit.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_1] - Unexpected exception thrown from commit:
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_2 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_2] - Commit called on unknown participant: {0}
+     */
+    public void commit(final Notification commit, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.commit(commit, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.commit_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendCommitted(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Prepare.
+     * @param prepare The prepare notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_1] - Unexpected exception thrown from prepare:
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_2 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_2] - Prepare called on unknown participant: {0}
+     */
+    public void prepare(final Notification prepare, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.prepare(prepare, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.prepare_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendAborted(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * Rollback.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_1] - Unexpected exception thrown from rollback:
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_2 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_2] - Rollback called on unknown participant: {0}
+     */
+    public void rollback(final Notification rollback, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.rollback(rollback, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.rollback_2", new Object[] {instanceIdentifier}) ;
+            }
+            sendAborted(addressingProperties, arjunaContext) ;
+        }
+    }
+
+    /**
+     * SOAP Fault.
+     * @param fault The SOAP fault notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_1] - Unexpected exception thrown from soapFault:
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_2 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_2] - SoapFault called on unknown participant: {0}
+     */
+    public void soapFault(final SoapFault fault, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final ParticipantInboundEvents participant = getParticipant(instanceIdentifier) ;
+
+        if (participant != null)
+        {
+            try
+            {
+                participant.soapFault(fault, addressingProperties, arjunaContext) ;
+            }
+            catch (final Throwable th)
+            {
+                if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_1", th) ;
+                }
+            }
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isWarnEnabled())
+            {
+                WSTLogger.arjLoggerI18N.warn("com.arjuna.wst11.messaging.ParticipantProcessorImpl.soapFault_2", new Object[] {instanceIdentifier}) ;
+            }
+        }
+    }
+
+    /**
+     * Send a committed message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendCommitted_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendCommitted_1] - Unexpected exception while sending Committed
+     */
+    private void sendCommitted(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        /*
+         * TODO - fix this. participant is null and we cannto send a message without an endpoint
+        try
+        {
+            CoordinatorClient.getClient().sendCommitted(responseAddressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendCommitted_1", th) ;
+            }
+        }
+        */
+    }
+
+    /**
+     * Send an aborted message.
+     *
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendAborted_1 [com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendAborted_1] - Unexpected exception while sending Aborted
+     */
+    private void sendAborted(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV add check for recovery
+        final String messageId = MessageId.getMessageId() ;
+        final AddressingProperties responseAddressingProperties = AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        /*
+         * TODO - fix this. participant is null and we cannto send a message without an endpoint
+        try
+        {
+            CoordinatorClient.getClient().sendAborted(responseAddressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.ParticipantProcessorImpl.sendAborted_1", th) ;
+            }
+        }
+        */
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/TerminationCoordinatorProcessorImpl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/TerminationCoordinatorProcessorImpl.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/TerminationCoordinatorProcessorImpl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,345 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.base.processors.ActivatedObjectProcessor;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsarjtx.client.TerminationParticipantClient;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst11.BusinessActivityTerminator;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.text.MessageFormat;
+
+/**
+ * The Terminator Participant processor.
+ * @author kevin
+ *
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_1 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_1] - Unknown transaction
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_2 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_2] - Unknown error: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_3 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_3] - Unexpected exception thrown from cancel:
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_4 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_4] - Cancel called on unknown participant: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_5 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_5] - Unknown participant
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_6 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_6] - Unknown transaction
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_7 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_7] - Transaction rolled back
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_8 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_8] - Unknown error: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_9 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_9] - Unexpected exception thrown from close:
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_10 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_10] - Close called on unknown participant: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_11 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_11] - Unknown participant
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_12 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_12] - Unknown transaction
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_13 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_13] - Unknown error: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_14 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_14] - Unexpected exception thrown from complete:
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_15 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_15] - Complete called on unknown participant: {0}
+ * @message com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_16 [com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_16] - Unknown participant
+ */
+public class TerminationCoordinatorProcessorImpl extends TerminationCoordinatorProcessor
+{
+    /**
+     * The activated object processor.
+     */
+    private final ActivatedObjectProcessor activatedObjectProcessor = new ActivatedObjectProcessor() ;
+
+    /**
+     * Activate the participant.
+     * @param participant The participant.
+     * @param identifier The identifier.
+     */
+    public void activateParticipant(final BusinessActivityTerminator participant, final String identifier)
+    {
+        activatedObjectProcessor.activateObject(participant, identifier) ;
+    }
+
+    /**
+     * Deactivate the participant.
+     * @param participant The participant.
+     */
+    public void deactivateParticipant(final BusinessActivityTerminator participant)
+    {
+        activatedObjectProcessor.deactivateObject(participant) ;
+    }
+
+   /**
+     * Get the participant with the specified identifier.
+     * @param instanceIdentifier The participant identifier.
+     * @return The participant or null if not known.
+     */
+    public BusinessActivityTerminator getParticipant(final InstanceIdentifier instanceIdentifier)
+    {
+        final String identifier = (instanceIdentifier != null ? instanceIdentifier.getInstanceIdentifier() : null) ;
+        return (com.arjuna.wst11.BusinessActivityTerminator)activatedObjectProcessor.getObject(identifier) ;
+    }
+
+    /**
+     * Cancel.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final BusinessActivityTerminator participant = getParticipant(instanceIdentifier) ;
+
+        try
+        {
+            if (participant != null)
+            {
+                W3CEndpointReference endpoint = participant.getEndpoint();
+
+                final String messageId = MessageId.getMessageId() ;
+                try
+                {
+                    participant.cancel() ;
+                }
+                catch (final FaultedException fe)
+                {
+                    final AddressingProperties responseAddressingProperties =
+                        AddressingHelper.createNotificationContext(messageId) ;
+                    TerminationParticipantClient.getClient().sendFaulted(endpoint, responseAddressingProperties, instanceIdentifier) ;
+                }
+                catch (final UnknownTransactionException ute)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_1")) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final SystemException se)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_2") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {se}) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final Throwable th)
+                {
+                    if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_3", th) ;
+                    }
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                    final SoapFault soapFault = new SoapFault11(th) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                final AddressingProperties responseAddressingProperties =
+                    AddressingHelper.createNotificationContext(messageId) ;
+                TerminationParticipantClient.getClient().sendCancelled(endpoint, responseAddressingProperties, instanceIdentifier) ;
+            }
+            else
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_4", new Object[] {instanceIdentifier}) ;
+                }
+                // cannot do this without an endpoint
+                //final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                // final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTX11Constants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                //     WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_5")) ;
+                // TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+        }
+    }
+
+    /**
+     * Close.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final BusinessActivityTerminator participant = getParticipant(instanceIdentifier) ;
+
+        try
+        {
+            if (participant != null)
+            {
+                W3CEndpointReference endpoint = participant.getEndpoint();
+
+                final String messageId = MessageId.getMessageId() ;
+                try
+                {
+                    participant.close() ;
+                }
+                catch (final UnknownTransactionException ute)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_6")) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final TransactionRolledBackException trbe)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_7")) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final SystemException se)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, messageId) ;
+                    final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_8") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {se}) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final Throwable th)
+                {
+                    if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_9", th) ;
+                    }
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createFaultContext(addressingProperties, MessageId.getMessageId()) ;
+                    final SoapFault soapFault = new SoapFault11(th) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                final AddressingProperties responseAddressingProperties =
+                    AddressingHelper.createResponseContext(addressingProperties, messageId) ;
+                TerminationParticipantClient.getClient().sendClosed(endpoint, responseAddressingProperties, instanceIdentifier) ;
+            }
+            else
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_10", new Object[] {instanceIdentifier}) ;
+                }
+                // cannot do this without an endpoint
+                // final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                // final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTX11Constants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                //     WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_11")) ;
+                // TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+        }
+    }
+
+    /**
+     * Complete.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void complete(final NotificationType complete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+        final BusinessActivityTerminator participant = getParticipant(instanceIdentifier) ;
+
+        try
+        {
+            if (participant != null)
+            {
+                W3CEndpointReference endpoint = participant.getEndpoint();
+
+                final String messageId = MessageId.getMessageId() ;
+                try
+                {
+                    participant.complete() ;
+                }
+                catch (final FaultedException fe)
+                {
+                    final AddressingProperties responseAddressingProperties =
+                        AddressingHelper.createNotificationContext(messageId) ;
+                    TerminationParticipantClient.getClient().sendFaulted(endpoint, responseAddressingProperties, instanceIdentifier) ;
+                }
+                catch (final UnknownTransactionException ute)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                        WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_12")) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final SystemException se)
+                {
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(messageId) ;
+                    final String pattern = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_13") ;
+                    final String message = MessageFormat.format(pattern, new Object[] {se}) ;
+                    final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                catch (final Throwable th)
+                {
+                    if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                    {
+                        WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_14", th) ;
+                    }
+                    final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                    final SoapFault soapFault = new SoapFault11(th) ;
+                    TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+                    return ;
+                }
+                final AddressingProperties responseAddressingProperties =
+                    AddressingHelper.createNotificationContext(messageId) ;
+                TerminationParticipantClient.getClient().sendCompleted(endpoint, responseAddressingProperties, instanceIdentifier) ;
+            }
+            else
+            {
+                if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+                {
+                    WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_15", new Object[] {instanceIdentifier}) ;
+                }
+                // cannot do this without an endpoint
+                // final AddressingProperties faultAddressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+                // final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTX11Constants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME,
+                //     WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.TerminationCoordinatorProcessorImpl_16")) ;
+                // TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultAddressingProperties, soapFault, instanceIdentifier) ;
+            }
+        }
+        catch (Throwable throwable)
+        {
+            throwable.printStackTrace(System.err);
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/deploy/TransactionInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/deploy/TransactionInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/deploy/TransactionInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,72 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging.deploy;
+
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.wst11.messaging.*;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Initialise the transaction services.
+ * @author kevin
+ */
+public class TransactionInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11) {
+           public void run() {
+               CompletionCoordinatorProcessor.setProcessor(new CompletionCoordinatorProcessorImpl()) ;
+               ParticipantProcessor.setProcessor(new ParticipantProcessorImpl()) ;
+               CoordinatorProcessor.setProcessor(new CoordinatorProcessorImpl()) ;
+               TerminationCoordinatorProcessor.setProcessor(new TerminationCoordinatorProcessorImpl()) ;
+               CoordinatorCompletionParticipantProcessor.setProcessor(new CoordinatorCompletionParticipantProcessorImpl()) ;
+               ParticipantCompletionParticipantProcessor.setProcessor(new ParticipantCompletionParticipantProcessorImpl()) ;
+               CoordinatorCompletionCoordinatorProcessor.setProcessor(new CoordinatorCompletionCoordinatorProcessorImpl()) ;
+               ParticipantCompletionCoordinatorProcessor.setProcessor(new ParticipantCompletionCoordinatorProcessorImpl()) ;
+           }
+        };
+        // this is the last WST callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WST11);
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionCoordinatorEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionCoordinatorEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionCoordinatorEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,980 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsba.client.CoordinatorCompletionParticipantClient;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst11.BAParticipantManager;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * The coordinator completion coordinator state engine
+ * @author kevin
+ */
+public class CoordinatorCompletionCoordinatorEngine implements CoordinatorCompletionCoordinatorInboundEvents
+{
+    /**
+     * The coordinator id.
+     */
+    private final String id ;
+    /**
+     * The instance identifier.
+     */
+    private final InstanceIdentifier instanceIdentifier ;
+    /**
+     * The participant endpoint reference.
+     */
+    private final W3CEndpointReference participant ;
+    /**
+     * The associated coordinator
+     */
+    private BAParticipantManager coordinator ;
+    /**
+     * The current state.
+     */
+    private State state;
+
+    /**
+     * Construct the initial engine for the coordinator.
+     * @param id The coordinator id.
+     * @param participant The participant endpoint reference.
+     */
+    public CoordinatorCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant)
+    {
+        this(id, participant, State.STATE_ACTIVE) ;
+    }
+
+    /**
+     * Construct the engine for the coordinator in a specified state.
+     * @param id The coordinator id.
+     * @param participant The participant endpoint reference.
+     * @param state The initial state.
+     */
+    public CoordinatorCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant,
+        final State state)
+    {
+        this.id = id ;
+        this.instanceIdentifier = new InstanceIdentifier(id) ;
+        this.participant = participant ;
+        this.state = state ;
+    }
+
+    /**
+     * Set the coordinator and register
+     * @param coordinator
+     */
+    public void setCoordinator(final BAParticipantManager coordinator)
+    {
+        this.coordinator = coordinator ;
+        CoordinatorCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ;
+    }
+
+    /**
+     * Handle the cancelled event.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Ended
+     * Canceling-Completing -> Ended
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_CANCELING) || (current == State.STATE_CANCELING_ACTIVE) ||
+                (current == State.STATE_CANCELING_COMPLETING))
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the closed event.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Ended
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_CLOSING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the compensated event.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Ended
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPENSATING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the completed event.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Ended
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_CANCELING_COMPLETING) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_COMPLETED) ;
+            }
+            else if (current == State.STATE_ACTIVE)
+            {
+        	ended() ;
+            }
+        }
+
+        if (current == State.STATE_CLOSING)
+        {
+            sendClose() ;
+        }
+        else if (current == State.STATE_COMPENSATING)
+        {
+            sendCompensate() ;
+        }
+        else if (current == State.STATE_ACTIVE)
+        {
+            // TODO - we cannot send a fault here
+            // sendInvalidStateFault() ;
+        }
+    }
+
+    /**
+     * Handle the exit event.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Exiting
+     * Canceling -> Exiting
+     * Canceling-Active -> Exiting
+     * Canceling-Completing -> Exiting
+     * Completing -> Exiting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Faulting -> Faulting (invalid state)
+     * Faulting-Active -> Faulting (invalid state)
+     * Faulting-Compensating -> Faulting (invalid state)
+     * Exiting -> Exiting
+     * Ended -> Ended (resend Exited)
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING_ACTIVE) ||
+        	(current == State.STATE_CANCELING_COMPLETING) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_EXITING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING_ACTIVE) ||
+            (current == State.STATE_CANCELING_COMPLETING) || (current == State.STATE_COMPLETING))
+        {
+            executeExit() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendExited() ;
+        }
+    }
+
+    /**
+     * Handle the fail event.
+     * @param fail The fail exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Failing-Active
+     * Canceling-Active -> Failing-Canceling
+     * Canceling-Completing -> Failing-Canceling
+     * Completing -> Failing-Completing
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Failing-Compensating
+     * Failing-Active -> Failing-Active
+     * Failing-Canceling -> Failing-Canceling
+     * Failing-Completing -> Failing-Completing
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (resend Failed)
+     */
+    public void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_FAILING_ACTIVE) ;
+            }
+            else if ((current == State.STATE_CANCELING_ACTIVE) || (current == State.STATE_CANCELING_COMPLETING))
+            {
+                changeState(State.STATE_FAILING_CANCELING) ;
+            }
+            else if (current == State.STATE_COMPLETING)
+            {
+                changeState(State.STATE_FAILING_COMPLETING) ;
+            }
+            else if (current == State.STATE_COMPENSATING)
+            {
+                changeState(State.STATE_FAILING_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executeFail(fail.getExceptionIdentifier()) ;
+        }
+        else if ((current == State.STATE_CANCELING_ACTIVE) || (current == State.STATE_CANCELING_COMPLETING) ||
+        	 (current == State.STATE_COMPLETING) || (current == State.STATE_COMPENSATING))
+        {
+            sendFailed() ;
+            ended() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendFailed() ;
+        }
+    }
+
+    /**
+     * Handle the cannot complete event.
+     * @param cannotComplete The cannotComplete exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> NotComleting
+     * Canceling-Active -> NotCompleting
+     * Canceling-Completing -> NotCompleting
+     * Completing -> NotCompleting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (resend NotCompleted)
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING_ACTIVE) ||
+        	(current == State.STATE_CANCELING_COMPLETING) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_NOT_COMPLETING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING_ACTIVE) ||
+            (current == State.STATE_CANCELING_COMPLETING) || (current == State.STATE_COMPLETING))
+        {
+            executeCannotComplete() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendNotCompleted() ;
+        }
+    }
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+        }
+        sendStatus(current) ;
+    }
+
+    /**
+     * Handle the status event.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV - implement
+    }
+
+    /**
+     * Handle the get status event.
+     * @return The state.
+     */
+    public synchronized State getStatus()
+    {
+        return state ;
+    }
+
+    /**
+     * Handle the cancel event.
+     * @return The state.
+     *
+     * Active -> Canceling-Active
+     * Canceling-Active -> Canceling-Active
+     * Canceling-Completing -> Canceling-Completing
+     * Completing -> Canceling-Completing
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State cancel()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_CANCELING_ACTIVE) ;
+            }
+            else if (current == State.STATE_COMPLETING)
+            {
+                changeState(State.STATE_CANCELING_COMPLETING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            sendCancel() ;
+            return waitForState(State.STATE_CANCELING_ACTIVE, TransportTimer.getTransportTimeout()) ;
+        }
+        else if (current == State.STATE_COMPLETING)
+        {
+            sendCancel() ;
+            return waitForState(State.STATE_CANCELING_COMPLETING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the compensate event.
+     * @return The state.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Compensating
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State compensate()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            sendCompensate() ;
+            return waitForState(State.STATE_COMPENSATING, TransportTimer.getTransportTimeout()) ;
+        }
+
+        return current ;
+    }
+
+    /**
+     * Handle the complete event.
+     * @return The state.
+     *
+     * Active -> Completing
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State complete()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_COMPLETING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            sendComplete() ;
+            return waitForState(State.STATE_COMPLETING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the close event.
+     * @return The state.
+     *
+     * Active -> Active (invalid state)
+     * Canceling-Active -> Canceling-Active (invalid state)
+     * Canceling-Completing -> Canceling-Completing (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Closing
+     * Closing -> Closing
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State close()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_CLOSING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            sendClose() ;
+            return waitForState(State.STATE_CLOSING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        ended() ;
+        try
+        {
+            coordinator.fail(soapFault.getSubcode()) ;
+        }
+        catch (final Throwable th) {} // ignore
+    }
+
+    /**
+     * Send the close message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendClose_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendClose_1] - Unexpected exception while sending Close
+     */
+    private void sendClose()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendClose(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendClose_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the compensate message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCompensate_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCompensate_1] - Unexpected exception while sending Compensate
+     */
+    private void sendCompensate()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendCompensate(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCompensate_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the complete message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendComplete_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendComplete_1] - Unexpected exception while sending Complete
+     */
+    private void sendComplete()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendComplete(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendComplete_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cancel message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCancel_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCancel_1] - Unexpected exception while sending Cancel
+     */
+    private void sendCancel()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendCancel(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendCancel_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the exited message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendExited_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendExited_1] - Unexpected exception while sending Exited
+     */
+    private void sendExited()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendExited(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendExited_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the failed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendFailed_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendFailed_1] - Unexpected exception while sending Faulted
+     */
+    private void sendFailed()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendFailed(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendFailed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the not completed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendNotCompleted_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendNotCompleted_1] - Unexpected exception while sending NotCompleted
+     */
+    private void sendNotCompleted()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendNotCompleted(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendNotCompleted_1", th) ;
+            }
+        }
+    }
+    /**
+     * Send the status message.
+     * @param state The state.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendStatus_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendStatus_1] - Unexpected exception while sending Status
+     */
+    private void sendStatus(final State state)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionParticipantClient.getClient().sendStatus(participant, addressingProperties, instanceIdentifier, state.getValue()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.sendStatus_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Get the coordinator id.
+     * @return The coordinator id.
+     */
+    public String getId()
+    {
+        return id ;
+    }
+
+    /**
+     * Get the participant endpoint reference
+     * @return The participant endpoint reference
+     */
+    public W3CEndpointReference getParticipant()
+    {
+        return participant ;
+    }
+
+    /**
+     * Get the associated coordinator.
+     * @return The associated coordinator.
+     */
+    public BAParticipantManager getCoordinator()
+    {
+        return coordinator ;
+    }
+
+    /**
+     * Change the state and notify any listeners.
+     * @param state The new state.
+     */
+    private synchronized void changeState(final State state)
+    {
+        if (this.state != state)
+        {
+            this.state = state ;
+            notifyAll() ;
+        }
+    }
+
+    /**
+     * Wait for the state to change from the specified state.
+     * @param origState The original state.
+     * @param delay The maximum time to wait for (in milliseconds).
+     * @return The current state.
+     */
+    private State waitForState(final State origState, final long delay)
+    {
+        final long end = System.currentTimeMillis() + delay ;
+        synchronized(this)
+        {
+            while(state == origState)
+            {
+                final long remaining = end - System.currentTimeMillis() ;
+                if (remaining <= 0)
+                {
+                    break ;
+                }
+                try
+                {
+                    wait(remaining) ;
+                }
+                catch (final InterruptedException ie) {} // ignore
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Execute the completed transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCompleted_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCompleted_1] - Unexpected exception from coordinator completed
+     */
+    private void executeCompleted()
+    {
+        try
+        {
+            coordinator.completed() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCompleted_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Execute the exit transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeExit_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeExit_1] - Unexpected exception from coordinator exit
+     */
+    private void executeExit()
+    {
+        try
+        {
+            coordinator.exit() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeExit_1", th) ;
+            }
+            return ;
+        }
+        sendExited() ;
+        ended() ;
+    }
+
+    /**
+     * Executing the fail transition.
+     *
+     * @throws com.arjuna.webservices.SoapFault for SOAP errors.
+     * @throws java.io.IOException for transport errors.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeFail_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeFail_1] - Unexpected exception from coordinator fail
+     */
+    private void executeFail(final QName exceptionIdentifier)
+    {
+        try
+        {
+            coordinator.fail(exceptionIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeFail_1", th) ;
+            }
+            return ;
+        }
+        sendFailed() ;
+        ended() ;
+    }
+
+    /**
+     * Executing the cannot complete transition.
+     *
+     * @throws com.arjuna.webservices.SoapFault for SOAP errors.
+     * @throws java.io.IOException for transport errors.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCannotComplete_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCannotComplete_1] - Unexpected exception from coordinator cannotComplete
+     */
+    private void executeCannotComplete()
+    {
+        try
+        {
+            coordinator.cannotComplete() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine.executeCannotComplete_1", th) ;
+            }
+            return ;
+        }
+        sendNotCompleted() ;
+        ended() ;
+    }
+
+    /**
+     * End the current coordinator.
+     */
+    private void ended()
+    {
+        changeState(State.STATE_ENDED) ;
+        CoordinatorCompletionCoordinatorProcessor.getProcessor().deactivateCoordinator(this) ;
+    }
+
+    /**
+     * Create a context for the outgoing message.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionParticipantEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionParticipantEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorCompletionParticipantEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,1074 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.CoordinatorCompletionCoordinatorClient;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.TimerTask;
+
+/**
+ * The coordinator completion participant state engine
+ * @author kevin
+ */
+public class CoordinatorCompletionParticipantEngine implements CoordinatorCompletionParticipantInboundEvents
+{
+    /**
+     * The participant id.
+     */
+    private final String id ;
+    /**
+     * The instance identifier.
+     */
+    private final InstanceIdentifier instanceIdentifier ;
+    /**
+     * The coordinator endpoint reference.
+     */
+    private final W3CEndpointReference coordinator ;
+    /**
+     * The associated participant
+     */
+    private final BusinessAgreementWithCoordinatorCompletionParticipant participant ;
+    /**
+     * The current state.
+     */
+    private State state ;
+    /**
+     * The associated timer task or null.
+     */
+    private TimerTask timerTask ;
+
+    /**
+     * Construct the initial engine for the participant.
+     * @param id The participant id.
+     * @param coordinator The coordinator endpoint reference.
+     * @param participant The participant.
+     */
+    public CoordinatorCompletionParticipantEngine(final String id, final W3CEndpointReference coordinator,
+        final BusinessAgreementWithCoordinatorCompletionParticipant participant)
+    {
+        this(id, coordinator, participant, State.STATE_ACTIVE) ;
+    }
+
+    /**
+     * Construct the engine for the participant in a specified state.
+     * @param id The participant id.
+     * @param coordinator The coordinator endpoint reference.
+     * @param participant The participant.
+     * @param state The initial state.
+     */
+    public CoordinatorCompletionParticipantEngine(final String id, final W3CEndpointReference coordinator,
+        final BusinessAgreementWithCoordinatorCompletionParticipant participant, final State state)
+    {
+        this.id = id ;
+        this.instanceIdentifier = new InstanceIdentifier(id) ;
+        this.coordinator = coordinator ;
+        this.participant = participant ;
+        this.state = state ;
+    }
+
+    /**
+     * Handle the cancel event.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Canceling
+     * Canceling -> Canceling
+     * Completing -> Canceling
+     * Completed -> Completed (resend Completed)
+     * Closing -> Closing
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (resend Fail)
+     * Failing-Canceling -> Failing-Canceling (resend Fail)
+     * Failing-Completing -> Failing-Completing (resend Fail)
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (resend CannotComplete)
+     * Exiting -> Exiting (resend Exit)
+     * Ended -> Ended (send Canceled)
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_CANCELING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING))
+        {
+            executeCancel() ;
+        }
+        else if (current == State.STATE_COMPLETED)
+        {
+            sendCompleted() ;
+        }
+        else if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING) ||
+        	 (current == State.STATE_FAILING_COMPLETING))
+        {
+            sendFail(current.getValue()) ;
+        }
+        else if (current == State.STATE_NOT_COMPLETING)
+        {
+            sendCannotComplete() ;
+        }
+        else if (current == State.STATE_EXITING)
+        {
+            sendExit() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendCancelled() ;
+        }
+    }
+
+    /**
+     * Handle the close event.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Closing
+     * Closing -> Closing
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (send Closed)
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_CLOSING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            if (timerTask != null)
+            {
+                timerTask.cancel() ;
+            }
+            executeClose() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendClosed() ;
+        }
+    }
+
+    /**
+     * Handle the compensate event.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Compensating
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (resend Fail)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (send Compensated)
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            if (timerTask != null)
+            {
+                timerTask.cancel() ;
+            }
+            executeCompensate() ;
+        }
+        else if (current == State.STATE_FAILING_COMPENSATING)
+        {
+            sendFail(current.getValue()) ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendCompensated() ;
+        }
+    }
+
+    /**
+     * Handle the complete event.
+     * @param complete The complete notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Completing
+     * Canceling -> Canceling
+     * Completing -> Completing
+     * Completed -> Completed (resend Completed)
+     * Closing -> Closing
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (resend Fail)
+     * Failing-Canceling -> Failing-Canceling (resend Fail)
+     * Failing-Completing -> Failing-Completing (resend Fail)
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (resend CannotComplete)
+     * Exiting -> Exiting (resend Exit)
+     * Ended -> Ended (send Fail)
+     */
+    public void complete(final NotificationType complete, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_COMPLETING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executeComplete() ;
+        }
+        else if (current == State.STATE_COMPLETED)
+        {
+            sendCompleted() ;
+        }
+        else if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING) ||
+        	 (current == State.STATE_FAILING_COMPLETING) || (current == State.STATE_ENDED))
+        {
+            sendFail(current.getValue()) ;
+        }
+        else if (current == State.STATE_NOT_COMPLETING)
+        {
+            sendCannotComplete() ;
+        }
+        else if (current == State.STATE_EXITING)
+        {
+            sendExit() ;
+        }
+    }
+
+    /**
+     * Handle the exited event.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Ended
+     * Ended -> Ended
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_EXITING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the failed event.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Ended
+     * Failing-Canceling -> Ended
+     * Failing-Completing -> Ended
+     * Failing-Compensating -> Ended
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void failed(final NotificationType failed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING) ||
+                (current == State.STATE_FAILING_COMPLETING) || (current == State.STATE_FAILING_COMPENSATING))
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the not completed event.
+     * @param notCompleted The not completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completing (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> Ended
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_NOT_COMPLETING)
+            {
+        	ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.getStatus_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.getStatus_1] - Unknown error: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	final State current ;
+	synchronized(this)
+	{
+	    current = state ;
+	}
+	sendStatus(current) ;
+    }
+
+    /**
+     * Handle the status event.
+     * @param status The status type.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV - implement
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	ended() ;
+	try
+	{
+	    participant.error() ;
+	}
+	catch (final Throwable th) {} // ignore
+    }
+
+    /**
+     * Handle the completed event.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Completed
+     * Completed -> Completed
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State completed()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETING)
+            {
+                changeState(State.STATE_COMPLETED) ;
+            }
+        }
+
+        if ((current == State.STATE_COMPLETING) || (current == State.STATE_COMPLETED))
+        {
+            sendCompleted() ;
+        }
+
+        return current ;
+    }
+
+    /**
+     * Handle the exit event.
+     *
+     * Active -> Exiting
+     * Canceling -> Canceling (invalid state)
+     * Completing -> Exiting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * Exiting -> Exiting
+     * NotCompleting -> NotCompleting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State exit()
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_EXITING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING) ||
+            (current == State.STATE_EXITING))
+        {
+            sendExit() ;
+            return waitForState(State.STATE_EXITING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the fail event.
+     *
+     * Active -> Failing-Active
+     * Canceling -> Failing-Canceling
+     * Completing -> Failing-Completing
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Failing-Compensating
+     * Failing-Active -> Failing-Active
+     * Failing-Canceling -> Failing-Canceling
+     * Failing-Completing -> Failing-Completing
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State fail(final QName exceptionIdentifier)
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_FAILING_ACTIVE) ;
+            }
+            else if (current == State.STATE_CANCELING)
+            {
+        	changeState(State.STATE_FAILING_CANCELING) ;
+            }
+            else if (current == State.STATE_COMPLETING)
+            {
+        	changeState(State.STATE_FAILING_COMPLETING) ;
+            }
+            else if (current == State.STATE_COMPENSATING)
+            {
+                changeState(State.STATE_FAILING_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_ACTIVE, TransportTimer.getTransportTimeout()) ;
+        }
+        else if (current == State.STATE_CANCELING)
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_CANCELING, TransportTimer.getTransportTimeout()) ;
+        }
+        else if (current == State.STATE_COMPLETING)
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_COMPLETING, TransportTimer.getTransportTimeout()) ;
+        }
+        else if (current == State.STATE_COMPENSATING)
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_COMPENSATING, TransportTimer.getTransportTimeout()) ;
+        }
+
+        return current ;
+    }
+
+    /**
+     * Handle the cannot complete event.
+     *
+     * Active -> NotCompleting
+     * Canceling -> Canceling (invalid state)
+     * Completing -> NotCompleting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Completing -> Failing-Completing (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State cannotComplete()
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING))
+            {
+                changeState(State.STATE_NOT_COMPLETING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETING) ||
+            (current == State.STATE_NOT_COMPLETING))
+        {
+            sendCannotComplete() ;
+            return waitForState(State.STATE_NOT_COMPLETING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the comms timeout event.
+     *
+     * Completed -> Completed (resend Completed)
+     */
+    private void commsTimeout()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            sendCompleted() ;
+        }
+    }
+
+    /**
+     * Send the exit message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendExit_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendExit_1] - Unexpected exception while sending Exit
+     */
+    private void sendExit()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendExit(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendExit_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the completed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompleted_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompleted_1] - Unexpected exception while sending Completed
+     */
+    private void sendCompleted()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendCompleted(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompleted_1", th) ;
+            }
+        }
+
+        initiateTimer() ;
+    }
+
+    /**
+     * Send the fail message.
+     * @param message The fail message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendFail_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendFail_1] - Unexpected exception while sending Fail
+     */
+    private void sendFail(final QName message)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendFail(coordinator, addressingProperties, instanceIdentifier, message) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendFail_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cancelled message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCancelled_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCancelled_1] - Unexpected exception while sending Cancelled
+     */
+    private void sendCancelled()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendCancelled(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCancelled_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the closed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendClosed_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendClosed_1] - Unexpected exception while sending Closed
+     */
+    private void sendClosed()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendClosed(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendClosed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the compensated message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompensated_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompensated_1] - Unexpected exception while sending Compensated
+     */
+    private void sendCompensated()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendCompensated(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCompensated_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the status message.
+     * @param state The state.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendStatus_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendStatus_1] - Unexpected exception while sending Status
+     */
+    private void sendStatus(final State state)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendStatus(coordinator, addressingProperties, instanceIdentifier, state.getValue()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendStatus_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cannot complete message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCannotComplete_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCannotComplete_1] - Unexpected exception while sending CannotComplete
+     */
+    private void sendCannotComplete()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            CoordinatorCompletionCoordinatorClient.getClient().sendCannotComplete(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.sendCannotComplete_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Get the coordinator id.
+     * @return The coordinator id.
+     */
+    public String getId()
+    {
+        return id ;
+    }
+
+    /**
+     * Get the coordinator endpoint reference
+     * @return The coordinator endpoint reference
+     */
+    public W3CEndpointReference getCoordinator()
+    {
+        return coordinator ;
+    }
+
+    /**
+     * Get the associated participant.
+     * @return The associated participant.
+     */
+    public BusinessAgreementWithCoordinatorCompletionParticipant getParticipant()
+    {
+        return participant ;
+    }
+
+    /**
+     * Change the state and notify any listeners.
+     * @param state The new state.
+     */
+    private synchronized void changeState(final State state)
+    {
+        if (this.state != state)
+        {
+            this.state = state ;
+            notifyAll() ;
+        }
+    }
+
+    /**
+     * Wait for the state to change from the specified state.
+     * @param origState The original state.
+     * @param delay The maximum time to wait for (in milliseconds).
+     * @return The current state.
+     */
+    private State waitForState(final State origState, final long delay)
+    {
+        final long end = System.currentTimeMillis() + delay ;
+        synchronized(this)
+        {
+            while(state == origState)
+            {
+                final long remaining = end - System.currentTimeMillis() ;
+                if (remaining <= 0)
+                {
+                    break ;
+                }
+                try
+                {
+                    wait(remaining) ;
+                }
+                catch (final InterruptedException ie) {} // ignore
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Execute the cancel transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCancel_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCancel_1] - Unexpected exception from participant cancel
+     */
+    private void executeCancel()
+    {
+        try
+        {
+            participant.cancel() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCancel_1", th) ;
+            }
+            return ;
+        }
+        sendCancelled() ;
+        ended() ;
+    }
+
+    /**
+     * Execute the close transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeClose_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeClose_1] - Unexpected exception from participant close
+     */
+    private void executeClose()
+    {
+        try
+        {
+            participant.close() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeClose_1", th) ;
+            }
+            return ;
+        }
+        sendClosed() ;
+        ended() ;
+    }
+
+    /**
+     * Execute the compensate transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCompensate_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCompensate_1] - Unexpected exception from participant compensate
+     */
+    private void executeCompensate()
+    {
+        try
+        {
+            participant.compensate() ;
+        }
+        catch (final FaultedException fe)
+        {
+            fail(ArjunaTXConstants.WSARJTX_ELEMENT_FAULTED_QNAME) ;
+        }
+        catch (final Throwable th)
+        {
+            final State current ;
+            synchronized (this)
+            {
+                current = state ;
+                if (current == State.STATE_COMPENSATING)
+                {
+                    changeState(State.STATE_COMPLETED) ;
+                }
+            }
+            if (current == State.STATE_COMPENSATING)
+            {
+                initiateTimer() ;
+            }
+
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeCompensate_1", th) ;
+            }
+            return ;
+        }
+
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPENSATING)
+            {
+                ended() ;
+            }
+        }
+        if (current == State.STATE_COMPENSATING)
+        {
+            sendCompensated() ;
+        }
+    }
+
+    /**
+     * Execute the complete transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeComplete_1 [com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeComplete_1] - Unexpected exception from participant compensate
+     */
+    private void executeComplete()
+    {
+        try
+        {
+            participant.complete() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine.executeComplete_1", th) ;
+            }
+            return ;
+        }
+
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETING)
+            {
+                changeState(State.STATE_COMPLETED) ;
+            }
+        }
+        if (current == State.STATE_COMPLETING)
+        {
+            sendCompleted() ;
+        }
+    }
+
+    /**
+     * End the current participant.
+     */
+    private void ended()
+    {
+	changeState(State.STATE_ENDED) ;
+        CoordinatorCompletionParticipantProcessor.getProcessor().deactivateParticipant(this) ;
+    }
+    
+    /**
+     * Initiate the timer.
+     */
+    private synchronized void initiateTimer()
+    {
+        if (timerTask != null)
+        {
+            timerTask.cancel() ;
+        }
+
+        if (state == State.STATE_COMPLETED)
+        {
+            timerTask = new TimerTask() {
+                public void run() {
+                    commsTimeout() ;
+                }
+            } ;
+            TransportTimer.getTimer().schedule(timerTask, TransportTimer.getTransportPeriod()) ;
+        }
+        else
+        {
+            timerTask = null ;
+        }
+    }
+
+    /**
+     * Create a context for the outgoing message.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/CoordinatorEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,599 @@
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.CoordinatorInboundEvents;
+import com.arjuna.webservices11.wsat.State;
+import com.arjuna.webservices11.wsat.client.ParticipantClient;
+import com.arjuna.webservices11.wsat.processors.CoordinatorProcessor;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.wsc11.messaging.MessageId;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingBuilder;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.addressing.AttributedURI;
+import javax.xml.ws.addressing.Relationship;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.TimerTask;
+
+/**
+ * The coordinator state engine
+ * @author kevin
+ */
+public class CoordinatorEngine implements CoordinatorInboundEvents
+{
+    /**
+     * Flag indicating this is a coordinator for a durable participant.
+     */
+    private final boolean durable ;
+    /**
+     * The coordinator id.
+     */
+    private final String id ;
+    /**
+     * The instance identifier.
+     */
+    private final InstanceIdentifier instanceIdentifier ;
+    /**
+     * The participant endpoint reference.
+     */
+    private final W3CEndpointReference participant ;
+    /**
+     * The current state.
+     */
+    private State state ;
+    /**
+     * The flag indicating a read only response.
+     */
+    private boolean readOnly ;
+    /**
+     * The associated timer task or null.
+     */
+    private TimerTask timerTask ;
+
+    /**
+     * Construct the initial engine for the coordinator.
+     * @param id The coordinator id.
+     * @param durable true if the participant is durable, false if volatile.
+     * @param participant The participant endpoint reference.
+     */
+    public CoordinatorEngine(final String id, final boolean durable, final W3CEndpointReference participant)
+    {
+        this(id, durable, participant, State.STATE_ACTIVE) ;
+    }
+
+    /**
+     * Construct the engine for the coordinator in a specified state.
+     * @param id The coordinator id.
+     * @param durable true if the participant is durable, false if volatile.
+     * @param participant The participant endpoint reference.
+     * @param state The initial state.
+     */
+    public CoordinatorEngine(final String id, final boolean durable, final W3CEndpointReference participant, final State state)
+    {
+        this.id = id ;
+        this.instanceIdentifier = new InstanceIdentifier(id) ;
+        this.durable = durable ;
+        this.participant = participant ;
+        this.state = state ;
+        CoordinatorProcessor.getProcessor().activateCoordinator(this, id) ;
+    }
+
+    /**
+     * Handle the aborted event.
+     * @param aborted The aborted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (ignore)
+     * Active -> Aborting (forget)
+     * Preparing -> Aborting (forget)
+     * PreparedSuccess -> PreparedSuccess (invalid state)
+     * Committing -> Committing (invalid state)
+     * Aborting -> Aborting (forget)
+     */
+    public synchronized void aborted(final Notification aborted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current = state ;
+        if (current == State.STATE_ACTIVE)
+        {
+            changeState(State.STATE_ABORTING) ;
+        }
+        else if ((current == State.STATE_PREPARING) || (current == State.STATE_ABORTING))
+        {
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the committed event.
+     * @param committed The committed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (ignore)
+     * Active -> Aborting (invalid state)
+     * Preparing -> Aborting (invalid state)
+     * PreparedSuccess -> PreparedSuccess (invalid state)
+     * Committing -> Committing (forget)
+     * Aborting -> Aborting (invalid state)
+     */
+    public synchronized void committed(final Notification committed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current = state ;
+        if (current == State.STATE_ACTIVE)
+        {
+            changeState(State.STATE_ABORTING) ;
+        }
+        else if ((current == State.STATE_PREPARING) || (current == State.STATE_COMMITTING))
+        {
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the prepared event.
+     * @param prepared The prepared notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> Durable: (send rollback), Volatile: Invalid state: none
+     * Active -> Aborting (invalid state)
+     * Preparing -> PreparedSuccess (Record Vote)
+     * PreparedSuccess -> PreparedSuccess (ignore)
+     * Committing -> Committing (resend Commit)
+     * Aborting -> Aborting (resend Rollback and forget)
+     */
+    public void prepared(final Notification prepared, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_ABORTING) ;
+            }
+            else if (current == State.STATE_PREPARING)
+            {
+                changeState(State.STATE_PREPARED_SUCCESS) ;
+            }
+        }
+        if (current == State.STATE_COMMITTING)
+        {
+            sendCommit() ;
+        }
+        else if ((current == State.STATE_ABORTING) || ((current == null) && !readOnly))
+        {
+            if (durable)
+            {
+                sendRollback() ;
+            }
+            else
+            {
+        	    sendInvalidState(addressingProperties, arjunaContext) ;
+            }
+            if (current != null)
+            {
+        	forget() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the readOnly event.
+     * @param readOnly The readOnly notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (ignore)
+     * Active -> Active (forget)
+     * Preparing -> Preparing (forget)
+     * PreparedSuccess -> PreparedSuccess (invalid state)
+     * Committing -> Committing (invalid state)
+     * Aborting -> Aborting (forget)
+     */
+    public synchronized void readOnly(final Notification readOnly, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current = state ;
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+            (current == State.STATE_ABORTING))
+        {
+            if (current != State.STATE_ABORTING)
+            {
+                this.readOnly = true ;
+            }
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.soapFault_1 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.soapFault_1] - Unexpected SOAP fault for coordinator {0}: {1} {2}
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+            final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
+            final QName subCode = soapFault.getSubcode() ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorEngine.soapFault_1", new Object[] {instanceIdentifier, soapFaultType, subCode}) ;
+        }
+    }
+
+    /**
+     * Handle the prepare event.
+     *
+     * None -> None (invalid state)
+     * Active -> Preparing (send prepare)
+     * Preparing -> Preparing (resend prepare)
+     * PreparedSuccess -> PreparedSuccess (do nothing)
+     * Committing -> Committing (invalid state)
+     * Aborting -> Aborting (invalid state)
+     */
+    public State prepare()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_PREPARING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING))
+        {
+            sendPrepare() ;
+        }
+
+        final State result = waitForState(State.STATE_PREPARING, TransportTimer.getTransportTimeout()) ;
+        if (result != State.STATE_PREPARING)
+        {
+            return result ;
+        }
+
+        synchronized(this)
+        {
+            if ((state == State.STATE_PREPARING) && (timerTask != null))
+            {
+        	timerTask.cancel() ;
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Handle the commit event.
+     *
+     * None -> None (invalid state)
+     * Active -> Active (invalid state)
+     * Preparing -> Preparing (invalid state)
+     * PreparedSuccess -> Committing (send commit)
+     * Committing -> Committing (resend commit)
+     * Aborting -> Aborting (invalid state)
+     */
+    public State commit()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_PREPARED_SUCCESS)
+            {
+                changeState(State.STATE_COMMITTING) ;
+            }
+        }
+
+        if ((current == State.STATE_PREPARED_SUCCESS) || (current == State.STATE_COMMITTING))
+        {
+            sendCommit() ;
+        }
+
+        final State result = waitForState(State.STATE_COMMITTING, TransportTimer.getTransportTimeout()) ;
+        if (result != State.STATE_COMMITTING)
+        {
+            return result ;
+        }
+
+        synchronized(this)
+        {
+            if ((state == State.STATE_COMMITTING) && (timerTask != null))
+            {
+        	timerTask.cancel() ;
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Handle the rollback event.
+     *
+     * None -> None (invalid state)
+     * Active -> Aborting (send rollback)
+     * Preparing -> Aborting (send rollback)
+     * PreparedSuccess -> Aborting (send rollback)
+     * Committing -> Committing (invalid state)
+     * Aborting -> Aborting (do nothing)
+     */
+    public State rollback()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+                (current == State.STATE_PREPARED_SUCCESS))
+            {
+                changeState(State.STATE_ABORTING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+            (current == State.STATE_PREPARED_SUCCESS))
+        {
+            sendRollback() ;
+        }
+        else if (current == State.STATE_ABORTING)
+        {
+            forget() ;
+        }
+
+        return waitForState(State.STATE_ABORTING, TransportTimer.getTransportTimeout()) ;
+    }
+
+    /**
+     * Handle the comms timeout event.
+     *
+     * Preparing -> Preparing (resend Prepare)
+     * Committing -> Committing (resend Commit)
+     */
+    private void commsTimeout()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+        }
+
+        if (current == State.STATE_PREPARING)
+        {
+            sendPrepare() ;
+        }
+        else if (current == State.STATE_COMMITTING)
+        {
+            sendCommit() ;
+        }
+    }
+
+    /**
+     * Get the coordinator id.
+     * @return The coordinator id.
+     */
+    public String getId()
+    {
+        return id ;
+    }
+
+    /**
+     * Get the participant endpoint reference
+     * @return The participant endpoint reference
+     */
+    public W3CEndpointReference getParticipant()
+    {
+        return participant ;
+    }
+
+    /**
+     * Is the participant durable?
+     * @return true if durable, false otherwise.
+     */
+    public boolean isDurable()
+    {
+        return durable ;
+    }
+
+    /**
+     * Was this a read only response?
+     * @return true if a read only response, false otherwise.
+     */
+    public synchronized boolean isReadOnly()
+    {
+        return readOnly ;
+    }
+
+    /**
+     * Change the state and notify any listeners.
+     * @param state The new state.
+     */
+    private synchronized void changeState(final State state)
+    {
+        if (this.state != state)
+        {
+            this.state = state ;
+            notifyAll() ;
+        }
+    }
+
+    /**
+     * Wait for the state to change from the specified state.
+     * @param origState The original state.
+     * @param delay The maximum time to wait for (in milliseconds).
+     * @return The current state.
+     */
+    private State waitForState(final State origState, final long delay)
+    {
+        final long end = System.currentTimeMillis() + delay ;
+        synchronized(this)
+        {
+            while(state == origState)
+            {
+                final long remaining = end - System.currentTimeMillis() ;
+                if (remaining <= 0)
+                {
+                    break ;
+                }
+                try
+                {
+                    wait(remaining) ;
+                }
+                catch (final InterruptedException ie) {} // ignore
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Forget the current coordinator.
+     */
+    private void forget()
+    {
+        changeState(null) ;
+        CoordinatorProcessor.getProcessor().deactivateCoordinator(this) ;
+    }
+
+    /**
+     * Send the prepare message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendPrepare_1 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendPrepare_1] - Unexpecting exception while sending Prepare
+     */
+    private void sendPrepare()
+    {
+        try
+        {
+            ParticipantClient.getClient().sendPrepare(participant, createContext(), instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendPrepare_1", th) ;
+            }
+        }
+
+        initiateTimer() ;
+    }
+
+    /**
+     * Send the commit message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendCommit_1 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendCommit_1] - Unexpecting exception while sending Commit
+     */
+    private void sendCommit()
+    {
+        try
+        {
+            ParticipantClient.getClient().sendCommit(participant, createContext(), instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendCommit_1", th) ;
+            }
+        }
+
+        initiateTimer() ;
+    }
+
+    /**
+     * Send the rollback message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendRollback_1 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendRollback_1] - Unexpecting exception while sending Rollback
+     */
+    private void sendRollback()
+    {
+        try
+        {
+            ParticipantClient.getClient().sendRollback(participant, createContext(), instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendRollback_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the InvalidStateWS message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_1 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_1] - Inconsistent internal state.
+     * @message com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_2 [com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_2] - Unexpecting exception while sending InvalidState
+     */
+    private void sendInvalidState(final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        try
+        {
+            final AddressingProperties responseContext = createContext() ;
+            final AttributedURI messageId = addressingProperties.getMessageID() ;
+            final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+            if (messageId != null)
+            {
+                AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
+                Relationship[] relatesTo = new Relationship[] { builder.newRelationship(messageId.getURI()) };
+                responseContext.setRelatesTo(relatesTo);
+            }
+
+            final String message = WSTLogger.log_mesg.getString("com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_1") ;
+            final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, message) ;
+            ParticipantClient.getClient().sendSoapFault(participant, responseContext, soapFault, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendInvalidState_2", th) ;
+            }
+        }
+    }
+
+    /**
+     * Initiate the timer.
+     */
+    private synchronized void initiateTimer()
+    {
+        if (timerTask != null)
+        {
+            timerTask.cancel() ;
+        }
+        if ((state == State.STATE_PREPARING) || (state == State.STATE_COMMITTING))
+        {
+            timerTask = new TimerTask() {
+                public void run() {
+                    commsTimeout() ;
+                }
+            } ;
+            TransportTimer.getTimer().schedule(timerTask, TransportTimer.getTransportPeriod()) ;
+        }
+        else
+        {
+            timerTask = null ;
+        }
+    }
+
+    /**
+     * Create a context for the outgoing message.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId) ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionCoordinatorEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionCoordinatorEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionCoordinatorEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,875 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsba.client.ParticipantCompletionParticipantClient;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst11.BAParticipantManager;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * The participant completion coordinator state engine
+ * @author kevin                     cannot
+ */
+public class ParticipantCompletionCoordinatorEngine implements ParticipantCompletionCoordinatorInboundEvents
+{
+    /**
+     * The coordinator id.
+     */
+    private final String id ;
+    /**
+     * The instance identifier.
+     */
+    private final InstanceIdentifier instanceIdentifier ;
+    /**
+     * The participant endpoint reference.
+     */
+    private final W3CEndpointReference participant ;
+    /**
+     * The associated coordinator
+     */
+    private BAParticipantManager coordinator ;
+    /**
+     * The current state.
+     */
+    private State state ;
+
+    /**
+     * Construct the initial engine for the coordinator.
+     * @param id The coordinator id.
+     * @param participant The participant endpoint reference.
+     */
+    public ParticipantCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant)
+    {
+        this(id, participant, State.STATE_ACTIVE) ;
+    }
+
+    /**
+     * Construct the engine for the coordinator in a specified state.
+     * @param id The coordinator id.
+     * @param participant The participant endpoint reference.
+     * @param state The initial state.
+     */
+    public ParticipantCompletionCoordinatorEngine(final String id, final W3CEndpointReference participant,
+        final State state)
+    {
+        this.id = id ;
+        this.instanceIdentifier = new InstanceIdentifier(id) ;
+        this.participant = participant ;
+        this.state = state ;
+    }
+
+    /**
+     * Set the coordinator and register
+     * @param coordinator
+     */
+    public void setCoordinator(final BAParticipantManager coordinator)
+    {
+        this.coordinator = coordinator ;
+        ParticipantCompletionCoordinatorProcessor.getProcessor().activateCoordinator(this, id) ;
+    }
+
+    /**
+     * Handle the cancelled event.
+     * @param cancelled The cancelled notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Ended
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_CANCELING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the closed event.
+     * @param closed The closed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Ended
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void closed(final NotificationType closed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_CLOSING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the compensated event.
+     * @param compensated The compensated notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Ended
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void compensated(final NotificationType compensated, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPENSATING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the completed event.
+     * @param completed The completed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Completed
+     * Canceling -> Compensating
+     * Completed -> Completed
+     * Closing -> Closing (resend Close)
+     * Compensating -> (resend Compensate)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_COMPLETED) ;
+            }
+            else if (current == State.STATE_CANCELING)
+            {
+        	state = State.STATE_COMPENSATING ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executeCompleted() ;
+        }
+        else if (current == State.STATE_CLOSING)
+        {
+            sendClose() ;
+        }
+        else if ((current == State.STATE_CANCELING) || (current == State.STATE_COMPENSATING))
+        {
+            sendCompensate() ;
+        }
+    }
+
+    /**
+     * Handle the exit event.
+     * @param exit The exit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Exiting
+     * Canceling -> Exiting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting
+     * Ended -> Ended (resend Exited)
+     */
+    public void exit(final NotificationType exit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING))
+            {
+                changeState(State.STATE_EXITING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING))
+        {
+            executeExit() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendExited() ;
+        }
+    }
+
+    /**
+     * Handle the fail event.
+     * @param fail The fail exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Failing-Active
+     * Canceling -> Failing-Canceling
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Failing-Compensating
+     * Failing-Active -> Failing-Active
+     * Failing-Canceling -> Failing-Canceling
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (resend Failed)
+     */
+    public void fail(final ExceptionType fail, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+        	changeState(State.STATE_FAILING_ACTIVE) ;
+            }
+            else if (current == State.STATE_CANCELING)
+            {
+                changeState(State.STATE_FAILING_CANCELING) ;
+            }
+            else if (current == State.STATE_COMPENSATING)
+            {
+                changeState(State.STATE_FAILING_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executeFail(fail.getExceptionIdentifier()) ;
+        }
+        else if ((current == State.STATE_CANCELING) || (current == State.STATE_COMPENSATING))
+        {
+            sendFailed() ;
+            ended() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendFailed() ;
+        }
+    }
+
+    /**
+     * Handle the cannot complete event.
+     * @param cannotComplete The cannotComplete exception.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> NotCompleting
+     * Canceling -> NotCompleting
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (resend NotCompleted)
+     */
+    public void cannotComplete(final NotificationType cannotComplete, final AddressingProperties addressingProperties,
+        final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (state == State.STATE_CANCELING))
+            {
+                changeState(State.STATE_NOT_COMPLETING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING))
+        {
+            executeCannotComplete() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendNotCompleted() ;
+        }
+    }
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	final State current ;
+	synchronized(this)
+	{
+	    current = state ;
+	}
+        sendStatus(current) ;
+    }
+
+    /**
+     * Handle the status event.
+     * @param status The status.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // TODO - is this correct?
+
+        final State current ;
+	    synchronized(this)
+	    {
+	        current = state ;
+	    }
+        sendStatus(current) ;
+    }
+
+    /**
+     * Handle the get status event.
+     * @return The state.
+     */
+    public synchronized State getStatus()
+    {
+        return state ;
+    }
+
+    /**
+     * Handle the cancel event.
+     * @return The state.
+     *
+     * Active -> Canceling
+     * Canceling -> Canceling
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State cancel()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_CANCELING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_CANCELING))
+        {
+            sendCancel() ;
+            return waitForState(State.STATE_CANCELING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the compensate event.
+     * @return The state.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Compensating
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State compensate()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_COMPENSATING) ;
+            }
+        }
+
+        if ((current == State.STATE_COMPLETED) || (current == State.STATE_COMPENSATING))
+        {
+            sendCompensate() ;
+            return waitForState(State.STATE_COMPENSATING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the close event.
+     * @return The state.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Closing
+     * Closing -> Closing
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State close()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_CLOSING) ;
+            }
+        }
+
+        if ((current == State.STATE_COMPLETED) || (current == State.STATE_CLOSING))
+        {
+            sendClose() ;
+            return waitForState(State.STATE_CLOSING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	ended() ;
+	try
+	{
+	    // TODO - we cannot do this with JaxWS. need to log something
+	}
+	catch (final Throwable th) {} // ignore
+    }
+
+    /**
+     * Send the close message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendClose_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendClose_1] - Unexpected exception while sending Close
+     */
+    private void sendClose()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendClose(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendClose_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the compensate message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCompensate_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCompensate_1] - Unexpected exception while sending Compensate
+     */
+    private void sendCompensate()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendCompensate(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCompensate_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cancel message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCancel_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCancel_1] - Unexpected exception while sending Cancel
+     */
+    private void sendCancel()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendCancel(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendCancel_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the exited message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendExited_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendExited_1] - Unexpected exception while sending Exited
+     */
+    private void sendExited()
+    {
+        final AddressingProperties addressingProperties  = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendExited(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendExited_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the faulted message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendFailed_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendFailed_1] - Unexpected exception while sending Faulted
+     */
+    private void sendFailed()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendFailed(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendFailed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the not completed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendNotCompleted_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendNotCompleted_1] - Unexpected exception while sending NotCompleted
+     */
+    private void sendNotCompleted()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendNotCompleted(participant, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendNotCompleted_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the status message.
+     * @param state The state.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendStatus_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendStatus_1] - Unexpected exception while sending Status
+     */
+    private void sendStatus(final State state)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionParticipantClient.getClient().sendStatus(participant, addressingProperties, instanceIdentifier, state.getValue()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.sendStatus_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Get the coordinator id.
+     * @return The coordinator id.
+     */
+    public String getId()
+    {
+        return id ;
+    }
+
+    /**
+     * Get the participant endpoint reference
+     * @return The participant endpoint reference
+     */
+    public W3CEndpointReference getParticipant()
+    {
+        return participant ;
+    }
+
+    /**
+     * Get the associated coordinator.
+     * @return The associated coordinator.
+     */
+    public BAParticipantManager getCoordinator()
+    {
+        return coordinator;
+    }
+
+    /**
+     * Change the state and notify any listeners.
+     * @param state The new state.
+     */
+    private synchronized void changeState(final State state)
+    {
+        if (this.state != state)
+        {
+            this.state = state ;
+            notifyAll() ;
+        }
+    }
+
+    /**
+     * Wait for the state to change from the specified state.
+     * @param origState The original state.
+     * @param delay The maximum time to wait for (in milliseconds).
+     * @return The current state.
+     */
+    private State waitForState(final State origState, final long delay)
+    {
+        final long end = System.currentTimeMillis() + delay ;
+        synchronized(this)
+        {
+            while(state == origState)
+            {
+                final long remaining = end - System.currentTimeMillis() ;
+                if (remaining <= 0)
+                {
+                    break ;
+                }
+                try
+                {
+                    wait(remaining) ;
+                }
+                catch (final InterruptedException ie) {} // ignore
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Execute the completed transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCompleted_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCompleted_1] - Unexpected exception from coordinator completed
+     */
+    private void executeCompleted()
+    {
+        try
+        {
+            coordinator.completed() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCompleted_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Execute the exit transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeExit_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeExit_1] - Unexpected exception from coordinator exit
+     */
+    private void executeExit()
+    {
+        try
+        {
+            coordinator.exit() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeExit_1", th) ;
+            }
+            return ;
+        }
+        sendExited() ;
+        ended() ;
+    }
+
+    /**
+     * Executing the fail transition.
+     *
+     * @throws com.arjuna.webservices.SoapFault for SOAP errors.
+     * @throws java.io.IOException for transport errors.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeFault_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeFault_1] - Unexpected exception from coordinator fault
+     */
+    private void executeFail(QName fail)
+    {
+        try
+        {
+            coordinator.fail(fail) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeFault_1", th) ;
+            }
+            return ;
+        }
+        sendFailed() ;
+        ended() ;
+    }
+
+    /**
+     * Executing the cannot complete transition.
+     *
+     * @throws SoapFault for SOAP errors.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCannotComplete_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCannotComplete_1] - Unexpected exception from coordinator error
+     */
+    private void executeCannotComplete()
+    {
+        try
+        {
+            coordinator.cannotComplete() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine.executeCannotComplete_1", th) ;
+            }
+            return ;
+        }
+        sendNotCompleted() ;
+        ended() ;
+    }
+    /**
+     * End the current coordinator.
+     */
+    private void ended()
+    {
+        changeState(State.STATE_ENDED) ;
+        ParticipantCompletionCoordinatorProcessor.getProcessor().deactivateCoordinator(this) ;
+    }
+
+    /**
+     * Create a context for the outgoing message.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionParticipantEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionParticipantEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantCompletionParticipantEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,953 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.wsba.client.ParticipantCompletionCoordinatorClient;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType;
+import org.oasis_open.docs.ws_tx.wsba._2006._06.StatusType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.TimerTask;
+
+/**
+ * The participant completion participant state engine
+ * @author kevin
+ */
+public class ParticipantCompletionParticipantEngine implements ParticipantCompletionParticipantInboundEvents
+{
+    /**
+     * The participant id.
+     */
+    private final String id ;
+    /**
+     * The instance identifier.
+     */
+    private final InstanceIdentifier instanceIdentifier ;
+    /**
+     * The coordinator endpoint reference.
+     */
+    private final W3CEndpointReference coordinator ;
+    /**
+     * The associated participant
+     */
+    private final BusinessAgreementWithParticipantCompletionParticipant participant ;
+    /**
+     * The current state.
+     */
+    private State state ;
+    /**
+     * The associated timer task or null.
+     */
+    private TimerTask timerTask ;
+
+    /**
+     * Construct the initial engine for the participant.
+     * @param id The participant id.
+     * @param coordinator The coordinator endpoint reference.
+     * @param participant The participant.
+     */
+    public ParticipantCompletionParticipantEngine(final String id, final W3CEndpointReference coordinator,
+        final BusinessAgreementWithParticipantCompletionParticipant participant)
+    {
+        this(id, coordinator, participant, State.STATE_ACTIVE) ;
+    }
+
+    /**
+     * Construct the engine for the participant in a specified state.
+     * @param id The participant id.
+     * @param coordinator The coordinator endpoint reference.
+     * @param participant The participant.
+     * @param state The initial state.
+     */
+    public ParticipantCompletionParticipantEngine(final String id, final W3CEndpointReference coordinator,
+        final BusinessAgreementWithParticipantCompletionParticipant participant, final State state)
+    {
+        this.id = id ;
+        this.instanceIdentifier = new InstanceIdentifier(id) ;
+        this.coordinator = coordinator ;
+        this.participant = participant ;
+        this.state = state ;
+    }
+
+    /**
+     * Handle the cancel event.
+     * @param cancel The cancel notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Canceling
+     * Canceling -> Canceling
+     * Completed -> Completed (resend Completed)
+     * Closing -> Closing
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (resend Fail)
+     * Failing-Canceling -> Failing-Canceling (resend Fail)
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (resend CannotComplete)
+     * Exiting -> Exiting (resend Exit)
+     * Ended -> Ended (resend Cancelled)
+     */
+    public void cancel(final NotificationType cancel, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_CANCELING) ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executeCancel() ;
+        }
+        else if (current == State.STATE_COMPLETED)
+        {
+            sendCompleted() ;
+        }
+        else if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING))
+        {
+            sendFail(current.getValue()) ;
+        }
+        else if (current == State.STATE_NOT_COMPLETING)
+        {
+            sendCannotComplete() ;
+        }
+        else if (current == State.STATE_EXITING)
+        {
+            sendExit() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendCancelled() ;
+        }
+    }
+
+    /**
+     * Handle the close event.
+     * @param close The close notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Closing
+     * Closing -> Closing
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (send Closed)
+     */
+    public void close(final NotificationType close, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_CLOSING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            if (timerTask != null)
+            {
+                timerTask.cancel() ;
+            }
+            executeClose() ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendClosed() ;
+        }
+    }
+
+    /**
+     * Handle the compensate event.
+     * @param compensate The compensate notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Compensating
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (resend Fail)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (send Compensated)
+     */
+    public void compensate(final NotificationType compensate, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPLETED)
+            {
+                changeState(State.STATE_COMPENSATING) ;
+            }
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            if (timerTask != null)
+            {
+                timerTask.cancel() ;
+            }
+            executeCompensate() ;
+        }
+        else if (current == State.STATE_FAILING_COMPENSATING)
+        {
+            sendFail(current.getValue()) ;
+        }
+        else if (current == State.STATE_ENDED)
+        {
+            sendCompensated() ;
+        }
+    }
+
+    /**
+     * Handle the exited event.
+     * @param exited The exited notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Ended
+     * Ended -> Ended
+     */
+    public void exited(final NotificationType exited, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_EXITING)
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the failed event.
+     * @param failed The failed notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Ended
+     * Failing-Canceling -> Ended
+     * Failing-Compensating -> Ended
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void failed(final NotificationType failed,  final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_FAILING_ACTIVE) || (current == State.STATE_FAILING_CANCELING) ||
+                (current == State.STATE_FAILING_COMPENSATING))
+            {
+                ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the not completed event.
+     * @param notCompleted The notCompleted notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * Active -> Active (invalid state)
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> Ended
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended
+     */
+    public void notCompleted(final NotificationType notCompleted, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_NOT_COMPLETING)
+            {
+        	ended() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the getStatus event.
+     * @param getStatus The getStatus notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.getStatus_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.getStatus_1] - Unknown error: {0}
+     */
+    public void getStatus(final NotificationType getStatus, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	final State current ;
+	synchronized(this)
+	{
+	    current = state ;
+	}
+	sendStatus(current) ;
+    }
+
+    /**
+     * Handle the status event.
+     * @param status The status type.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void status(final StatusType status, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        // KEV - implement
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+	ended() ;
+	try
+	{
+	    participant.error() ;
+	}
+	catch (final Throwable th) {} // ignore
+    }
+
+    /**
+     * Handle the completed event.
+     *
+     * Active -> Completed
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State completed()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_COMPLETED) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_COMPLETED))
+        {
+            sendCompleted() ;
+        }
+
+        return current ;
+    }
+
+    /**
+     * Handle the exit event.
+     *
+     * Active -> Exiting
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting
+     * Ended -> Ended (invalid state)
+     */
+    public State exit()
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_EXITING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_EXITING))
+        {
+            sendExit() ;
+        }
+
+        return waitForState(State.STATE_EXITING, TransportTimer.getTransportTimeout()) ;
+    }
+
+    /**
+     * Handle the fail event.
+     *
+     * Active -> Failing-Active
+     * Canceling -> Failing-Canceling
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Failing-Compensating
+     * Failing-Active -> Failing-Active
+     * Failing-Canceling -> Failing-Canceling
+     * Failing-Compensating -> Failing-Compensating
+     * NotCompleting -> NotCompleting (invalid state)
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State fail(final QName exceptionIdentifier)
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_FAILING_ACTIVE) ;
+            }
+            else if (current == State.STATE_CANCELING)
+            {
+        	changeState(State.STATE_FAILING_CANCELING) ;
+            }
+            else if (current == State.STATE_COMPENSATING)
+            {
+                changeState(State.STATE_FAILING_COMPENSATING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_FAILING_ACTIVE))
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_ACTIVE, TransportTimer.getTransportTimeout()) ;
+        }
+        else if ((current == State.STATE_CANCELING) || (current == State.STATE_FAILING_CANCELING))
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_CANCELING, TransportTimer.getTransportTimeout()) ;
+        }
+        else if ((current == State.STATE_COMPENSATING) || (current == State.STATE_FAILING_COMPENSATING))
+        {
+            sendFail(exceptionIdentifier) ;
+            return waitForState(State.STATE_FAILING_COMPENSATING, TransportTimer.getTransportTimeout()) ;
+        }
+
+        return current ;
+    }
+
+    /**
+     * Handle the cannot complete event.
+     *
+     * Active -> NotCompleting
+     * Canceling -> Canceling (invalid state)
+     * Completed -> Completed (invalid state)
+     * Closing -> Closing (invalid state)
+     * Compensating -> Compensating (invalid state)
+     * Failing-Active -> Failing-Active (invalid state)
+     * Failing-Canceling -> Failing-Canceling (invalid state)
+     * Failing-Compensating -> Failing-Compensating (invalid state)
+     * NotCompleting -> NotCompleting
+     * Exiting -> Exiting (invalid state)
+     * Ended -> Ended (invalid state)
+     */
+    public State cannotComplete()
+    {
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                changeState(State.STATE_NOT_COMPLETING) ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_NOT_COMPLETING))
+        {
+            sendCannotComplete() ;
+            return waitForState(State.STATE_NOT_COMPLETING, TransportTimer.getTransportTimeout()) ;
+        }
+        return current ;
+    }
+
+    /**
+     * Handle the comms timeout event.
+     *
+     * Completed -> Completed (resend Completed)
+     */
+    private void commsTimeout()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+        }
+
+        if (current == State.STATE_COMPLETED)
+        {
+            sendCompleted() ;
+        }
+    }
+
+    /**
+     * Send the exit message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendExit_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendExit_1] - Unexpected exception while sending Exit
+     */
+    private void sendExit()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendExit(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendExit_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the completed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompleted_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompleted_1] - Unexpected exception while sending Completed
+     */
+    private void sendCompleted()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendCompleted(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompleted_1", th) ;
+            }
+        }
+
+        initiateTimer() ;
+    }
+
+    /**
+     * Send the fail message.
+     * @param message The fail message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendFail_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendFail_1] - Unexpected exception while sending Fault
+     */
+    private void sendFail(final QName message)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendFail(coordinator, addressingProperties, instanceIdentifier, message) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendFail_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cancelled message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCancelled_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCancelled_1] - Unexpected exception while sending Cancelled
+     */
+    private void sendCancelled()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendCancelled(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCancelled_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the closed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendClosed_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendClosed_1] - Unexpected exception while sending Closed
+     */
+    private void sendClosed()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendClosed(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendClosed_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the compensated message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompensated_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompensated_1] - Unexpected exception while sending Compensated
+     */
+    private void sendCompensated()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendCompensated(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCompensated_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the status message.
+     * @param state The state.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendStatus_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendStatus_1] - Unexpected exception while sending Status
+     */
+    private void sendStatus(final State state)
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendStatus(coordinator, addressingProperties, instanceIdentifier, state.getValue()) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendStatus_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the cannot complete message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCannotComplete_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCannotComplete_1] - Unexpected exception while sending Status
+     */
+    private void sendCannotComplete()
+    {
+        final AddressingProperties addressingProperties = createContext() ;
+        try
+        {
+            ParticipantCompletionCoordinatorClient.getClient().sendCannotComplete(coordinator, addressingProperties, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.sendCannotComplete_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Get the coordinator id.
+     * @return The coordinator id.
+     */
+    public String getId()
+    {
+        return id ;
+    }
+
+    /**
+     * Get the coordinator endpoint reference
+     * @return The coordinator endpoint reference
+     */
+    public W3CEndpointReference getCoordinator()
+    {
+        return coordinator ;
+    }
+
+    /**
+     * Get the associated participant.
+     * @return The associated participant.
+     */
+    public BusinessAgreementWithParticipantCompletionParticipant getParticipant()
+    {
+        return participant ;
+    }
+
+    /**
+     * Change the state and notify any listeners.
+     * @param state The new state.
+     */
+    private synchronized void changeState(final State state)
+    {
+        if (this.state != state)
+        {
+            this.state = state ;
+            notifyAll() ;
+        }
+    }
+
+    /**
+     * Wait for the state to change from the specified state.
+     * @param origState The original state.
+     * @param delay The maximum time to wait for (in milliseconds).
+     * @return The current state.
+     */
+    private State waitForState(final State origState, final long delay)
+    {
+        final long end = System.currentTimeMillis() + delay ;
+        synchronized(this)
+        {
+            while(state == origState)
+            {
+                final long remaining = end - System.currentTimeMillis() ;
+                if (remaining <= 0)
+                {
+                    break ;
+                }
+                try
+                {
+                    wait(remaining) ;
+                }
+                catch (final InterruptedException ie) {} // ignore
+            }
+            return state ;
+        }
+    }
+
+    /**
+     * Execute the cancel transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeCancel_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeCancel_1] - Unexpected exception from participant cancel
+     */
+    private void executeCancel()
+    {
+        try
+        {
+            participant.cancel() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeCancel_1", th) ;
+            }
+            return ;
+        }
+        sendCancelled() ;
+        ended() ;
+    }
+
+    /**
+     * Execute the close transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeClose_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeClose_1] - Unexpected exception from participant close
+     */
+    private void executeClose()
+    {
+        try
+        {
+            participant.close() ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeClose_1", th) ;
+            }
+            return ;
+        }
+        sendClosed() ;
+        ended() ;
+    }
+
+    /**
+     * Execute the compensate transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeCompensate_1 [com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeCompensate_1] - Unexpected exception from participant compensate
+     */
+    private void executeCompensate()
+    {
+        try
+        {
+            participant.compensate() ;
+        }
+        catch (final FaultedException fe)
+        {
+            // TODO - use the right value here -- shoudl be a QName for Faulted (Kev's 1.1 code uses JBOSSTX.FAULTED_ERROR_CODE_QNAME)
+            fail(ArjunaTXConstants.WSARJTX_ELEMENT_FAULTED_QNAME);
+        }
+        catch (final Throwable th)
+        {
+            final State current ;
+            synchronized (this)
+            {
+                current = state ;
+                if (current == State.STATE_COMPENSATING)
+                {
+                    changeState(State.STATE_COMPLETED) ;
+                }
+            }
+            if (current == State.STATE_COMPENSATING)
+            {
+                initiateTimer() ;
+            }
+
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine.executeClose_1", th) ;
+            }
+            return ;
+        }
+
+        final State current ;
+        synchronized (this)
+        {
+            current = state ;
+            if (current == State.STATE_COMPENSATING)
+            {
+                ended() ;
+            }
+        }
+        if (current == State.STATE_COMPENSATING)
+        {
+            sendCompensated() ;
+        }
+    }
+
+    /**
+     * End the current participant.
+     */
+    private void ended()
+    {
+	changeState(State.STATE_ENDED) ;
+        ParticipantCompletionParticipantProcessor.getProcessor().deactivateParticipant(this) ;
+    }
+
+    /**
+     * Initiate the timer.
+     */
+    private synchronized void initiateTimer()
+    {
+        if (timerTask != null)
+        {
+            timerTask.cancel() ;
+        }
+
+        if (state == State.STATE_COMPLETED)
+        {
+            timerTask = new TimerTask() {
+                public void run() {
+                    commsTimeout() ;
+                }
+            } ;
+            TransportTimer.getTimer().schedule(timerTask, TransportTimer.getTransportPeriod()) ;
+        }
+        else
+        {
+            timerTask = null ;
+        }
+    }
+
+    /**
+     * Create a context for the outgoing message.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId) ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/messaging/engines/ParticipantEngine.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,575 @@
+package com.arjuna.wst11.messaging.engines;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.util.TransportTimer;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wsat.client.CoordinatorClient;
+import com.arjuna.webservices11.wsat.ParticipantInboundEvents;
+import com.arjuna.webservices11.wsat.State;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.*;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import java.util.TimerTask;
+
+/**
+ * The participant state engine
+ * @author kevin
+ */
+public class ParticipantEngine implements ParticipantInboundEvents
+{
+    /**
+     * The associated participant
+     */
+    private final Participant participant ;
+    /**
+     * The participant id.
+     */
+    private final String id ;
+    /**
+     * The coordinator endpoint reference.
+     */
+    private final W3CEndpointReference coordinator ;
+    /**
+     * The current state.
+     */
+    private State state ;
+    /**
+     * The associated timer task or null.
+     */
+    private TimerTask timerTask ;
+
+    /**
+     * Construct the initial engine for the participant.
+     * @param participant The participant.
+     * @param id The participant id.
+     * @param coordinator The coordinator endpoint reference.
+     */
+    public ParticipantEngine(final Participant participant, final String id, final W3CEndpointReference coordinator)
+    {
+        this(participant, id, State.STATE_ACTIVE, coordinator) ;
+    }
+
+    /**
+     * Construct the engine for the participant in a specified state.
+     * @param participant The participant.
+     * @param id The participant id.
+     * @param state The initial state.
+     * @param coordinator The coordinator endpoint reference.
+     */
+    public ParticipantEngine(final Participant participant, final String id, final State state, final W3CEndpointReference coordinator)
+    {
+        this.participant = participant ;
+        this.id = id ;
+        this.state = state ;
+        this.coordinator = coordinator ;
+    }
+
+    /**
+     * Handle the commit event.
+     * @param commit The commit notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (send committed)
+     * Active -> Aborting (do nothing)
+     * Preparing -> Aborting (do nothing)
+     * PreparedSuccess -> Committing (initiate commit)
+     * Committing -> Committing (do nothing)
+     * Aborting -> Aborting (do nothing)
+     */
+    public void commit(final Notification commit, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_PREPARED_SUCCESS)
+            {
+                state = State.STATE_COMMITTING ;
+                if (timerTask != null)
+                {
+                    timerTask.cancel() ;
+                }
+            }
+            else if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING))
+            {
+                state = State.STATE_ABORTING ;
+            }
+        }
+
+        if (current == State.STATE_PREPARED_SUCCESS)
+        {
+            executeCommit() ;
+        }
+        else if (current == null)
+        {
+            sendCommitted() ;
+        }
+    }
+
+    /**
+     * Handle the prepare event.
+     * @param prepare The prepare notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (send aborted)
+     * Active -> Preparing (execute prepare)
+     * Preparing -> Preparing (do nothing)
+     * PreparedSuccess -> PreparedSuccess (resend prepared)
+     * Committing -> Committing (ignore)
+     * Aborting -> Aborting (send aborted and forget)
+     */
+    public void prepare(final Notification prepare, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_ACTIVE)
+            {
+                state = State.STATE_PREPARING ;
+            }
+        }
+
+        if (current == State.STATE_ACTIVE)
+        {
+            executePrepare() ;
+        }
+        else if (current == State.STATE_PREPARED_SUCCESS)
+        {
+            sendPrepared() ;
+        }
+        else if ((current == State.STATE_ABORTING) || (current == null))
+        {
+            sendAborted() ;
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the rollback event.
+     * @param rollback The rollback notification.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * None -> None (send aborted)
+     * Active -> Aborting (execute rollback, send aborted and forget)
+     * Preparing -> Aborting (execute rollback, send aborted and forget)
+     * PreparedSuccess -> Aborting (execute rollback, send aborted and forget)
+     * Committing -> Committing (ignore)
+     * Aborting -> Aborting (send aborted and forget)
+     */
+    public void rollback(final Notification rollback, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+                (current == State.STATE_PREPARED_SUCCESS))
+            {
+                state = State.STATE_ABORTING ;
+            }
+        }
+
+        if (current != State.STATE_COMMITTING)
+        {
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING) ||
+                (current == State.STATE_PREPARED_SUCCESS))
+            {
+                if (!executeRollback())
+                {
+                    return ;
+                }
+            }
+
+            sendAborted() ;
+
+            if (current != null)
+            {
+                forget() ;
+            }
+        }
+    }
+
+    /**
+     * Handle the soap fault event.
+     * @param soapFault The soap fault.
+     * @param addressingProperties The addressing context.
+     * @param arjunaContext The arjuna context.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.soapFault_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.soapFault_1] - Unexpected SOAP fault for participant {0}: {1} {2}
+     */
+    public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
+    {
+        if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+        {
+            final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier() ;
+            final SoapFaultType soapFaultType = soapFault.getSoapFaultType() ;
+            final QName subCode = soapFault.getSubcode() ;
+            WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.soapFault_1", new Object[] {instanceIdentifier, soapFaultType, subCode}) ;
+        }
+
+        if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(soapFault.getSubcode()))
+        {
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the commit decision event.
+     *
+     * Preparing -> PreparedSuccess (send Prepared)
+     * Committing -> Committing (send committed and forget)
+     */
+    private void commitDecision()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if (current == State.STATE_PREPARING)
+            {
+                state = State.STATE_PREPARED_SUCCESS ;
+            }
+        }
+
+        if (current == State.STATE_PREPARING)
+        {
+            sendPrepared() ;
+        }
+        else if (current == State.STATE_COMMITTING)
+        {
+            sendCommitted() ;
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the readOnly decision event.
+     *
+     * Active -> None (send ReadOnly)
+     * Preparing -> None (send ReadOnly)
+     */
+    private void readOnlyDecision()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING))
+            {
+        	state = null ;
+            }
+        }
+
+        if ((current == State.STATE_ACTIVE) || (current == State.STATE_PREPARING))
+        {
+            sendReadOnly() ;
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the rollback decision event.
+     *
+     * Active -> Aborting (send aborted)
+     * Preparing -> Aborting (send aborted)
+     */
+    private void rollbackDecision()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+            if ((current == State.STATE_PREPARING) || (current == State.STATE_ACTIVE))
+            {
+                state = State.STATE_ABORTING ;
+            }
+        }
+
+        if ((current == State.STATE_PREPARING) || (current == State.STATE_ACTIVE))
+        {
+            sendAborted() ;
+            forget() ;
+        }
+    }
+
+    /**
+     * Handle the comms timeout event.
+     *
+     * PreparedSuccess -> PreparedSuccess (resend Prepared)
+     */
+    private void commsTimeout()
+    {
+        final State current ;
+        synchronized(this)
+        {
+            current = state ;
+        }
+
+        if (current == State.STATE_PREPARED_SUCCESS)
+        {
+            sendPrepared() ;
+        }
+    }
+
+    /**
+     * Execute the commit transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.executeCommit_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.executeCommit_1] - Unexpected exception from participant commit
+     */
+    private void executeCommit()
+    {
+        try
+        {
+            participant.commit() ;
+            commitDecision() ;
+        }
+        catch (final Throwable th)
+        {
+            synchronized(this)
+            {
+                if (state == State.STATE_COMMITTING)
+                {
+            	    state = State.STATE_PREPARED_SUCCESS ;
+                }
+            }
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.executeCommit_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Execute the rollback transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.executeRollback_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.executeRollback_1] - Unexpected exception from participant rollback
+     */
+    private boolean executeRollback()
+    {
+        try
+        {
+            participant.rollback() ;
+        }
+        catch (final SystemException se)
+        {
+            return false ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.executeRollback_1", th) ;
+            }
+        }
+        return true ;
+    }
+
+    /**
+     * Execute the prepare transition.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_1] - Unexpected exception from participant prepare
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_2 [com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_2] - Unexpected result from participant prepare: {0}
+     */
+    private void executePrepare()
+    {
+        final Vote vote ;
+        try
+        {
+            vote = participant.prepare();
+        }
+        catch (final SystemException se)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_1", se) ;
+            }
+            return ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_1", th) ;
+            }
+            rollbackDecision() ;
+            return ;
+        }
+
+        if (vote instanceof Prepared)
+        {
+            commitDecision() ;
+        }
+        else if (vote instanceof ReadOnly)
+        {
+            readOnlyDecision() ;
+        }
+        else if (vote instanceof Aborted)
+        {
+            rollbackDecision() ;
+        }
+        else
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.executePrepare_2", new Object[] {(vote == null ? "null" : vote.getClass().getName())}) ;
+            }
+            rollbackDecision() ;
+        }
+    }
+
+    /**
+     * Forget the current participant.
+     */
+    private void forget()
+    {
+        synchronized(this)
+        {
+            state = null ;
+        }
+        ParticipantProcessor.getProcessor().deactivateParticipant(this) ;
+    }
+
+    /**
+     * Send the committed message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.sendCommitted_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.sendCommitted_1] - Unexpected exception while sending Committed
+     */
+    private void sendCommitted()
+    {
+        final AddressingProperties responseAddressingContext = createContext() ;
+        final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ;
+        try
+        {
+            CoordinatorClient.getClient().sendCommitted(coordinator, responseAddressingContext, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.sendCommitted_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the prepared message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.sendPrepared_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.sendPrepared_1] - Unexpected exception while sending Prepared
+     */
+    private void sendPrepared()
+    {
+        final AddressingProperties responseAddressingContext = createContext() ;
+        final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ;
+        try
+        {
+            CoordinatorClient.getClient().sendPrepared(coordinator, responseAddressingContext, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.sendPrepared_1", th) ;
+            }
+        }
+
+        initiateTimer() ;
+    }
+
+    /**
+     * Send the aborted message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.sendAborted_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.sendAborted_1] - Unexpected exception while sending Aborted
+     */
+    private void sendAborted()
+    {
+        final AddressingProperties responseAddressingContext = createContext() ;
+        final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ;
+        try
+        {
+            CoordinatorClient.getClient().sendAborted(coordinator, responseAddressingContext, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.sendAborted_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Send the read only message.
+     *
+     * @message com.arjuna.wst11.messaging.engines.ParticipantEngine.sendReadOnly_1 [com.arjuna.wst11.messaging.engines.ParticipantEngine.sendReadOnly_1] - Unexpected exception while sending ReadOnly
+     */
+    private void sendReadOnly()
+    {
+        final AddressingProperties responseAddressingContext = createContext() ;
+        final InstanceIdentifier instanceIdentifier = new InstanceIdentifier(id) ;
+        try
+        {
+            CoordinatorClient.getClient().sendReadOnly(coordinator, responseAddressingContext, instanceIdentifier) ;
+        }
+        catch (final Throwable th)
+        {
+            if (WSTLogger.arjLoggerI18N.isDebugEnabled())
+            {
+                WSTLogger.arjLoggerI18N.debug("com.arjuna.wst11.messaging.engines.ParticipantEngine.sendReadOnly_1", th) ;
+            }
+        }
+    }
+
+    /**
+     * Initiate the timer.
+     */
+    private synchronized void initiateTimer()
+    {
+        if (timerTask != null)
+        {
+            timerTask.cancel() ;
+        }
+
+        if (state == State.STATE_PREPARED_SUCCESS)
+        {
+            timerTask = new TimerTask() {
+                public void run() {
+                    commsTimeout() ;
+                }
+            } ;
+            TransportTimer.getTimer().schedule(timerTask, TransportTimer.getTransportPeriod()) ;
+        }
+        else
+        {
+            timerTask = null ;
+        }
+    }
+
+    /**
+     * Create a response context from the incoming context.
+     * @return The addressing context.
+     */
+    private AddressingProperties createContext()
+    {
+        final String messageId = MessageId.getMessageId() ;
+        return AddressingHelper.createNotificationContext(messageId) ;
+    }
+    
+    public W3CEndpointReference getCoordinator()
+    {
+        return coordinator;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BACoordinatorCompletionParticipantManagerStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BACoordinatorCompletionParticipantManagerStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BACoordinatorCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,132 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.stub;
+
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine;
+
+import javax.xml.namespace.QName;
+
+public class BACoordinatorCompletionParticipantManagerStub implements BAParticipantManager
+{
+    private final CoordinatorCompletionParticipantEngine coordinator ;
+
+    public BACoordinatorCompletionParticipantManagerStub(final CoordinatorCompletionParticipantEngine coordinator)
+        throws Exception
+    {
+        this.coordinator = coordinator ;
+    }
+
+    public void exit ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> no response
+         * Ended -> ended
+         */
+        final State state = coordinator.exit() ;
+        if (state == State.STATE_EXITING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void completed ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        // returns original state
+        final State state = coordinator.completed() ;
+        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void cannotComplete()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Failing-Active -> illegal state
+         * Failing-Canceling -> illegal state
+         * Failing-Completing -> illegal state
+         * Failing-Compensating -> illegal state
+         * NotCompleting -> no response
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.cannotComplete() ;
+        if (state == State.STATE_NOT_COMPLETING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void fail (final QName exceptionIdentifier)
+        throws SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Failing-Active -> no response
+         * Failing-Canceling -> no response
+         * Failing-Completing -> no response
+         * Failing-Compensating -> no response
+         * NotCompleting -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.fail(exceptionIdentifier) ;
+        if (state != State.STATE_ENDED)
+        {
+            throw new SystemException() ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BAParticipantCompletionParticipantManagerStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BAParticipantCompletionParticipantManagerStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BAParticipantCompletionParticipantManagerStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.wst11.stub;
+
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine;
+
+import javax.xml.namespace.QName;
+
+public class BAParticipantCompletionParticipantManagerStub implements BAParticipantManager
+{
+    private final ParticipantCompletionParticipantEngine coordinator ;
+
+    public BAParticipantCompletionParticipantManagerStub(final ParticipantCompletionParticipantEngine coordinator)
+        throws Exception
+    {
+        this.coordinator = coordinator ;
+    }
+
+    public synchronized void exit ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Failing-Active -> illegal state
+         * Failing-Canceling -> illegal state
+         * Failing-Compensating -> illegal state
+         * NotCompleting -> illegal state
+         * Exiting -> no response
+         * Ended -> ended
+         */
+        final State state = coordinator.exit() ;
+        if (state == State.STATE_EXITING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void completed ()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        // returns original state
+        final State state = coordinator.completed() ;
+        if ((state != State.STATE_ACTIVE) && (state != State.STATE_COMPLETED))
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void cannotComplete()
+        throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Failing-Active -> illegal state
+         * Failing-Canceling -> illegal state
+         * Failing-Compensating -> illegal state
+         * NotCompleting -> no response
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.cannotComplete() ;
+        if (state == State.STATE_NOT_COMPLETING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void fail (final QName exceptionIdentifier)
+        throws SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Failing-Active -> no response
+         * Failing-Canceling -> no response
+         * Failing-Compensating -> no response
+         * NotCompleting -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = coordinator.fail(exceptionIdentifier) ;
+        if (state != State.STATE_ENDED)
+        {
+            throw new SystemException() ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessActivityTerminatorStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessActivityTerminatorStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessActivityTerminatorStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,401 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessActivityTerminatorStub.java,v 1.7.6.1 2005/11/22 10:35:29 kconner Exp $
+ */
+
+package com.arjuna.wst11.stub;
+
+import com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapFaultType;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.SoapFault11;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsarjtx.client.TerminationCoordinatorClient;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantCallback;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationParticipantProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst11.BusinessActivityTerminator;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class BusinessActivityTerminatorStub implements BusinessActivityTerminator
+{
+    private W3CEndpointReference _terminationCoordinator = null;
+    private final String _id ;
+
+    public BusinessActivityTerminatorStub(final String id, final W3CEndpointReference terminationCoordinator)
+        throws Exception
+    {
+        _terminationCoordinator = terminationCoordinator;
+        _id = id ;
+    }
+
+    public void close ()
+        throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminationParticipantProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendClose(_terminationCoordinator, addressingProperties, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminationParticipantProcessor.removeCallback(_id) ;
+        }
+
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedClosed())
+            {
+                return ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new TransactionRolledBackException();
+                }
+                else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public void cancel ()
+        throws FaultedException, UnknownTransactionException, SystemException
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminationParticipantProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendCancel(_terminationCoordinator, addressingProperties, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminationParticipantProcessor.removeCallback(_id) ;
+        }
+
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCancelled())
+            {
+                return ;
+            }
+            else if (callback.receivedFaulted())
+            {
+                throw new FaultedException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public void complete ()
+        throws FaultedException, UnknownTransactionException, SystemException
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+
+        final RequestCallback callback = new RequestCallback() ;
+        final TerminationParticipantProcessor terminationParticipantProcessor = TerminationParticipantProcessor.getProcessor() ;
+        terminationParticipantProcessor.registerCallback(_id, callback) ;
+        try
+        {
+            TerminationCoordinatorClient.getClient().sendComplete(_terminationCoordinator, addressingProperties, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+        finally
+        {
+            terminationParticipantProcessor.removeCallback(_id) ;
+        }
+
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCompleted())
+            {
+                return ;
+            }
+            else if (callback.receivedFaulted())
+            {
+                throw new FaultedException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if (soapFault != null)
+            {
+                final QName subcode = soapFault.getSubcode() ;
+                if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(subcode))
+                {
+                    throw new UnknownTransactionException() ;
+                }
+            }
+        }
+        throw new SystemException() ;
+    }
+
+    public W3CEndpointReference getEndpoint()
+    {
+        return _terminationCoordinator;
+    }
+    /*
+     * this never gets called
+     */
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.BusinessActivityTerminatorStub_1 [com.arjuna.wst11.stub.BusinessActivityTerminatorStub_1] - Unknown error
+     */
+    /*
+     * this never gets called
+     */
+    public void error ()
+        throws SystemException
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+        final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME,
+                WSTLogger.log_mesg.getString("com.arjuna.wst11.stub.BusinessActivityTerminatorStub_1")) ;
+        try
+        {
+            // the terminaron coordinator endpoint does not expose a soapFault web method as this never gets called
+            // TerminationCoordinatorClient.getClient().sendSoapFault(_terminationCoordinator, addressingProperties, soapFault, new InstanceIdentifier(_id)) ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException() ;
+        }
+    }
+
+    private static class RequestCallback extends TerminationParticipantCallback
+    {
+        /**
+         * The addressing context.
+         */
+        private AddressingProperties addressingProperties ;
+        /**
+         * The arjuna context.
+         */
+        private ArjunaContext arjunaContext ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        /**
+         * The completed notification flag.
+         */
+        private boolean completed ;
+        /**
+         * The cancelled notification flag.
+         */
+        private boolean cancelled ;
+        /**
+         * The closed notification flag.
+         */
+        private boolean closed ;
+        /**
+         * The faulted notification flag.
+         */
+        private boolean faulted ;
+
+        /**
+         * Get the addressing context.
+         * @return The addressing context.
+         */
+        AddressingProperties getAddressingProperties()
+        {
+            return addressingProperties ;
+        }
+
+        /**
+         * Get the arjuna context.
+         * @return The arjuna context.
+         */
+        ArjunaContext getArjunaContextWS()
+        {
+            return arjunaContext ;
+        }
+
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+
+        /**
+         * Did we receive a completed notification?
+         * @return True if completed, false otherwise.
+         */
+        boolean receivedCompleted()
+        {
+            return completed ;
+        }
+
+        /**
+         * Did we receive a cancelled notification?
+         * @return True if cancelled, false otherwise.
+         */
+        boolean receivedCancelled()
+        {
+            return cancelled ;
+        }
+
+        /**
+         * Did we receive a closed notification?
+         * @return True if closed, false otherwise.
+         */
+        boolean receivedClosed()
+        {
+            return closed ;
+        }
+
+        /**
+         * Did we receive a faulted notification?
+         * @return True if faulted, false otherwise.
+         */
+        boolean receivedFaulted()
+        {
+            return faulted ;
+        }
+
+        /**
+         * A completed response.
+         * @param completed The completed notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void completed(final NotificationType completed, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.completed = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A cancelled response.
+         * @param cancelled The cancelled notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void cancelled(final NotificationType cancelled, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.cancelled  = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A closed response.
+         * @param closed The closed notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void closed(final NotificationType closed, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.closed = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A faulted response.
+         * @param faulted The faulted notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void faulted(final NotificationType faulted, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            // TODO - convert wsdl to use NotificationType instead of ExceptionType
+            this.faulted = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            // TODO - pass soap fault to this callback
+            this.soapFault = soapFault ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithCoordinatorCompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithCoordinatorCompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithCoordinatorCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,282 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithCoordinatorCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst11.stub;
+
+import java.io.StringWriter;
+import java.io.StringReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.util.StreamHelper;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.PersistableParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine;
+
+public class BusinessAgreementWithCoordinatorCompletionStub implements BusinessAgreementWithCoordinatorCompletionParticipant, PersistableParticipant
+{
+    private static final QName QNAME_BACCWS_PARTICIPANT = new QName("baccwsParticipant") ;
+    private CoordinatorCompletionCoordinatorEngine participant ;
+
+    public BusinessAgreementWithCoordinatorCompletionStub(final CoordinatorCompletionCoordinatorEngine participant)
+        throws Exception
+    {
+        this.participant = participant ;
+    }
+
+    public synchronized void close ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> no response
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.close() ;
+
+        if (state == State.STATE_CLOSING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void cancel ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> no response
+         * Canceling-Active -> no response
+         * Canceling-Completing -> no response
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.cancel() ;
+
+        if ((state == State.STATE_CANCELING) || (state == State.STATE_CANCELING_ACTIVE) ||
+            (state == State.STATE_CANCELING_COMPLETING))
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void compensate ()
+        throws FaultedException, WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> illegal state
+         * Completing -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> no response
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.compensate() ;
+        if (state == State.STATE_COMPENSATING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state == State.STATE_FAILING_COMPENSATING)
+        {
+            throw new FaultedException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void complete ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Canceling-Active -> illegal state
+         * Canceling-Completing -> canceling
+         * Completing -> no response
+         * Completed -> completed
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> exiting
+         * Ended -> illegal state
+         */
+        final State state = participant.complete() ;
+        if (state == State.STATE_COMPLETED)
+        {
+            return ;
+        }
+        else if ((state == State.STATE_FAILING_COMPENSATING) || (state == State.STATE_CANCELING_COMPLETING) ||
+            (state == State.STATE_EXITING))
+        {
+            throw new SystemException() ;
+        }
+        throw new WrongStateException() ;
+    }
+
+    public String status ()
+        throws SystemException
+    {
+        final State state = participant.getStatus() ;
+        return (state == null ? null : state.getValue().getLocalPart()) ;
+    }
+
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public synchronized void error ()
+        throws SystemException
+    {
+        participant.cancel() ;
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_2 [com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_2] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(participant.getId()) ;
+
+            // n.b. just use toString() for the endpoint -- it uses the writeTo() method which calls a suitable marshaller
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_BACCWS_PARTICIPANT) ;
+            String eprefText = participant.getParticipant().toString();
+            writer.writeCData(eprefText);
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+
+            oos.packString(writer.toString()) ;
+
+            final State state = participant.getStatus();
+            final QName stateName = state.getValue();
+            final String ns = stateName.getNamespaceURI();
+            final String localPart = stateName.getLocalPart();
+            final String prefix = stateName.getPrefix();
+            oos.packString(ns != null ? ns : "");
+            oos.packString(localPart != null ? localPart : "");
+            oos.packString(prefix != null ? prefix : "");
+
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_2", th) ;
+            return false ;
+        }
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_3 [com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_3] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        try
+        {
+            final String id = ios.unpackString();
+            final String eprValue = ios.unpackString();
+
+            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+            StreamHelper.checkNextStartTag(reader, QNAME_BACCWS_PARTICIPANT) ;
+            String eprefText = reader.getText();
+            StreamSource source = new StreamSource(new StringReader(eprefText));
+            final W3CEndpointReference endpointReference = new W3CEndpointReference(source);
+
+            String ns = ios.unpackString();
+            final String localPart = ios.unpackString();
+            String prefix = ios.unpackString();
+            if ("".equals(ns)) {
+                ns = null;
+            }
+            if ("".equals(prefix)) {
+                prefix = null;
+            }
+
+            QName statename = new QName(ns, localPart, prefix);
+            State state = State.toState11(statename);
+
+            participant = new CoordinatorCompletionCoordinatorEngine(id, endpointReference, state);
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub_3", th) ;
+            return false ;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithParticipantCompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithParticipantCompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/BusinessAgreementWithParticipantCompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,243 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (c) 2003, Arjuna Technologies Limited.
+ *
+ * $Id: BusinessAgreementWithParticipantCompletionStub.java,v 1.1.2.2 2004/06/18 15:06:09 nmcl Exp $
+ */
+
+package com.arjuna.wst11.stub;
+
+import java.io.StringWriter;
+import java.io.StringReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.transform.stream.StreamSource;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices11.wsba.State;
+import com.arjuna.webservices11.util.StreamHelper;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.FaultedException;
+import com.arjuna.wst.PersistableParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine;
+
+public class BusinessAgreementWithParticipantCompletionStub implements BusinessAgreementWithParticipantCompletionParticipant, PersistableParticipant
+{
+    private static final QName QNAME_BAPCWS_PARTICIPANT = new QName("bapcwsParticipant") ;
+
+    private ParticipantCompletionCoordinatorEngine participant ;
+
+    public BusinessAgreementWithParticipantCompletionStub(final ParticipantCompletionCoordinatorEngine participant)
+        throws Exception
+    {
+        this.participant = participant ;
+    }
+
+    public synchronized void close ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> no response
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.close() ;
+
+        if (state == State.STATE_CLOSING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void cancel ()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> no response
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> illegal state
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> illegal state
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.cancel() ;
+
+        if (state == State.STATE_CANCELING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public synchronized void compensate ()
+        throws FaultedException, WrongStateException, SystemException
+    {
+        /*
+         * Active -> illegal state
+         * Canceling -> illegal state
+         * Completed -> illegal state
+         * Closing -> illegal state
+         * Compensating -> no answer
+         * Faulting -> illegal state
+         * Faulting-Active -> illegal state
+         * Faulting-Compensating -> fault
+         * Exiting -> illegal state
+         * Ended -> ended
+         */
+        final State state = participant.compensate() ;
+        if (state == State.STATE_COMPENSATING)
+        {
+            throw new SystemException() ;
+        }
+        else if (state == State.STATE_FAILING_COMPENSATING)
+        {
+            throw new FaultedException() ;
+        }
+        else if (state != State.STATE_ENDED)
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public String status ()
+        throws SystemException
+    {
+        final State state = participant.getStatus() ;
+        return (state == null ? null : state.getValue().getLocalPart()) ;
+    }
+
+    public void unknown ()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public synchronized void error ()
+        throws SystemException
+    {
+        participant.cancel() ;
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_2 [com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_2] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(participant.getId()) ;
+
+            // n.b. just use toString() for the endpoint -- it uses the writeTo() method which calls a suitable marshaller
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_BAPCWS_PARTICIPANT) ;
+            String eprefText = participant.getParticipant().toString();
+            writer.writeCData(eprefText);
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+
+            oos.packString(writer.toString()) ;
+
+            final State state = participant.getStatus();
+            final QName stateName = state.getValue();
+            final String ns = stateName.getNamespaceURI();
+            final String localPart = stateName.getLocalPart();
+            final String prefix = stateName.getPrefix();
+            oos.packString(ns != null ? ns : "");
+            oos.packString(localPart != null ? localPart : "");
+            oos.packString(prefix != null ? prefix : "");
+
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_2", th) ;
+            return false ;
+        }
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_3 [com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_3] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        try
+        {
+            final String id = ios.unpackString() ;
+            final String eprValue = ios.unpackString() ;
+
+            // this should successfully reverse the save process
+            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+            StreamHelper.checkNextStartTag(reader, QNAME_BAPCWS_PARTICIPANT) ;
+            String eprefText = reader.getText();
+            StreamSource source = new StreamSource(new StringReader(eprefText));
+            final W3CEndpointReference endpointReference = new W3CEndpointReference(source);
+
+            String ns = ios.unpackString();
+            final String localPart = ios.unpackString();
+            String prefix = ios.unpackString();
+            if ("".equals(ns)) {
+                ns = null;
+            }
+            if ("".equals(prefix)) {
+                prefix = null;
+            }
+
+            QName statename = new QName(ns, localPart, prefix);
+            State state = State.toState11(statename);
+
+            participant = new ParticipantCompletionCoordinatorEngine(id, endpointReference, state);
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub_3", th) ;
+            return false ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/CompletionStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/CompletionStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/CompletionStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,225 @@
+package com.arjuna.wst11.stub;
+
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices11.wsaddr.AddressingHelper;
+import com.arjuna.webservices11.wsarj.ArjunaContext;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsat.client.CompletionCoordinatorClient;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorCallback;
+import com.arjuna.webservices11.wsat.processors.CompletionInitiatorProcessor;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import org.oasis_open.docs.ws_tx.wsat._2006._06.Notification;
+
+import javax.xml.ws.addressing.AddressingProperties;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class CompletionStub implements
+        CompletionCoordinatorParticipant
+{
+    private W3CEndpointReference _completionCoordinator = null;
+    private String _id;
+
+	public CompletionStub(final String id, final W3CEndpointReference completionCoordinator)
+			throws Exception
+	{
+		_completionCoordinator = completionCoordinator;
+		_id = id;
+	}
+
+	public void commit () throws TransactionRolledBackException,
+            UnknownTransactionException, SystemException
+    {
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+
+        final CompletionStub.RequestCallback callback = new CompletionStub.RequestCallback() ;
+        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
+        completionInitiator.registerCallback(_id, callback) ;
+        try
+        {
+            CompletionCoordinatorClient.getClient().sendCommit(_completionCoordinator, addressingProperties, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            th.printStackTrace() ;
+            throw new SystemException() ;
+        }
+        finally
+        {
+            completionInitiator.removeCallback(_id) ;
+        }
+
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedCommitted())
+            {
+                return ;
+            }
+            else if (callback.receivedAborted())
+            {
+                throw new TransactionRolledBackException() ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
+            {
+                throw new UnknownTransactionException();
+            }
+        }
+
+        throw new SystemException() ;
+	}
+
+	public void rollback () throws UnknownTransactionException, SystemException
+	{
+        final AddressingProperties addressingProperties = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ;
+
+        final CompletionStub.RequestCallback callback = new CompletionStub.RequestCallback() ;
+        final CompletionInitiatorProcessor completionInitiator = CompletionInitiatorProcessor.getProcessor() ;
+        completionInitiator.registerCallback(_id, callback) ;
+        try
+        {
+            CompletionCoordinatorClient.getClient().sendRollback(_completionCoordinator, addressingProperties, new InstanceIdentifier(_id)) ;
+            callback.waitUntilTriggered() ;
+        }
+        catch (final Throwable th)
+        {
+            th.printStackTrace() ;
+            throw new SystemException() ;
+        }
+        finally
+        {
+            completionInitiator.removeCallback(_id) ;
+        }
+
+        if (callback.hasTriggered())
+        {
+            if (callback.receivedAborted())
+            {
+                return ;
+            }
+            final SoapFault soapFault = callback.getSoapFault() ;
+            if ((soapFault != null) && ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))
+            {
+                throw new UnknownTransactionException();
+            }
+        }
+
+        throw new SystemException() ;
+	}
+
+    private static class RequestCallback extends CompletionInitiatorCallback
+    {
+        /**
+         * The addressing context.
+         */
+        private AddressingProperties addressingProperties ;
+        /**
+         * The arjuna context.
+         */
+        private ArjunaContext arjunaContext ;
+        /**
+         * The SOAP fault.
+         */
+        private SoapFault soapFault ;
+        /**
+         * The aborted notification flag.
+         */
+        private boolean aborted ;
+        /**
+         * The committed notification flag.
+         */
+        private boolean committed ;
+
+        /**
+         * Get the addressing context.
+         * @return The addressing context.
+         */
+        AddressingProperties getAddressingProperties()
+        {
+            return addressingProperties ;
+        }
+
+        /**
+         * Get the arjuna context.
+         * @return The arjuna context.
+         */
+        ArjunaContext getArjunaContext()
+        {
+            return arjunaContext ;
+        }
+
+        /**
+         * Get the SOAP fault.
+         * @return The SOAP fault.
+         */
+        SoapFault getSoapFault()
+        {
+            return soapFault ;
+        }
+
+        /**
+         * Did we receive a aborted notification?
+         * @return True if aborted, false otherwise.
+         */
+        boolean receivedAborted()
+        {
+            return aborted ;
+        }
+
+        /**
+         * Did we receive a committed notification?
+         * @return True if committed, false otherwise.
+         */
+        boolean receivedCommitted()
+        {
+            return committed ;
+        }
+
+        /**
+         * A aborted response.
+         * @param aborted The aborted notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void aborted(final Notification aborted, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.aborted = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * An committed response.
+         * @param committed The committed notification.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void committed(final Notification committed, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.committed  = true ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+
+        /**
+         * A SOAP fault response.
+         * @param soapFault The SOAP fault.
+         * @param addressingProperties The addressing context.
+         * @param arjunaContext The arjuna context.
+         */
+        public void soapFault(final SoapFault soapFault, final AddressingProperties addressingProperties,
+            final ArjunaContext arjunaContext)
+        {
+            this.soapFault = soapFault ;
+            this.addressingProperties = addressingProperties ;
+            this.arjunaContext = arjunaContext ;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Durable2PCStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Durable2PCStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Durable2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,20 @@
+package com.arjuna.wst11.stub;
+
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst11.stub.ParticipantStub;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class Durable2PCStub extends ParticipantStub implements Durable2PCParticipant
+{
+    // default ctor for crash recovery
+    public Durable2PCStub() throws Exception {
+        super(null, true, null);
+    }
+
+    public Durable2PCStub(final String id, final W3CEndpointReference twoPCParticipant)
+        throws Exception
+    {
+        super(id, true, twoPCParticipant) ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/ParticipantStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/ParticipantStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/ParticipantStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,204 @@
+package com.arjuna.wst11.stub;
+
+import com.arjuna.wst.*;
+import com.arjuna.wst.stub.SystemCommunicationException;
+import com.arjuna.wst11.messaging.engines.CoordinatorEngine;
+import com.arjuna.webservices11.wsat.State;
+import com.arjuna.webservices11.util.StreamHelper;
+import com.arjuna.webservices.soap.SoapUtils;
+import com.arjuna.webservices.logging.WSTLogger;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.ats.arjuna.state.InputObjectState;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.transform.stream.StreamSource;
+import java.io.StringWriter;
+import java.io.StringReader;
+
+public class ParticipantStub implements Participant, PersistableParticipant
+{
+    private static final QName QNAME_TWO_PC_PARTICIPANT = new QName("twoPCParticipant") ;
+    private CoordinatorEngine coordinator ;
+
+    public ParticipantStub(final String id, final boolean durable, final W3CEndpointReference twoPCParticipant)
+        throws Exception
+    {
+        coordinator = new CoordinatorEngine(id, durable, twoPCParticipant) ;
+    }
+
+    public Vote prepare()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - aborted or read only
+         * Active - illegal state
+         * Preparing - no answer
+         * Prepared - illegal state
+         * PreparedSuccess - prepared
+         * Committing - illegal state
+         * Aborting - aborting
+         */
+        final State state = coordinator.prepare() ;
+        if (state == State.STATE_PREPARED_SUCCESS)
+        {
+            return new Prepared() ;
+        }
+        else if (state == State.STATE_ABORTING)
+        {
+            return new Aborted() ;
+        }
+        else if (state == null)
+        {
+            if (coordinator.isReadOnly())
+            {
+                return new ReadOnly() ;
+            }
+            else
+            {
+                return new Aborted() ;
+            }
+        }
+        else if (state == State.STATE_PREPARING)
+        {
+            throw new SystemException() ;
+        }
+        else
+        {
+            throw new WrongStateException() ;
+        }
+    }
+
+    public void commit()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - committed
+         * Active - illegal state
+         * Preparing - illegal state
+         * Prepared - illegal state
+         * PreparedSuccess - illegal state
+         * Committing - no response
+         * Aborting - illegal state
+         */
+        final State state = coordinator.commit() ;
+        if (state != null)
+        {
+            if (state == State.STATE_COMMITTING)
+            {
+                // typically means no response from the remote end.
+                // throw a comm exception to distinguish this case from the
+                // one where the remote end itself threw a SystemException.
+                throw new SystemCommunicationException();
+            }
+            else
+            {
+                throw new WrongStateException() ;
+            }
+        }
+    }
+
+    public void rollback()
+        throws WrongStateException, SystemException
+    {
+        /*
+         * null - aborted
+         * Active - illegal state
+         * Preparing - illegal state
+         * Prepared - illegal state
+         * PreparedSuccess - illegal state
+         * Committing - illegal state
+         * Aborting - no response
+         */
+        final State state = coordinator.rollback() ;
+        if (state != null)
+        {
+            if (state == State.STATE_ABORTING)
+            {
+                throw new SystemException() ;
+            }
+            else
+            {
+                throw new WrongStateException() ;
+            }
+        }
+    }
+
+    public void unknown()
+        throws SystemException
+    {
+        error() ;
+    }
+
+    public void error()
+        throws SystemException
+    {
+        try
+        {
+            rollback() ;
+        }
+        catch (final WrongStateException wse) {} // ignore
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.ParticipantStub_1 [com.arjuna.wst11.stub.ParticipantStub_1] - Error persisting participant state
+     */
+    public boolean saveState(final OutputObjectState oos)
+    {
+        try
+        {
+            oos.packString(coordinator.getId()) ;
+            oos.packBoolean(coordinator.isDurable()) ;
+
+            // n.b. just use toString() for the endpoint -- it uses the writeTo() method which calls a suitable marshaller
+            final StringWriter sw = new StringWriter() ;
+            final XMLStreamWriter writer = SoapUtils.getXMLStreamWriter(sw) ;
+            StreamHelper.writeStartElement(writer, QNAME_TWO_PC_PARTICIPANT) ;
+            String eprefText = coordinator.getParticipant().toString();
+            writer.writeCData(eprefText);
+            StreamHelper.writeEndElement(writer, null, null) ;
+            writer.close() ;
+            sw.close();
+
+            String tmp = writer.toString();
+            String swString = sw.toString();
+            oos.packString(swString) ;
+
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.ParticipantStub_1", th) ;
+            return false ;
+        }
+    }
+
+    /**
+     * @message com.arjuna.wst11.stub.ParticipantStub_2 [com.arjuna.wst11.stub.ParticipantStub_2] - Error restoring participant state
+     */
+    public boolean restoreState(final InputObjectState ios)
+    {
+        try
+        {
+            final String id = ios.unpackString() ;
+            final boolean durable = ios.unpackBoolean() ;
+            final String eprValue = ios.unpackString() ;
+
+            // this should successfully reverse the save process
+            final XMLStreamReader reader = SoapUtils.getXMLStreamReader(new StringReader(eprValue)) ;
+            StreamHelper.checkNextStartTag(reader, QNAME_TWO_PC_PARTICIPANT) ;
+            String eprefText = reader.getText();
+            StreamSource source = new StreamSource(new StringReader(eprefText));
+            final W3CEndpointReference endpointReference = new W3CEndpointReference(source);
+            coordinator = new CoordinatorEngine(id, durable, endpointReference, State.STATE_PREPARED_SUCCESS) ;
+            return true ;
+        }
+        catch (final Throwable th)
+        {
+            WSTLogger.arjLoggerI18N.error("com.arjuna.wst11.stub.ParticipantStub_2", th) ;
+            return false ;
+        }
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Volatile2PCStub.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Volatile2PCStub.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/Volatile2PCStub.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,15 @@
+package com.arjuna.wst11.stub;
+
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst11.stub.ParticipantStub;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+public class Volatile2PCStub extends ParticipantStub implements Volatile2PCParticipant
+{
+    public Volatile2PCStub(final String id, final W3CEndpointReference twoPCParticipant)
+        throws Exception
+    {
+        super(id, false, twoPCParticipant) ;
+    }
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ATAssertion.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ATAssertion.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ATAssertion.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,97 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+    "any"
+})
+ at XmlRootElement(name = "ATAssertion")
+public class ATAssertion {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Object }
+     * {@link Element }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "CompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface CompletionCoordinatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
+    @Oneway
+    public void commitOperation(
+        @WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "RollbackOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback")
+    @Oneway
+    public void rollbackOperation(
+        @WebParam(name = "Rollback", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionCoordinatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "CompletionCoordinatorService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", wsdlLocation = "wsdl/wsat-completion-coordinator-binding.wsdl")
+public class CompletionCoordinatorService
+    extends Service21
+{
+
+    private final static URL COMPLETIONCOORDINATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionCoordinatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsat-completion-coordinator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsat-completion-coordinator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        COMPLETIONCOORDINATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public CompletionCoordinatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public CompletionCoordinatorService() {
+        super(COMPLETIONCOORDINATORSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CompletionCoordinatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns CompletionCoordinatorPortType
+     */
+    @WebEndpoint(name = "CompletionCoordinatorPortType")
+    public CompletionCoordinatorPortType getCompletionCoordinatorPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CompletionCoordinatorPortType"), CompletionCoordinatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "CompletionInitiatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface CompletionInitiatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
+    @Oneway
+    public void committedOperation(
+        @WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "AbortedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted")
+    @Oneway
+    public void abortedOperation(
+        @WebParam(name = "Aborted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CompletionInitiatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "CompletionInitiatorService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", wsdlLocation = "wsdl/wsat-completion-initiator-binding.wsdl")
+public class CompletionInitiatorService
+    extends Service21
+{
+
+    private final static URL COMPLETIONINITIATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionInitiatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsat._2006._06.CompletionInitiatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsat-completion-initiator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsat-completion-initiator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        COMPLETIONINITIATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public CompletionInitiatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public CompletionInitiatorService() {
+        super(COMPLETIONINITIATORSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CompletionInitiatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns CompletionInitiatorPortType
+     */
+    @WebEndpoint(name = "CompletionInitiatorPortType")
+    public CompletionInitiatorPortType getCompletionInitiatorPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CompletionInitiatorPortType"), CompletionInitiatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,62 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "CoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface CoordinatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "PreparedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
+    @Oneway
+    public void preparedOperation(
+        @WebParam(name = "Prepared", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "AbortedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Aborted")
+    @Oneway
+    public void abortedOperation(
+        @WebParam(name = "Aborted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ReadOnlyOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
+    @Oneway
+    public void readOnlyOperation(
+        @WebParam(name = "ReadOnly", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
+    @Oneway
+    public void committedOperation(
+        @WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/CoordinatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "CoordinatorService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", wsdlLocation = "wsdl/wsat-coordinator-binding.wsdl")
+public class CoordinatorService
+    extends Service21
+{
+
+    private final static URL COORDINATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsat._2006._06.CoordinatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsat-coordinator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsat-coordinator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        COORDINATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public CoordinatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public CoordinatorService() {
+        super(COORDINATORSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CoordinatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns CoordinatorPortType
+     */
+    @WebEndpoint(name = "CoordinatorPortType")
+    public CoordinatorPortType getCoordinatorPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "CoordinatorPortType"), CoordinatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/Notification.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/Notification.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/Notification.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,95 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for Notification complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="Notification">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "Notification", propOrder = {
+    "any"
+})
+public class Notification {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Object }
+     * {@link Element }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ObjectFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ObjectFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ObjectFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,121 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.oasis_open.docs.ws_tx.wsat._2006._06 package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Aborted_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Aborted");
+    private final static QName _Commit_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Commit");
+    private final static QName _ReadOnly_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "ReadOnly");
+    private final static QName _Committed_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Committed");
+    private final static QName _Rollback_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Rollback");
+    private final static QName _Prepare_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Prepare");
+    private final static QName _Prepared_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "Prepared");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.oasis_open.docs.ws_tx.wsat._2006._06
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link ATAssertion }
+     * 
+     */
+    public ATAssertion createATAssertion() {
+        return new ATAssertion();
+    }
+
+    /**
+     * Create an instance of {@link Notification }
+     * 
+     */
+    public Notification createNotification() {
+        return new Notification();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Aborted")
+    public JAXBElement<Notification> createAborted(Notification value) {
+        return new JAXBElement<Notification>(_Aborted_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Commit")
+    public JAXBElement<Notification> createCommit(Notification value) {
+        return new JAXBElement<Notification>(_Commit_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "ReadOnly")
+    public JAXBElement<Notification> createReadOnly(Notification value) {
+        return new JAXBElement<Notification>(_ReadOnly_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Committed")
+    public JAXBElement<Notification> createCommitted(Notification value) {
+        return new JAXBElement<Notification>(_Committed_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Rollback")
+    public JAXBElement<Notification> createRollback(Notification value) {
+        return new JAXBElement<Notification>(_Rollback_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Prepare")
+    public JAXBElement<Notification> createPrepare(Notification value) {
+        return new JAXBElement<Notification>(_Prepare_QNAME, Notification.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link Notification }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", name = "Prepared")
+    public JAXBElement<Notification> createPrepared(Notification value) {
+        return new JAXBElement<Notification>(_Prepared_QNAME, Notification.class, null, value);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,52 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "ParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface ParticipantPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "PrepareOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepare")
+    @Oneway
+    public void prepareOperation(
+        @WebParam(name = "Prepare", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CommitOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Commit")
+    @Oneway
+    public void commitOperation(
+        @WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "RollbackOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Rollback")
+    @Oneway
+    public void rollbackOperation(
+        @WebParam(name = "Rollback", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
+        Notification parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/ParticipantService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsat._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "ParticipantService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", wsdlLocation = "wsdl/wsat-participant-binding.wsdl")
+public class ParticipantService
+    extends Service21
+{
+
+    private final static URL PARTICIPANTSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsat._2006._06.ParticipantService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsat-participant-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsat-participant-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        PARTICIPANTSERVICE_WSDL_LOCATION = url;
+    }
+
+    public ParticipantService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public ParticipantService() {
+        super(PARTICIPANTSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "ParticipantService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns ParticipantPortType
+     */
+    @WebEndpoint(name = "ParticipantPortType")
+    public ParticipantPortType getParticipantPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsat/2006/06", "ParticipantPortType"), ParticipantPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/package-info.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/package-info.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsat/_2006/_06/package-info.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,2 @@
+ at javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06")
+package org.oasis_open.docs.ws_tx.wsat._2006._06;

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAAtomicOutcomeAssertion.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAAtomicOutcomeAssertion.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAAtomicOutcomeAssertion.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,97 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+    "any"
+})
+ at XmlRootElement(name = "BAAtomicOutcomeAssertion")
+public class BAAtomicOutcomeAssertion {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAMixedOutcomeAssertion.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAMixedOutcomeAssertion.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BAMixedOutcomeAssertion.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,97 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for anonymous complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType>
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "", propOrder = {
+    "any"
+})
+ at XmlRootElement(name = "BAMixedOutcomeAssertion")
+public class BAMixedOutcomeAssertion {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,112 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface BusinessAgreementWithCoordinatorCompletionCoordinatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
+    @Oneway
+    public void failOperation(
+        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        ExceptionType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensatedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated")
+    @Oneway
+    public void compensatedOperation(
+        @WebParam(name = "Compensated", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CanceledOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled")
+    @Oneway
+    public void canceledOperation(
+        @WebParam(name = "Canceled", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit")
+    @Oneway
+    public void exitOperation(
+        @WebParam(name = "Exit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CannotComplete", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete")
+    @Oneway
+    public void cannotComplete(
+        @WebParam(name = "CannotComplete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionCoordinatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "BusinessAgreementWithCoordinatorCompletionCoordinatorService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", wsdlLocation = "wsdl/wsba-coordinator-completion-coordinator-binding.wsdl")
+public class BusinessAgreementWithCoordinatorCompletionCoordinatorService
+    extends Service21
+{
+
+    private final static URL BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsba-coordinator-completion-coordinator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsba-coordinator-completion-coordinator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BusinessAgreementWithCoordinatorCompletionCoordinatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BusinessAgreementWithCoordinatorCompletionCoordinatorService() {
+        super(BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithCoordinatorCompletionCoordinatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns BusinessAgreementWithCoordinatorCompletionCoordinatorPortType
+     */
+    @WebEndpoint(name = "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType")
+    public BusinessAgreementWithCoordinatorCompletionCoordinatorPortType getBusinessAgreementWithCoordinatorCompletionCoordinatorPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithCoordinatorCompletionCoordinatorPortType"), BusinessAgreementWithCoordinatorCompletionCoordinatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,112 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "BusinessAgreementWithCoordinatorCompletionParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface BusinessAgreementWithCoordinatorCompletionParticipantPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompleteOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/mplete")
+    @Oneway
+    public void completeOperation(
+        @WebParam(name = "Complete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensateOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void compensateOperation(
+        @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed")
+    @Oneway
+    public void failedOperation(
+        @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited")
+    @Oneway
+    public void exitedOperation(
+        @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "NotCompleted", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted")
+    @Oneway
+    public void notCompleted(
+        @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithCoordinatorCompletionParticipantService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "BusinessAgreementWithCoordinatorCompletionParticipantService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", wsdlLocation = "wsdl/wsba-coordinator-completion-participant-binding.wsdl")
+public class BusinessAgreementWithCoordinatorCompletionParticipantService
+    extends Service21
+{
+
+    private final static URL BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsba-coordinator-completion-participant-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsba-coordinator-completion-participant-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BusinessAgreementWithCoordinatorCompletionParticipantService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BusinessAgreementWithCoordinatorCompletionParticipantService() {
+        super(BUSINESSAGREEMENTWITHCOORDINATORCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithCoordinatorCompletionParticipantService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns BusinessAgreementWithCoordinatorCompletionParticipantPortType
+     */
+    @WebEndpoint(name = "BusinessAgreementWithCoordinatorCompletionParticipantPortType")
+    public BusinessAgreementWithCoordinatorCompletionParticipantPortType getBusinessAgreementWithCoordinatorCompletionParticipantPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithCoordinatorCompletionParticipantPortType"), BusinessAgreementWithCoordinatorCompletionParticipantPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,112 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "BusinessAgreementWithParticipantCompletionCoordinatorPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface BusinessAgreementWithParticipantCompletionCoordinatorPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompletedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Completed")
+    @Oneway
+    public void completedOperation(
+        @WebParam(name = "Completed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
+    @Oneway
+    public void failOperation(
+        @WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        ExceptionType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensatedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensated")
+    @Oneway
+    public void compensatedOperation(
+        @WebParam(name = "Compensated", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ClosedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Closed")
+    @Oneway
+    public void closedOperation(
+        @WebParam(name = "Closed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CanceledOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Canceled")
+    @Oneway
+    public void canceledOperation(
+        @WebParam(name = "Canceled", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exit")
+    @Oneway
+    public void exitOperation(
+        @WebParam(name = "Exit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CannotComplete", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/CannotComplete")
+    @Oneway
+    public void cannotComplete(
+        @WebParam(name = "CannotComplete", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionCoordinatorService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "BusinessAgreementWithParticipantCompletionCoordinatorService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", wsdlLocation = "wsdl/wsba-participant-completion-coordinator-binding.wsdl")
+public class BusinessAgreementWithParticipantCompletionCoordinatorService
+    extends Service21
+{
+
+    private final static URL BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsba-participant-completion-coordinator-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsba-participant-completion-coordinator-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BusinessAgreementWithParticipantCompletionCoordinatorService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BusinessAgreementWithParticipantCompletionCoordinatorService() {
+        super(BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONCOORDINATORSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithParticipantCompletionCoordinatorService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns BusinessAgreementWithParticipantCompletionCoordinatorPortType
+     */
+    @WebEndpoint(name = "BusinessAgreementWithParticipantCompletionCoordinatorPortType")
+    public BusinessAgreementWithParticipantCompletionCoordinatorPortType getBusinessAgreementWithParticipantCompletionCoordinatorPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithParticipantCompletionCoordinatorPortType"), BusinessAgreementWithParticipantCompletionCoordinatorPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantPortType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantPortType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantPortType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,102 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebService(name = "BusinessAgreementWithParticipantCompletionParticipantPortType", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06")
+ at SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface BusinessAgreementWithParticipantCompletionParticipantPortType {
+
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CloseOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Close")
+    @Oneway
+    public void closeOperation(
+        @WebParam(name = "Close", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CancelOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Cancel")
+    @Oneway
+    public void cancelOperation(
+        @WebParam(name = "Cancel", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "CompensateOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Compensate")
+    @Oneway
+    public void compensateOperation(
+        @WebParam(name = "Compensate", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "FailedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Failed")
+    @Oneway
+    public void failedOperation(
+        @WebParam(name = "Failed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "ExitedOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Exited")
+    @Oneway
+    public void exitedOperation(
+        @WebParam(name = "Exited", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "NotCompleted", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/NotCompleted")
+    @Oneway
+    public void notCompleted(
+        @WebParam(name = "NotCompleted", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "GetStatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/GetStatus")
+    @Oneway
+    public void getStatusOperation(
+        @WebParam(name = "GetStatus", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        NotificationType parameters);
+
+    /**
+     * 
+     * @param parameters
+     */
+    @WebMethod(operationName = "StatusOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Status")
+    @Oneway
+    public void statusOperation(
+        @WebParam(name = "Status", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters")
+        StatusType parameters);
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantService.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantService.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/BusinessAgreementWithParticipantCompletionParticipantService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Logger;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.Service21;
+
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.1.2-hudson-182-RC1
+ * Generated source version: 2.0
+ * 
+ */
+ at WebServiceClient(name = "BusinessAgreementWithParticipantCompletionParticipantService", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", wsdlLocation = "wsdl/wsba-participant-completion-participant-binding.wsdl")
+public class BusinessAgreementWithParticipantCompletionParticipantService
+    extends Service21
+{
+
+    private final static URL BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION;
+    private final static Logger logger = Logger.getLogger(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantService.class.getName());
+
+    static {
+        URL url = null;
+        try {
+            URL baseUrl;
+            baseUrl = org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantService.class.getResource("");
+            url = new URL(baseUrl, "wsdl/wsba-participant-completion-participant-binding.wsdl");
+        } catch (MalformedURLException e) {
+            logger.warning("Failed to create URL for the wsdl Location: 'wsdl/wsba-participant-completion-participant-binding.wsdl', retrying as a local file");
+            logger.warning(e.getMessage());
+        }
+        BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION = url;
+    }
+
+    public BusinessAgreementWithParticipantCompletionParticipantService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    public BusinessAgreementWithParticipantCompletionParticipantService() {
+        super(BUSINESSAGREEMENTWITHPARTICIPANTCOMPLETIONPARTICIPANTSERVICE_WSDL_LOCATION, new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithParticipantCompletionParticipantService"));
+    }
+
+    /**
+     * 
+     * @return
+     *     returns BusinessAgreementWithParticipantCompletionParticipantPortType
+     */
+    @WebEndpoint(name = "BusinessAgreementWithParticipantCompletionParticipantPortType")
+    public BusinessAgreementWithParticipantCompletionParticipantPortType getBusinessAgreementWithParticipantCompletionParticipantPortType() {
+        return super.getPort(new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "BusinessAgreementWithParticipantCompletionParticipantPortType"), BusinessAgreementWithParticipantCompletionParticipantPortType.class);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ExceptionType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ExceptionType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ExceptionType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,124 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for ExceptionType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="ExceptionType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="ExceptionIdentifier" type="{http://www.w3.org/2001/XMLSchema}QName"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "ExceptionType", propOrder = {
+    "exceptionIdentifier",
+    "any"
+})
+public class ExceptionType {
+
+    @XmlElement(name = "ExceptionIdentifier", required = true)
+    protected QName exceptionIdentifier;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the exceptionIdentifier property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link QName }
+     *     
+     */
+    public QName getExceptionIdentifier() {
+        return exceptionIdentifier;
+    }
+
+    /**
+     * Sets the value of the exceptionIdentifier property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link QName }
+     *     
+     */
+    public void setExceptionIdentifier(QName value) {
+        this.exceptionIdentifier = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/NotificationType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/NotificationType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/NotificationType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,95 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for NotificationType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="NotificationType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "NotificationType", propOrder = {
+    "any"
+})
+public class NotificationType {
+
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ObjectFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ObjectFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/ObjectFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,235 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+
+/**
+ * This object contains factory methods for each 
+ * Java content interface and Java element interface 
+ * generated in the org.oasis_open.docs.ws_tx.wsba._2006._06 package. 
+ * <p>An ObjectFactory allows you to programatically 
+ * construct new instances of the Java representation 
+ * for XML content. The Java representation of XML 
+ * content can consist of schema derived interfaces 
+ * and classes representing the binding of schema 
+ * type definitions, element declarations and model 
+ * groups.  Factory methods for each of these are 
+ * provided in this class.
+ * 
+ */
+ at XmlRegistry
+public class ObjectFactory {
+
+    private final static QName _Canceled_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Canceled");
+    private final static QName _Cancel_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Cancel");
+    private final static QName _Status_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Status");
+    private final static QName _Close_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Close");
+    private final static QName _Exited_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Exited");
+    private final static QName _Complete_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Complete");
+    private final static QName _Failed_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Failed");
+    private final static QName _Compensate_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Compensate");
+    private final static QName _CannotComplete_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "CannotComplete");
+    private final static QName _Completed_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Completed");
+    private final static QName _Closed_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Closed");
+    private final static QName _Compensated_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Compensated");
+    private final static QName _Exit_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Exit");
+    private final static QName _Fail_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "Fail");
+    private final static QName _GetStatus_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "GetStatus");
+    private final static QName _NotCompleted_QNAME = new QName("http://docs.oasis-open.org/ws-tx/wsba/2006/06", "NotCompleted");
+
+    /**
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.oasis_open.docs.ws_tx.wsba._2006._06
+     * 
+     */
+    public ObjectFactory() {
+    }
+
+    /**
+     * Create an instance of {@link StatusType }
+     * 
+     */
+    public StatusType createStatusType() {
+        return new StatusType();
+    }
+
+    /**
+     * Create an instance of {@link BAAtomicOutcomeAssertion }
+     * 
+     */
+    public BAAtomicOutcomeAssertion createBAAtomicOutcomeAssertion() {
+        return new BAAtomicOutcomeAssertion();
+    }
+
+    /**
+     * Create an instance of {@link ExceptionType }
+     * 
+     */
+    public ExceptionType createExceptionType() {
+        return new ExceptionType();
+    }
+
+    /**
+     * Create an instance of {@link BAMixedOutcomeAssertion }
+     * 
+     */
+    public BAMixedOutcomeAssertion createBAMixedOutcomeAssertion() {
+        return new BAMixedOutcomeAssertion();
+    }
+
+    /**
+     * Create an instance of {@link NotificationType }
+     * 
+     */
+    public NotificationType createNotificationType() {
+        return new NotificationType();
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Canceled")
+    public JAXBElement<NotificationType> createCanceled(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Canceled_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Cancel")
+    public JAXBElement<NotificationType> createCancel(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Cancel_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link StatusType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Status")
+    public JAXBElement<StatusType> createStatus(StatusType value) {
+        return new JAXBElement<StatusType>(_Status_QNAME, StatusType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Close")
+    public JAXBElement<NotificationType> createClose(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Close_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Exited")
+    public JAXBElement<NotificationType> createExited(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Exited_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Complete")
+    public JAXBElement<NotificationType> createComplete(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Complete_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Failed")
+    public JAXBElement<NotificationType> createFailed(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Failed_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Compensate")
+    public JAXBElement<NotificationType> createCompensate(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Compensate_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "CannotComplete")
+    public JAXBElement<NotificationType> createCannotComplete(NotificationType value) {
+        return new JAXBElement<NotificationType>(_CannotComplete_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Completed")
+    public JAXBElement<NotificationType> createCompleted(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Completed_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Closed")
+    public JAXBElement<NotificationType> createClosed(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Closed_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Compensated")
+    public JAXBElement<NotificationType> createCompensated(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Compensated_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Exit")
+    public JAXBElement<NotificationType> createExit(NotificationType value) {
+        return new JAXBElement<NotificationType>(_Exit_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link ExceptionType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "Fail")
+    public JAXBElement<ExceptionType> createFail(ExceptionType value) {
+        return new JAXBElement<ExceptionType>(_Fail_QNAME, ExceptionType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "GetStatus")
+    public JAXBElement<NotificationType> createGetStatus(NotificationType value) {
+        return new JAXBElement<NotificationType>(_GetStatus_QNAME, NotificationType.class, null, value);
+    }
+
+    /**
+     * Create an instance of {@link JAXBElement }{@code <}{@link NotificationType }{@code >}}
+     * 
+     */
+    @XmlElementDecl(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", name = "NotCompleted")
+    public JAXBElement<NotificationType> createNotCompleted(NotificationType value) {
+        return new JAXBElement<NotificationType>(_NotCompleted_QNAME, NotificationType.class, null, value);
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/StatusType.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/StatusType.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/StatusType.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,124 @@
+
+package org.oasis_open.docs.ws_tx.wsba._2006._06;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+import org.w3c.dom.Element;
+
+
+/**
+ * <p>Java class for StatusType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="StatusType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="State" type="{http://docs.oasis-open.org/ws-tx/wsba/2006/06}StateType"/>
+ *         &lt;any/>
+ *       &lt;/sequence>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name = "StatusType", propOrder = {
+    "state",
+    "any"
+})
+public class StatusType {
+
+    @XmlElement(name = "State", required = true)
+    protected QName state;
+    @XmlAnyElement(lax = true)
+    protected List<Object> any;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the state property.
+     * 
+     * @return
+     *     possible object is
+     *     {@link QName }
+     *     
+     */
+    public QName getState() {
+        return state;
+    }
+
+    /**
+     * Sets the value of the state property.
+     * 
+     * @param value
+     *     allowed object is
+     *     {@link QName }
+     *     
+     */
+    public void setState(QName value) {
+        this.state = value;
+    }
+
+    /**
+     * Gets the value of the any property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the any property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getAny().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link Element }
+     * {@link Object }
+     * 
+     * 
+     */
+    public List<Object> getAny() {
+        if (any == null) {
+            any = new ArrayList<Object>();
+        }
+        return this.any;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Added: labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/package-info.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/package-info.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src11/org/oasis_open/docs/ws_tx/wsba/_2006/_06/package-info.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,2 @@
+ at javax.xml.bind.annotation.XmlSchema(namespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.oasis_open.docs.ws_tx.wsba._2006._06;

Modified: labs/jbosstm/trunk/XTS/WSCF/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -37,9 +37,13 @@
 
 	<!-- Set internal property defaults -->
 	<!-- Path names -->
-	<property name="com.arjuna.mwlabs.wscf.src" value="classes"/>
+    <property name="com.arjuna.mwlabs.wscf.src" value="classes"/>
+    <property name="com.arjuna.mwlabs.wscf.src10" value="classes10"/>
+    <property name="com.arjuna.mwlabs.wscf.src11" value="classes11"/>
 	<property name="com.arjuna.mwlabs.wscf.dest.root" value="build"/>
-	<property name="com.arjuna.mwlabs.wscf.dest" value="build/classes"/>
+    <property name="com.arjuna.mwlabs.wscf.dest" value="build/classes"/>
+    <property name="com.arjuna.mwlabs.wscf.dest10" value="build/classes10/classes"/>
+    <property name="com.arjuna.mwlabs.wscf.dest11" value="build/classes11/classes"/>
 	<property name="com.arjuna.mwlabs.wscf.jar.dest" value="build/lib"/>
 	<property name="com.arjuna.mwlabs.wscf.war.dest" value="build/webapps"/>
 	<property name="com.arjuna.mwlabs.wscf.htdocs.dest" value="build/htdocs"/>
@@ -66,10 +70,12 @@
     <property name="jta.lib.jars" value="jbossjta.jar"/>
     <property name="jta.ext.jars" value="jbossts-common.jar"/>
     <property name="jta.ext.compile.jars" value="commons-logging-1.1.jar jta-1_1-classes.zip"/>
-    <property name="xts.ext.compile.jars" value="servlet.jar stax-api-1.0.jar"/>
+    <property name="xts.ext.compile.jars" value="jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jboss-saaj.jar"/>
 
     <property name="wsas.libs" value="wsas.jar"/>
     <property name="wsc.libs" value="ws-c.jar"/>
+    <property name="wsc10.libs" value="ws-c10.jar"/>
+    <property name="wsc11.libs" value="ws-c11.jar"/>
 
     <property name="com.arjuna.mwlabs.wscf.resourcebundle"
 	      value="wscf_msg_en_US.properties"/>
@@ -114,7 +120,9 @@
 			<format property="com.arjuna.mw.wscf.date" pattern="yyyy/mm/dd hh:mm aa"/>
 		</tstamp>
 		<!-- Make the destination directory -->
-		<mkdir dir="${com.arjuna.mwlabs.wscf.dest}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wscf.dest}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wscf.dest10}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wscf.dest11}"/>
 		<mkdir dir="${com.arjuna.mwlabs.wscf.war.dest}"/>
 	</target>
 
@@ -123,11 +131,40 @@
 	depends="com.arjuna.mwlabs.wscf.compile,
 		com.arjuna.mw.wscf.htdocs, com.arjuna.mwlabs.wscf.generateresourcebundle"/>
 
-	<target name="com.arjuna.mwlabs.wscf.compile" depends="com.arjuna.mwlabs.wscf.init">
-		<echo message="Compiling module"/>
+    <target name="com.arjuna.mwlabs.wscf.compile" depends="com.arjuna.mwlabs.wscf.compile10, com.arjuna.mwlabs.wscf.compile11"/>
+    <target name="com.arjuna.mwlabs.wscf.compile11" depends="com.arjuna.mwlabs.wscf.compile-generic">
+		<echo message="Compiling module 1.1 code"/>
+		<javac srcdir="${com.arjuna.mwlabs.wscf.src11}"
+                       destdir="${com.arjuna.mwlabs.wscf.dest11}"
+                       debug="on">
+			<classpath>
+                <path>
+                    <pathelement path="${com.arjuna.mwlabs.wscf.dest}"/>
+                    <pathelement path="${com.arjuna.mwlabs.wsc.jar.dest}/${wsc11.libs}"/>
+                </path>
+				<path refid="com.arjuna.mwlabs.wscf.lib.classpath"/>
+			</classpath>
+		</javac>
+	</target>
+    <target name="com.arjuna.mwlabs.wscf.compile10" depends="com.arjuna.mwlabs.wscf.compile-generic">
+		<echo message="Compiling module 1.0 code"/>
+		<javac srcdir="${com.arjuna.mwlabs.wscf.src10}"
+                       destdir="${com.arjuna.mwlabs.wscf.dest10}"
+                       debug="on">
+			<classpath>
+                <path>
+                    <pathelement path="${com.arjuna.mwlabs.wscf.dest}"/>
+                    <pathelement path="${com.arjuna.mwlabs.wsc.jar.dest}/${wsc10.libs}"/>
+                </path>
+				<path refid="com.arjuna.mwlabs.wscf.lib.classpath"/>
+			</classpath>
+		</javac>
+	</target>
+    <target name="com.arjuna.mwlabs.wscf.compile-generic" depends="com.arjuna.mwlabs.wscf.init">
+		<echo message="Compiling module generic code"/>
 		<javac srcdir="${com.arjuna.mwlabs.wscf.src}"
                        destdir="${com.arjuna.mwlabs.wscf.dest}"
-                       debug="yes">
+                       debug="on">
 			<classpath>
 				<path refid="com.arjuna.mwlabs.wscf.lib.classpath"/>
 			</classpath>
@@ -144,37 +181,71 @@
 	value="com.arjuna.mw.*"/>
 
 	<target name="com.arjuna.mw.wscf.war" depends="com.arjuna.mw.wscf.jar">
-	  <war warfile="${com.arjuna.mwlabs.wscf.war.dest}/${com.arjuna.mwlabs.ts.modulename}.war" webxml="xml/wscf_web-app.xml">
+	  <war warfile="${com.arjuna.mwlabs.wscf.war.dest}/${com.arjuna.mwlabs.ts.modulename}10.war" webxml="xml/wscf_web-app.xml">
         <manifest>
-            <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
+            <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.10jar"/>
         </manifest>
       </war>
+        <war warfile="${com.arjuna.mwlabs.wscf.war.dest}/${com.arjuna.mwlabs.ts.modulename}11.war" webxml="xml/wscf11_web-app.xml">
+          <manifest>
+              <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}11.jar"/>
+          </manifest>
+        </war>
 	</target>
 
 	<!-- Jar targets -->
-	<target name="com.arjuna.mw.wscf.jar" depends="com.arjuna.mw.wscf.compile">
-		<echo message="Building jar file"/>
-		<mkdir dir="${com.arjuna.mwlabs.wscf.jar.dest}"/>
+    <target name="com.arjuna.mw.wscf.jar" depends="com.arjuna.mw.wscf.jar11, com.arjuna.mw.wscf.jar10"/>
 
-		<copy file="xml/ArjunaCoreHLS.xml"
-		tofile="${com.arjuna.mwlabs.wscf.dest}/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/ArjunaCoreHLS.xml"/>
-		<copy file="xml/JTAHLS.xml"
-		tofile="${com.arjuna.mwlabs.wscf.dest}/com/arjuna/mwlabs/wscf/model/as/coordinator/jta/JTAHLS.xml"/>
-		<copy file="xml/TwoPhaseHLSImple.xml"
-		tofile="${com.arjuna.mwlabs.wscf.dest}/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.xml"/>
-		<copy file="xml/SagasHLSImple.xml"
-		tofile="${com.arjuna.mwlabs.wscf.dest}/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.xml"/>
-		<copy file="xml/JTAHLSImple.xml"
-		tofile="${com.arjuna.mwlabs.wscf.dest}/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.xml"/>
+    <target name="com.arjuna.mw.wscf.jar11" depends="com.arjuna.mw.wscf.jar-generic">
+        <copy file="xml/ArjunaCoreHLS.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest11}/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/ArjunaCoreHLS.xml"/>
+        <copy file="xml/JTAHLS.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest11}/com/arjuna/mwlabs/wscf/model/as/coordinator/jta/JTAHLS.xml"/>
+        <copy file="xml/TwoPhase11HLSImple.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest11}/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.xml"/>
+        <copy file="xml/Sagas11HLSImple.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest11}/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.xml"/>
 
-		<jar jarfile="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"
+        <jar jarfile="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"
+            basedir="${com.arjuna.mwlabs.wscf.dest11}">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
+            </manifest>
+        </jar>
+    </target>
+
+    <target name="com.arjuna.mw.wscf.jar10" depends="com.arjuna.mw.wscf.jar-generic">
+        <copy file="xml/ArjunaCoreHLS.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest10}/com/arjuna/mwlabs/wscf/model/as/coordinator/arjunacore/ArjunaCoreHLS.xml"/>
+        <copy file="xml/JTAHLS.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest10}/com/arjuna/mwlabs/wscf/model/as/coordinator/jta/JTAHLS.xml"/>
+        <copy file="xml/TwoPhaseHLSImple.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest10}/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.xml"/>
+        <copy file="xml/SagasHLSImple.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest10}/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.xml"/>
+        <copy file="xml/JTAHLSImple.xml"
+        tofile="${com.arjuna.mwlabs.wscf.dest10}/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.xml"/>
+
+        <jar jarfile="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar"
+            basedir="${com.arjuna.mwlabs.wscf.dest10}">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
+            </manifest>
+        </jar>
+    </target>
+
+    <target name="com.arjuna.mw.wscf.jar-generic" depends="com.arjuna.mw.wscf.compile">
+        <echo message="Building jar files"/>
+        <mkdir dir="${com.arjuna.mwlabs.wscf.jar.dest}"/>
+        <jar jarfile="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"
             basedir="${com.arjuna.mwlabs.wscf.dest}">
             <manifest>
-                <attribute name="Class-Path" value="${wsas.libs} ${wsc.libs} ${jta.lib.jars} ${jta.ext.jars} config.jar"/>
+                <attribute name="Class-Path" value="${wsas.libs} ${wsc.libs} config.jar config11.jar"/>
             </manifest>
         </jar>
-	</target>
+    </target>
 
+
 	<target name="com.arjuna.mw.wscf.htdocs"
 				depends="com.arjuna.mwlabs.wscf.init">
 		<echo message="Building htdocs "/>
@@ -201,13 +272,24 @@
 
             <classpath-builder filename="${com.arjuna.mwlabs.classpathbuilderfilename}" inproperty="build.classpath"/>
 
-            <javadoc    sourcepath="${com.arjuna.mwlabs.wscf.src}"
-                        packagenames="com.arjuna.*"
+            <javadoc    packagenames="com.arjuna.*"
                         failonerror="yes"
                         private="yes"
                         defaultexcludes="yes"
                         classpath="${build.classpath}">
 
+                <packageset dir="${com.arjuna.mwlabs.wscf.src}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
+                <packageset dir="${com.arjuna.mwlabs.wscf.src10}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
+                <packageset dir="${com.arjuna.mwlabs.wscf.src11}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
                  <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
                     <path>
                         <pathelement path="${com.arjuna.buildsystem.classpath}"/>
@@ -240,56 +322,56 @@
 	  </javac>
 	</target>
 
-	<target name="com.arjuna.mwlabs.wscf.tests.webapps" depends="com.arjuna.mwlabs.wscf.tests.compile">
-	  <copy file="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
-	    <filterset>
-	      <filter token="hostname" value="${hostname}"/>
-	      <filter token="port" value="${port}"/>
-	    </filterset>
-	  </copy>
-	  <war warfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.war" webxml="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
-	    <manifest>
-	      <attribute name="Class-Path" value="${tests.depend.libs}"/>
-	    </manifest>
-	    <classes dir="${com.arjuna.mwlabs.wscf.tests.dest}"/>
-	  </war>
-	  <ear earfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.ear" appxml="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_application.xml">
-	    <!-- we only need to deploy the ext test libs (junit) and
+    <target name="com.arjuna.mwlabs.wscf.tests.webapps" depends="com.arjuna.mwlabs.wscf.tests.compile">
+        <copy file="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
+            <filterset>
+                <filter token="hostname" value="${hostname}"/>
+                <filter token="port" value="${port}"/>
+            </filterset>
+        </copy>
+        <war warfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.war" webxml="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
+            <manifest>
+                <attribute name="Class-Path" value="${tests.depend.libs}"/>
+            </manifest>
+            <classes dir="${com.arjuna.mwlabs.wscf.tests.dest}"/>
+        </war>
+        <ear earfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.ear" appxml="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_application.xml">
+            <!-- we only need to deploy the ext test libs (junit) and
 	         the tests war in JBoss AS 5.0. the rest of the XTS
 	         code is deployed as a sar and the TS code is deployed
 	         in the server lib
-	    -->
-	    <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
-	    <fileset dir="${com.arjuna.mwlabs.wscf.tests.webapps.dest}" includes="wscf-tests.war"/>
-	  </ear>
-	</target>
+	         -->
+            <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
+            <fileset dir="${com.arjuna.mwlabs.wscf.tests.webapps.dest}" includes="wscf-tests.war"/>
+        </ear>
+    </target>
 
-	<target name="com.arjuna.mwlabs.wscf.tests.deploy" depends="com.arjuna.mwlabs.wscf.tests.webapps, com.arjuna.mwlabs.wscf.tests.undeploy">
-	  <copy file="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.ear" tofile="${deploy.dir}/wscf-tests.ear"/>
-	</target>
+    <target name="com.arjuna.mwlabs.wscf.tests.deploy" depends="com.arjuna.mwlabs.wscf.tests.webapps, com.arjuna.mwlabs.wscf.tests.undeploy">
+        <copy file="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.ear" tofile="${deploy.dir}/wscf-tests.ear"/>
+    </target>
 
-	<target name="com.arjuna.mwlabs.wscf.tests.undeploy">
-	  <delete file="${deploy.dir}/wscf-tests.ear"/>
-	</target>
+    <target name="com.arjuna.mwlabs.wscf.tests.undeploy">
+        <delete file="${deploy.dir}/wscf-tests.ear"/>
+    </target>
 
-	<!-- Clean targets -->
-	<target name="com.arjuna.mw.wscf.clean">
-		<echo message="Cleaning module"/>
-		<delete dir="${com.arjuna.mwlabs.wscf.dest}"/>
-		<delete dir="${com.arjuna.mwlabs.wscf.dest.root}"/>
-		<delete dir="${com.arjuna.mwlabs.wscf.htdocs.dest}"/>
-		<delete file="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
-		<delete file="${com.arjuna.mwlabs.wscf.info.dest}"/>
-		<!-- delete the test destination directories -->
-		<delete dir="${com.arjuna.mwlabs.wscf.tests.dest.root}"/>
-	</target>
+    <!-- Clean targets -->
+    <target name="com.arjuna.mw.wscf.clean">
+        <echo message="Cleaning module"/>
+        <delete dir="${com.arjuna.mwlabs.wscf.dest}"/>
+        <delete dir="${com.arjuna.mwlabs.wscf.dest.root}"/>
+        <delete dir="${com.arjuna.mwlabs.wscf.htdocs.dest}"/>
+        <delete file="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
+        <delete file="${com.arjuna.mwlabs.wscf.info.dest}"/>
+        <!-- delete the test destination directories -->
+        <delete dir="${com.arjuna.mwlabs.wscf.tests.dest.root}"/>
+    </target>
 
-	<!-- Short target names -->
-	<target name="compile" depends="com.arjuna.mw.wscf.compile"/>
-	<target name="jar" depends="com.arjuna.mw.wscf.jar"/>
-	<target name="war" depends="com.arjuna.mw.wscf.war"/>
-	<target name="clean" depends="com.arjuna.mw.wscf.clean"/>
-	<target name="tests-webapps" depends="com.arjuna.mwlabs.wscf.tests.webapps"/>
-	<target name="tests-deploy" depends="com.arjuna.mwlabs.wscf.tests.deploy"/>
-	<target name="tests-undeploy" depends="com.arjuna.mwlabs.wscf.tests.undeploy"/>
+    <!-- Short target names -->
+    <target name="compile" depends="com.arjuna.mw.wscf.compile"/>
+    <target name="jar" depends="com.arjuna.mw.wscf.jar"/>
+    <target name="war" depends="com.arjuna.mw.wscf.war"/>
+    <target name="clean" depends="com.arjuna.mw.wscf.clean"/>
+    <target name="tests-webapps" depends="com.arjuna.mwlabs.wscf.tests.webapps"/>
+    <target name="tests-deploy" depends="com.arjuna.mwlabs.wscf.tests.deploy"/>
+    <target name="tests-undeploy" depends="com.arjuna.mwlabs.wscf.tests.undeploy"/>
 </project>

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinatorFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,171 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mwlabs.wscf.UserCoordinatorImple;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.HashMap;
-
-import java.io.FileNotFoundException;
-
-/**
- * The factory which returns the UserCoordinator implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.UCF_1 [com.arjuna.mw.wscf.UCF_1] - Failed to create {0} doc!
-     */
-
-    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.UCF_1",
-					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
-	    }
-	    else
-		return userCoordinator(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		UserCoordinatorImple coord = (UserCoordinatorImple) _implementations.get(protocolType);
-	
-		if (coord == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    coord = new UserCoordinatorImple(implementation);
-
-		    _implementations.put(protocolType, coord);
-		}
-
-		return coord;
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-	    
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-    static
-    {
-	try
-	{
-	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
-	}
-	catch (FileNotFoundException ex)
-	{
-	}
-	catch (Exception ex)
-	{
-	    throw new ExceptionInInitializerError(ex.toString());
-	}
-    }
-    
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/common/Environment.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,49 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.common;
-
-/**
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
- * @since 1.0.
- */
-
-public class Environment
-{
-
-    public static final String PROTOCOL_IMPLEMENTATION = "com.arjuna.mw.wscf.protocolImplementation";
-    public static final String JTA_CONTEXT = "com.arjuna.mw.wscf.protocols.jta.context";
-    public static final String TWO_PHASE_CONTEXT = "com.arjuna.mw.wscf.protocols.twophase.context";
-    public static final String SAGAS_CONTEXT = "com.arjuna.mw.wscf.protocols.sagas.context";
-    
-}

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,152 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.as;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mwlabs.wscf.model.as.CoordinatorManagerImple;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.DomUtil;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.Hashtable;
-
-/**
- * The factory to return the specific CoordinatorManager implementation.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
- * @since 1.0.
- */
-
-public class CoordinatorManagerFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.as.CMF_1 [com.arjuna.mw.wscf.model.as.CMF_1] - Failed to create 
-     */
-
-    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.as.CMF_1",
-					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
-	    }
-	    else
-		return coordinatorManager(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		CoordinatorManagerImple coord = (CoordinatorManagerImple) _implementations.get(protocolType);
-	
-		if (coord == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    coord = new CoordinatorManagerImple(implementation);
-
-		    _implementations.put(protocolType, coord);
-		}
-	    
-		return coord;
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static Hashtable       _implementations = new Hashtable();
-
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,163 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.sagas;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
-import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import java.util.HashMap;
-
-import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.SagasHLSImple;
-
-/**
- * The factory to return the specific CoordinatorManager implementation.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
- * @since 1.0.
- */
-
-public class CoordinatorManagerFactory
-{
-
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.sagas.CMF_1 [com.arjuna.mw.wscf.model.sagas.CMF_1] - Failed to create 
-     */
-
-    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.sagas.CMF_1",
-					      new Object[]{SagasHLSImple.className()});	
-    }
-	    else
-		return coordinatorManager(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (SagasHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (SagasHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.coordinatorManager();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,162 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.sagas;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
-import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import java.util.HashMap;
-
-import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.SagasHLSImple;
-
-/**
- * The factory which returns the UserCoordinator implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.sagas.UCF_1 [com.arjuna.mw.wscf.model.sagas.UCF_1] - Failed to create 
-     */
-
-    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.sagas.UCF_1",
-					      new Object[]{SagasHLSImple.className()});
-	    }
-	    else
-		return userCoordinator(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (SagasHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (SagasHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.userCoordinator();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,162 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.twophase;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
-import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import java.util.HashMap;
-
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple;
-
-/**
- * The factory to return the specific CoordinatorManager implementation.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
- * @since 1.0.
- */
-
-public class CoordinatorManagerFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.twophase.CMF_1 [com.arjuna.mw.wscf.model.twophase.CMF_1] - Failed to create 
-     */
-
-    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.twophase.CMF_1",
-					      new Object[]{TwoPhaseHLSImple.className()});
-	    }
-	    else
-		return coordinatorManager(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (TwoPhaseHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (TwoPhaseHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.coordinatorManager();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,162 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.twophase;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
-import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wscf.common.CoordinatorXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import java.util.HashMap;
-
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple;
-
-/**
- * The factory which returns the UserCoordinator implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserCoordinatorFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.twophase.UCF_1 [com.arjuna.mw.wscf.model.twophase.UCF_1] - Failed to create 
-     */
-
-    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.twophase.UCF_1",
-					      new Object[]{TwoPhaseHLSImple.className()});
-	    }
-	    else
-		return userCoordinator(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (TwoPhaseHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (TwoPhaseHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.userCoordinator();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,151 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManagerFactory.java,v 1.6 2005/05/19 12:13:26 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.xa;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
-
-import com.arjuna.mw.wscf.common.*;
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mwlabs.wscf.model.jta.arjunajta.JTAHLSImple;
-
-import com.arjuna.mwlabs.wscf.utils.*;
-
-import javax.transaction.SystemException;
-
-import com.arjuna.mw.wscf.exceptions.*;
-
-import java.util.HashMap;
-
-public class TransactionManagerFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.xa.TMF_1 [com.arjuna.mw.wscf.model.xa.TMF_1] - Failed to create 
-     */
-
-    public static javax.transaction.TransactionManager transactionManager () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(JTAHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.xa.TMF_1",
-					      new Object[]{JTAHLSImple.className()});
-	    }
-	    else
-		return transactionManager(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static javax.transaction.TransactionManager transactionManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		JTAHLS coordHLS = (JTAHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (JTAHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (JTAHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.transactionManager();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,151 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Hewlett-Packard Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransactionFactory.java,v 1.6 2005/05/19 12:13:26 nmcl Exp $
- */
-
-package com.arjuna.mw.wscf.model.xa;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
-
-import com.arjuna.mw.wscf.common.*;
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mwlabs.wscf.model.jta.arjunajta.JTAHLSImple;
-
-import com.arjuna.mwlabs.wscf.utils.*;
-
-import javax.transaction.SystemException;
-
-import com.arjuna.mw.wscf.exceptions.*;
-
-import java.util.HashMap;
-
-public class UserTransactionFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wscf.model.xa.UTF_1 [com.arjuna.mw.wscf.model.xa.UTF_1] - Failed to create 
-     */
-
-    public static javax.transaction.UserTransaction userTransaction () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(JTAHLSImple.className());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.xa.UTF_1",
-					      new Object[]{JTAHLSImple.className()});
-	    }
-	    else
-		return userTransaction(doc);
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the CoordinatorManager implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static javax.transaction.UserTransaction userTransaction (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
-		String protocolType = child.getNodeValue();
-		JTAHLS coordHLS = (JTAHLS) _implementations.get(protocolType);
-	
-		if (coordHLS == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-		
-		    if (implementation instanceof String)
-		    {
-			Class c = Class.forName((String) implementation);
-
-			coordHLS = (JTAHLS) c.newInstance();
-		    }
-		    else
-			coordHLS = (JTAHLS) implementation;
-
-		    _implementations.put(protocolType, coordHLS);
-		}
-	    
-		return coordHLS.userTransaction();
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-    
-}

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/CoordinatorControl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/CoordinatorControl.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/CoordinatorControl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -313,7 +313,7 @@
 	return _theTransactionManagerImple;
     }
 
-    final javax.transaction.Transaction currentCoordinator () throws NoCoordinatorException, SystemException
+    public final javax.transaction.Transaction currentCoordinator () throws NoCoordinatorException, SystemException
     {
 	javax.transaction.Transaction tx = (javax.transaction.Transaction) _coordinators.get(currentActivity());
 

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,288 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: JTAHLSImple.java,v 1.4.4.1 2005/11/22 10:34:17 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wscf.model.jta.arjunajta;
-
-import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
-
-import com.arjuna.mw.wsas.context.soap.SOAPContext;
-
-import com.arjuna.mw.wscf.common.Qualifier;
-import com.arjuna.mw.wscf.common.CoordinatorId;
-import com.arjuna.mw.wscf.common.Environment;
-
-import com.arjuna.mw.wscf.api.UserCoordinatorService;
-
-import com.arjuna.mw.wsas.context.Context;
-
-import com.arjuna.mw.wsas.ActivityManagerFactory;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-import com.arjuna.mw.wsas.activity.HLS;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.HLSError;
-
-import com.arjuna.mw.wscf.exceptions.*;
-
-/**
- * The ArjunaJTA coordination service implementation.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: JTAHLSImple.java,v 1.4.4.1 2005/11/22 10:34:17 kconner Exp $
- * @since 1.0.
- */
-
-public class JTAHLSImple implements JTAHLS, UserCoordinatorService
-{
-
-    public JTAHLSImple ()
-    {
-	try
-	{
-	    ActivityManagerFactory.activityManager().addHLS((HLS) this);
-	}
-	catch (Exception ex)
-	{
-	    throw new HLSError(ex.toString());
-	}
-
-	_userTransaction = new UserTransactionImple();
-	_transactionManager = new TransactionManagerImple();
-	_coordManager = new CoordinatorControl();
-    }
-    
-    public UserCoordinatorService coordinatorService ()
-    {
-	return this;
-    }
-    
-    public javax.transaction.UserTransaction userTransaction ()
-    {
-	return _userTransaction;
-    }
-    
-    public javax.transaction.TransactionManager transactionManager ()
-    {
-	return _transactionManager;
-    }
-    
-    /**
-     * An activity has begun and is active on the current thread.
-     */
-
-    public void begun () throws SystemException
-    {
-	_coordManager.begin();
-    }
-
-    /**
-     * The current activity is completing with the specified completion status.
-     *
-     * @param CompletionStatus cs The completion status to use.
-     *
-     * @return The result of terminating the relationship of this HLS and
-     * the current activity.
-     */
-
-    public Outcome complete (CompletionStatus cs) throws SystemException
-    {
-	return _coordManager.complete(cs);
-    }	
-
-    /**
-     * The activity has been suspended.
-     */
-
-    public void suspended () throws SystemException
-    {
-	_coordManager.suspend();
-    }	
-
-    /**
-     * The activity has been resumed on the current thread.
-     */
-
-    public void resumed () throws SystemException
-    {
-	_coordManager.resume();
-    }	
-
-    /**
-     * The activity has completed and is no longer active on the current
-     * thread.
-     */
-
-    public void completed () throws SystemException
-    {
-	_coordManager.completed();
-    }
-
-    /**
-     * The HLS name.
-     */
-
-    public String identity () throws SystemException
-    {
-	return "JTAHLSImple";
-    }
-
-    /**
-     * The activity service maintains a priority ordered list of HLS
-     * implementations. If an HLS wishes to be ordered based on priority
-     * then it can return a non-negative value: the higher the value,
-     * the higher the priority and hence the earlier in the list of HLSes
-     * it will appear (and be used in).
-     *
-     * @return a positive value for the priority for this HLS, or zero/negative
-     * if the order is not important.
-     */
-
-    public int priority () throws SystemException
-    {
-	return 0;
-    }
-
-    /**
-     * Return the context augmentation for this HLS, if any on the current
-     * activity.
-     *
-     * @param ActivityHierarchy current The handle on the current activity
-     * hierarchy. The HLS may use this when determining what information to
-     * place in its context data.
-     *
-     * @return a context object or null if no augmentation is necessary.
-     */
-
-    public Context context () throws SystemException
-    {
-	String contextImple = System.getProperty(Environment.JTA_CONTEXT);
-
-	if (contextImple != null)
-	{
-	    try
-	    {
-		Class c = Class.forName(contextImple);
-		SOAPContext ctx = (SOAPContext) c.newInstance();
-		
-		ctx.initialiseContext(_coordManager.currentCoordinator());
-
-		return ctx;
-	    }
-	    catch (Exception ex)
-	    {
-		throw new SystemException(ex.toString());
-	    }
-	}
-	else
-	    return new com.arjuna.mwlabs.wscf.model.jta.arjunajta.context.soap.JTAContextImple(_coordManager.currentCoordinator());
-    }
-
-    /**
-     * If the application requires and if the coordination protocol supports
-     * it, then this method can be used to execute a coordination protocol on
-     * the currently enlisted participants at any time prior to the termination
-     * of the coordination scope.
-     *
-     * This implementation only supports coordination at the end of the
-     * activity.
-     *
-     * @param CompletionStatus cs The completion status to use when determining
-     * how to execute the protocol.
-     *
-     * @exception WrongStateException Thrown if the coordinator is in a state
-     * the does not allow coordination to occur.
-     * @exception ProtocolViolationException Thrown if the protocol is violated
-     * in some manner during execution.
-     * @exception SystemException Thrown if any other error occurs.
-     *
-     * @return The result of executing the protocol, or null.
-     */
-
-    public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
-    {
-	return _coordManager.coordinate(cs);
-    }
-
-    /**
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the status of the current coordinator. If there is no
-     * activity associated with the thread then NoActivity
-     * will be returned.
-     *
-     * @see com.arjuna.mw.wsas.status.Status
-     */
-
-    public com.arjuna.mw.wsas.status.Status status () throws SystemException
-    {
-	return _coordManager.status();
-    }
-
-    /**
-     * Not supported by basic ArjunaCore.
-     *
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the complete list of qualifiers that have been registered with
-     * the current coordinator.
-     */
-    
-    public Qualifier[] qualifiers () throws NoCoordinatorException, SystemException
-    {
-	return _coordManager.qualifiers();
-    }
-
-    /**
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return The unique identity of the current coordinator.
-     */
-
-    public CoordinatorId identifier () throws NoCoordinatorException, SystemException
-    {
-	return _coordManager.identifier();
-    }
-
-    public static String className ()
-    {
-	return JTAHLSImple.class.getName();
-    }
-
-    private CoordinatorControl                   _coordManager;
-    private javax.transaction.UserTransaction    _userTransaction;
-    private javax.transaction.TransactionManager _transactionManager;
-
-}

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorControl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorControl.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/CoordinatorControl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -347,7 +347,7 @@
 	currentCoordinator().participantFaulted(participantId);
     }
     
-    final ACCoordinator currentCoordinator () throws NoCoordinatorException, SystemException
+    public final ACCoordinator currentCoordinator () throws NoCoordinatorException, SystemException
     {
 	ACCoordinator coord = (ACCoordinator) _coordinators.get(currentActivity());
 

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,298 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wscf.model.sagas.arjunacore;
-
-import com.arjuna.mw.wscf.model.sagas.api.*;
-import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
-
-import com.arjuna.mw.wscf.common.Environment;
-
-import com.arjuna.mw.wsas.context.soap.SOAPContext;
-
-import com.arjuna.mw.wscf.common.Qualifier;
-import com.arjuna.mw.wscf.common.CoordinatorId;
-
-import com.arjuna.mw.wscf.api.UserCoordinatorService;
-
-import com.arjuna.mw.wsas.context.Context;
-
-import com.arjuna.mw.wsas.ActivityManagerFactory;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-import com.arjuna.mw.wsas.activity.HLS;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.HLSError;
-
-import com.arjuna.mw.wscf.exceptions.*;
-
-/**
- * The ArjunaCore coordination service implementation.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
- * @since 1.0.
- */
-
-public class SagasHLSImple implements SagasHLS, UserCoordinatorService
-{
-
-    public SagasHLSImple ()
-    {
-	try
-	{
-	    ActivityManagerFactory.activityManager().addHLS((HLS) this);
-	}
-	catch (Exception ex)
-	{
-	    throw new HLSError(ex.toString());
-	}
-
-	_coordinatorService = new CoordinatorServiceImple();
-	_coordManager = new CoordinatorControl();
-    }
-    
-    public UserCoordinatorService coordinatorService ()
-    {
-	return this;
-    }
-    
-    public UserCoordinator userCoordinator ()
-    {
-	return _coordinatorService;
-    }
-    
-    public CoordinatorManager coordinatorManager ()
-    {
-	return _coordinatorService;
-    }
-    
-    /**
-     * An activity has begun and is active on the current thread.
-     */
-
-    public void begun () throws SystemException
-    {
-	_coordManager.begin();
-    }
-
-    /**
-     * The current activity is completing with the specified completion status.
-     *
-     * @param CompletionStatus cs The completion status to use.
-     *
-     * @return The result of terminating the relationship of this HLS and
-     * the current activity.
-     */
-
-    public Outcome complete (CompletionStatus cs) throws SystemException
-    {
-	return _coordManager.complete(cs);
-    }	
-
-    /**
-     * The activity has been suspended.
-     */
-
-    public void suspended () throws SystemException
-    {
-	_coordManager.suspend();
-    }	
-
-    /**
-     * The activity has been resumed on the current thread.
-     */
-
-    public void resumed () throws SystemException
-    {
-	_coordManager.resume();
-    }	
-
-    /**
-     * The activity has completed and is no longer active on the current
-     * thread.
-     */
-
-    public void completed () throws SystemException
-    {
-	_coordManager.completed();
-    }
-
-    /**
-     * The HLS name.
-     */
-
-    public String identity () throws SystemException
-    {
-	return "SagasHLSImple";
-    }
-
-    /**
-     * The activity service maintains a priority ordered list of HLS
-     * implementations. If an HLS wishes to be ordered based on priority
-     * then it can return a non-negative value: the higher the value,
-     * the higher the priority and hence the earlier in the list of HLSes
-     * it will appear (and be used in).
-     *
-     * @return a positive value for the priority for this HLS, or zero/negative
-     * if the order is not important.
-     */
-
-    public int priority () throws SystemException
-    {
-	return 0;
-    }
-
-    /**
-     * Return the context augmentation for this HLS, if any on the current
-     * activity.
-     *
-     * @param ActivityHierarchy current The handle on the current activity
-     * hierarchy. The HLS may use this when determining what information to
-     * place in its context data.
-     *
-     * @return a context object or null if no augmentation is necessary.
-     */
-
-    /*
-     * TODO This needs refactoring. It's true that the context format should
-     * be configurable to allow the same implementation to be used in
-     * different protocols (e.g., 2PC mapping to OTS or original Arjuna could
-     * use the same protocol implementation, but the context formats are
-     * different.) However, is this the best way of doing that?
-     */
-
-    public Context context () throws SystemException
-    {
-	String contextImple = System.getProperty(Environment.SAGAS_CONTEXT);
-
-	if (contextImple != null)
-	{
-	    try
-	    {
-		Class c = Class.forName(contextImple);
-		SOAPContext ctx = (SOAPContext) c.newInstance();
-		
-		ctx.initialiseContext(_coordManager.currentCoordinator());
-
-		return ctx;
-	    }
-	    catch (Exception ex)
-	    {
-		ex.printStackTrace();
-		
-		throw new SystemException(ex.toString());
-	    }
-	}
-	else
-	    return new com.arjuna.mwlabs.wscf.model.sagas.arjunacore.context.soap.ArjunaContextImple(_coordManager.currentCoordinator());
-    }
-
-    /**
-     * If the application requires and if the coordination protocol supports
-     * it, then this method can be used to execute a coordination protocol on
-     * the currently enlisted participants at any time prior to the termination
-     * of the coordination scope.
-     *
-     * This implementation only supports coordination at the end of the
-     * activity.
-     *
-     * @param CompletionStatus cs The completion status to use when determining
-     * how to execute the protocol.
-     *
-     * @exception WrongStateException Thrown if the coordinator is in a state
-     * the does not allow coordination to occur.
-     * @exception ProtocolViolationException Thrown if the protocol is violated
-     * in some manner during execution.
-     * @exception SystemException Thrown if any other error occurs.
-     *
-     * @return The result of executing the protocol, or null.
-     */
-
-    public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
-    {
-	return _coordManager.coordinate(cs);
-    }
-
-    /**
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the status of the current coordinator. If there is no
-     * activity associated with the thread then NoActivity
-     * will be returned.
-     *
-     * @see com.arjuna.mw.wsas.status.Status
-     */
-
-    public com.arjuna.mw.wsas.status.Status status () throws SystemException
-    {
-	return _coordManager.status();
-    }
-
-    /**
-     * Not supported by basic ArjunaCore.
-     *
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the complete list of qualifiers that have been registered with
-     * the current coordinator.
-     */
-    
-    public Qualifier[] qualifiers () throws NoCoordinatorException, SystemException
-    {
-	return _coordManager.qualifiers();
-    }
-
-    /**
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return The unique identity of the current coordinator.
-     */
-
-    public CoordinatorId identifier () throws NoCoordinatorException, SystemException
-    {
-	return _coordManager.identifier();
-    }
-
-    public static String className ()
-    {
-	return SagasHLSImple.class.getName();
-    }
-
-    private CoordinatorControl      _coordManager;
-    private CoordinatorServiceImple _coordinatorService;
-
-}

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorControl.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorControl.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/CoordinatorControl.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -471,7 +471,7 @@
 		}
 	}
 	
-	final ACCoordinator currentCoordinator () throws NoCoordinatorException,
+	public final ACCoordinator currentCoordinator () throws NoCoordinatorException,
 			SystemException
 	{
 		ACCoordinator coord = (ACCoordinator) _coordinators.get(currentActivity());

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,307 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wscf.model.twophase.arjunacore;
-
-import com.arjuna.mw.wscf.model.twophase.api.*;
-import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
-
-import com.arjuna.mw.wscf.common.Environment;
-
-import com.arjuna.mw.wsas.context.soap.SOAPContext;
-
-import com.arjuna.mw.wscf.common.Qualifier;
-import com.arjuna.mw.wscf.common.CoordinatorId;
-
-import com.arjuna.mw.wscf.api.UserCoordinatorService;
-
-import com.arjuna.mw.wsas.context.Context;
-
-import com.arjuna.mw.wsas.ActivityManagerFactory;
-
-import com.arjuna.mw.wsas.activity.Outcome;
-import com.arjuna.mw.wsas.activity.HLS;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.HLSError;
-
-import com.arjuna.mw.wscf.exceptions.*;
-
-/**
- * The ArjunaCore coordination service implementation.
- * 
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
- * @since 1.0.
- */
-
-public class TwoPhaseHLSImple implements TwoPhaseHLS, UserCoordinatorService
-{
-
-	public TwoPhaseHLSImple ()
-	{
-		try
-		{
-			ActivityManagerFactory.activityManager().addHLS((HLS) this);
-		}
-		catch (Exception ex)
-		{
-			throw new HLSError(ex.toString());
-		}
-
-		_coordinatorService = new CoordinatorServiceImple();
-		_coordManager = new CoordinatorControl();
-	}
-
-	public UserCoordinatorService coordinatorService ()
-	{
-		return this;
-	}
-
-	public UserCoordinator userCoordinator ()
-	{
-		return _coordinatorService;
-	}
-
-	public CoordinatorManager coordinatorManager ()
-	{
-		return _coordinatorService;
-	}
-
-	/**
-	 * An activity has begun and is active on the current thread.
-	 */
-
-	public void begun () throws SystemException
-	{
-		_coordManager.begin();
-	}
-
-	/**
-	 * The current activity is completing with the specified completion status.
-	 * 
-	 * @param CompletionStatus
-	 *            cs The completion status to use.
-	 * 
-	 * @return The result of terminating the relationship of this HLS and the
-	 *         current activity.
-	 */
-
-	public Outcome complete (CompletionStatus cs) throws SystemException
-	{
-		return _coordManager.complete(cs);
-	}
-
-	/**
-	 * The activity has been suspended.
-	 */
-
-	public void suspended () throws SystemException
-	{
-		_coordManager.suspend();
-	}
-
-	/**
-	 * The activity has been resumed on the current thread.
-	 */
-
-	public void resumed () throws SystemException
-	{
-		_coordManager.resume();
-	}
-
-	/**
-	 * The activity has completed and is no longer active on the current thread.
-	 */
-
-	public void completed () throws SystemException
-	{
-		_coordManager.completed();
-	}
-
-	/**
-	 * The HLS name.
-	 */
-
-	public String identity () throws SystemException
-	{
-		return "TwoPhaseHLSImple";
-	}
-
-	/**
-	 * The activity service maintains a priority ordered list of HLS
-	 * implementations. If an HLS wishes to be ordered based on priority then it
-	 * can return a non-negative value: the higher the value, the higher the
-	 * priority and hence the earlier in the list of HLSes it will appear (and
-	 * be used in).
-	 * 
-	 * @return a positive value for the priority for this HLS, or zero/negative
-	 *         if the order is not important.
-	 */
-
-	public int priority () throws SystemException
-	{
-		return 0;
-	}
-
-	/**
-	 * Return the context augmentation for this HLS, if any on the current
-	 * activity.
-	 * 
-	 * @param ActivityHierarchy
-	 *            current The handle on the current activity hierarchy. The HLS
-	 *            may use this when determining what information to place in its
-	 *            context data.
-	 * 
-	 * @return a context object or null if no augmentation is necessary.
-	 */
-
-	/*
-	 * TODO This needs refactoring. It's true that the context format should be
-	 * configurable to allow the same implementation to be used in different
-	 * protocols (e.g., 2PC mapping to OTS or original Arjuna could use the same
-	 * protocol implementation, but the context formats are different.) However,
-	 * is this the best way of doing that?
-	 */
-
-	public Context context () throws SystemException
-	{
-		String contextImple = System.getProperty(Environment.TWO_PHASE_CONTEXT);
-
-		if (contextImple != null)
-		{
-			try
-			{
-				Class c = Class.forName(contextImple);
-				SOAPContext ctx = (SOAPContext) c.newInstance();
-
-				ctx.initialiseContext(_coordManager.currentCoordinator());
-
-				return ctx;
-			}
-			catch (Exception ex)
-			{
-				throw new SystemException(ex.toString());
-			}
-		}
-		else
-			return new com.arjuna.mwlabs.wscf.model.twophase.arjunacore.context.soap.ArjunaContextImple(
-					_coordManager.currentCoordinator());
-	}
-
-	/**
-	 * If the application requires and if the coordination protocol supports it,
-	 * then this method can be used to execute a coordination protocol on the
-	 * currently enlisted participants at any time prior to the termination of
-	 * the coordination scope.
-	 * 
-	 * This implementation only supports coordination at the end of the
-	 * activity.
-	 * 
-	 * @param CompletionStatus
-	 *            cs The completion status to use when determining how to
-	 *            execute the protocol.
-	 * 
-	 * @exception WrongStateException
-	 *                Thrown if the coordinator is in a state the does not allow
-	 *                coordination to occur.
-	 * @exception ProtocolViolationException
-	 *                Thrown if the protocol is violated in some manner during
-	 *                execution.
-	 * @exception SystemException
-	 *                Thrown if any other error occurs.
-	 * 
-	 * @return The result of executing the protocol, or null.
-	 */
-
-	public Outcome coordinate (CompletionStatus cs) throws WrongStateException,
-			ProtocolViolationException, SystemException
-	{
-		return _coordManager.coordinate(cs);
-	}
-
-	/**
-	 * @exception SystemException
-	 *                Thrown if any error occurs.
-	 * 
-	 * @return the status of the current coordinator. If there is no activity
-	 *         associated with the thread then NoActivity will be returned.
-	 * 
-	 * @see com.arjuna.mw.wsas.status.Status
-	 */
-
-	public com.arjuna.mw.wsas.status.Status status () throws SystemException
-	{
-		return _coordManager.status();
-	}
-
-	/**
-	 * Not supported by basic ArjunaCore.
-	 * 
-	 * @exception SystemException
-	 *                Thrown if any error occurs.
-	 * 
-	 * @return the complete list of qualifiers that have been registered with
-	 *         the current coordinator.
-	 */
-
-	public Qualifier[] qualifiers () throws NoCoordinatorException,
-			SystemException
-	{
-		return _coordManager.qualifiers();
-	}
-
-	/**
-	 * @exception SystemException
-	 *                Thrown if any error occurs.
-	 * 
-	 * @return The unique identity of the current coordinator.
-	 */
-
-	public CoordinatorId identifier () throws NoCoordinatorException,
-			SystemException
-	{
-		return _coordManager.identifier();
-	}
-
-	public static String className ()
-	{
-		return TwoPhaseHLSImple.class.getName();
-	}
-
-	private CoordinatorControl _coordManager;
-	private CoordinatorServiceImple _coordinatorService;
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/Initializer.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/Initializer.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/Initializer.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,102 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wscf.protocols;
-
-import com.arjuna.mw.wscf.logging.wscfLogger;
-
-import com.arjuna.mw.wscf.protocols.ProtocolManager;
-
-import com.arjuna.mw.wsas.exceptions.*;
-
-import com.arjuna.mwlabs.wscf.utils.*;
-
-/**
- * Register all of the default coordination protocols with the system.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
- * @since 1.0.
- */
-
-public class Initializer
-{
-
-    public Initializer (ProtocolManager manager) throws SystemException
-    {
-	_manager = null;
-	
-	try
-	{
-	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
-	}
-	catch (java.io.FileNotFoundException ex)
-	{
-	}
-	catch (Exception ex)
-	{
-	}
-    }
-    
-    /**
-     * @message com.arjuna.mwlabs.wscf.protocols.Initializer_1 [com.arjuna.mwlabs.wscf.protocols.Initializer_1] - Failed to create: 
-     */
-
-    private final void addProtocol (String impl) throws SystemException
-    {
-	try
-	{
-	    // add in ArjunaCore support
-
-	    ProtocolLocator pl = new ProtocolLocator(impl);
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		throw new SystemException(wscfLogger.log_mesg.getString("com.arjuna.mwlabs.wscf.protocols.Initializer_1")+impl);
-	    }
-	    else
-	    {
-		_manager.addProtocol(doc, impl);
-	    }
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-	    
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private ProtocolManager _manager;
-    
-}
-

Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/utils/ProtocolLocator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/utils/ProtocolLocator.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/utils/ProtocolLocator.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -55,9 +55,10 @@
 public class ProtocolLocator
 {
 
-    public ProtocolLocator (String theType)
+    public ProtocolLocator (Class clazz)
     {
-	_className = theType.replace(_packageSeparator, _resourceSeparator);
+    _clazz = clazz;
+    _className = clazz.getName().replace(_packageSeparator, _resourceSeparator);
 	_xmlName = _className+".xml";
     }
 
@@ -70,7 +71,7 @@
     {
 	try
 	{
-	    URL url = ProtocolLocator.class.getResource(_resourceSeparator+_xmlName);
+	    URL url = _clazz.getResource(_resourceSeparator+_xmlName);
 
 	    if (url == null)
 	    {
@@ -103,6 +104,11 @@
 	}
     }
 
+    /**
+     * we load the protocol document as a resource via the associated class assuming that they are packaged in
+     * same archive using the same path and base file name but with extension xml in place of class.
+     */
+    private Class _clazz;
     private String _className;
     private String _xmlName;
     

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wsc (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wsc)

Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wsc/deploy/WSCFInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wsc/deploy/WSCFInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wsc/deploy/WSCFInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -27,6 +27,7 @@
 import com.arjuna.mw.wscf.logging.wscfLogger;
 import com.arjuna.mwlabs.wsc.ContextFactoryMapperImple;
 import com.arjuna.wsc.ContextFactoryMapper;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Initialise WSCF.
@@ -42,22 +43,29 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        try
-        {
-            Configuration.initialise("/wscf.xml");
-            
-            final ContextFactoryMapper wscfImpl = ContextFactoryMapper.getFactory() ;
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSCF10) {
+           public void run() {
+               try
+               {
+                   Configuration.initialise("/wscf.xml");
 
-            wscfImpl.setSubordinateContextFactoryMapper(new ContextFactoryMapperImple());
-        }
-        catch (Exception exception)
-        {
-            wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc.deploy.WSCFI_1", exception);
-        }
-        catch (Error error)
-        {
-            wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc.deploy.WSCFI_1", error);
-        }
+                   final ContextFactoryMapper wscfImpl = ContextFactoryMapper.getFactory() ;
+
+                   wscfImpl.setSubordinateContextFactoryMapper(new ContextFactoryMapperImple());
+               }
+               catch (Exception exception)
+               {
+                   wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc.deploy.WSCFI_1", exception);
+               }
+               catch (Error error)
+               {
+                   wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc.deploy.WSCFI_1", error);
+               }
+           }
+        };
+        // this is the last WSCF callback to be initialised so close the list
+
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSCF10);
     }
 
     /**

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/UserCoordinatorFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,171 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mwlabs.wscf.UserCoordinatorImple;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+import java.io.FileNotFoundException;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.UCF_1 [com.arjuna.mw.wscf.UCF_1] - Failed to create {0} doc!
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.UCF_1",
+					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		UserCoordinatorImple coord = (UserCoordinatorImple) _implementations.get(protocolType);
+	
+		if (coord == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    coord = new UserCoordinatorImple(implementation);
+
+		    _implementations.put(protocolType, coord);
+		}
+
+		return coord;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	    
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+    static
+    {
+	try
+	{
+	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
+	}
+	catch (FileNotFoundException ex)
+	{
+	}
+	catch (Exception ex)
+	{
+	    throw new ExceptionInInitializerError(ex.toString());
+	}
+    }
+    
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/common/Environment.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.common;
+
+/**
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class Environment
+{
+
+    public static final String PROTOCOL_IMPLEMENTATION = "com.arjuna.mw.wscf.protocolImplementation";
+    public static final String JTA_CONTEXT = "com.arjuna.mw.wscf.protocols.jta.context";
+    public static final String TWO_PHASE_CONTEXT = "com.arjuna.mw.wscf.protocols.twophase.context";
+    public static final String SAGAS_CONTEXT = "com.arjuna.mw.wscf.protocols.sagas.context";
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/as/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,152 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.as;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mwlabs.wscf.model.as.CoordinatorManagerImple;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.DomUtil;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.Hashtable;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.as.CMF_1 [com.arjuna.mw.wscf.model.as.CMF_1] - Failed to create 
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.as.CMF_1",
+					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
+	    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		CoordinatorManagerImple coord = (CoordinatorManagerImple) _implementations.get(protocolType);
+	
+		if (coord == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    coord = new CoordinatorManagerImple(implementation);
+
+		    _implementations.put(protocolType, coord);
+		}
+	    
+		return coord;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static Hashtable       _implementations = new Hashtable();
+
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,163 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.sagas;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.SagasHLSImple;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.sagas.CMF_1 [com.arjuna.mw.wscf.model.sagas.CMF_1] - Failed to create 
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.sagas.CMF_1",
+					      new Object[]{SagasHLSImple.className()});	
+    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (SagasHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (SagasHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.coordinatorManager();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/sagas/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.sagas;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.SagasHLSImple;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.sagas.UCF_1 [com.arjuna.mw.wscf.model.sagas.UCF_1] - Failed to create 
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.sagas.UCF_1",
+					      new Object[]{SagasHLSImple.className()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (SagasHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (SagasHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.userCoordinator();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.twophase;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.twophase.CMF_1 [com.arjuna.mw.wscf.model.twophase.CMF_1] - Failed to create 
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.twophase.CMF_1",
+					      new Object[]{TwoPhaseHLSImple.className()});
+	    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (TwoPhaseHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (TwoPhaseHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.coordinatorManager();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/twophase/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.twophase;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhaseHLSImple;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.twophase.UCF_1 [com.arjuna.mw.wscf.model.twophase.UCF_1] - Failed to create 
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.twophase.UCF_1",
+					      new Object[]{TwoPhaseHLSImple.className()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (TwoPhaseHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (TwoPhaseHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.userCoordinator();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
+

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,151 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerFactory.java,v 1.6 2005/05/19 12:13:26 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.xa;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
+
+import com.arjuna.mw.wscf.common.*;
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mwlabs.wscf.model.jta.arjunajta.JTAHLSImple;
+
+import com.arjuna.mwlabs.wscf.utils.*;
+
+import javax.transaction.SystemException;
+
+import com.arjuna.mw.wscf.exceptions.*;
+
+import java.util.HashMap;
+
+public class TransactionManagerFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.xa.TMF_1 [com.arjuna.mw.wscf.model.xa.TMF_1] - Failed to create 
+     */
+
+    public static javax.transaction.TransactionManager transactionManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(JTAHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.xa.TMF_1",
+					      new Object[]{JTAHLSImple.className()});
+	    }
+	    else
+		return transactionManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static javax.transaction.TransactionManager transactionManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		JTAHLS coordHLS = (JTAHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (JTAHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (JTAHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.transactionManager();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/model/xa/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,151 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Hewlett-Packard Arjuna Labs,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionFactory.java,v 1.6 2005/05/19 12:13:26 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf.model.xa;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
+
+import com.arjuna.mw.wscf.common.*;
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mwlabs.wscf.model.jta.arjunajta.JTAHLSImple;
+
+import com.arjuna.mwlabs.wscf.utils.*;
+
+import javax.transaction.SystemException;
+
+import com.arjuna.mw.wscf.exceptions.*;
+
+import java.util.HashMap;
+
+public class UserTransactionFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf.model.xa.UTF_1 [com.arjuna.mw.wscf.model.xa.UTF_1] - Failed to create 
+     */
+
+    public static javax.transaction.UserTransaction userTransaction () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(JTAHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf.model.xa.UTF_1",
+					      new Object[]{JTAHLSImple.className()});
+	    }
+	    else
+		return userTransaction(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static javax.transaction.UserTransaction userTransaction (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		JTAHLS coordHLS = (JTAHLS) _implementations.get(protocolType);
+	
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+		
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (JTAHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (JTAHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+	    
+		return coordHLS.userTransaction();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols)

Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/protocols/ProtocolManager.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mw/wscf/protocols/ProtocolManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -424,7 +424,8 @@
 
 				try
 				{
-					ProtocolLocator pl = new ProtocolLocator(className);
+                    Class clazz = this.getClass().getClassLoader().loadClass(className);
+                    ProtocolLocator pl = new ProtocolLocator(clazz);
 					org.w3c.dom.Document doc = pl.getProtocol();
 
 					if (doc == null)

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wsc)

Modified: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc/ContextFactoryMapperImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wsc/ContextFactoryMapperImple.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wsc/ContextFactoryMapperImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -54,7 +54,7 @@
 	{
 		_protocols = ProtocolRegistry.createManager();
 	}
-
+                                                      
 	public void addContextFactory (String coordinationTypeURI, ContextFactory contextFactory)
 	{
 		try

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/jta/arjunajta/JTAHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,288 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: JTAHLSImple.java,v 1.4.4.1 2005/11/22 10:34:17 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wscf.model.jta.arjunajta;
+
+import com.arjuna.mw.wscf.model.xa.hls.JTAHLS;
+
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+import com.arjuna.mw.wscf.common.Environment;
+
+import com.arjuna.mw.wscf.api.UserCoordinatorService;
+
+import com.arjuna.mw.wsas.context.Context;
+
+import com.arjuna.mw.wsas.ActivityManagerFactory;
+
+import com.arjuna.mw.wsas.activity.Outcome;
+import com.arjuna.mw.wsas.activity.HLS;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.HLSError;
+
+import com.arjuna.mw.wscf.exceptions.*;
+
+/**
+ * The ArjunaJTA coordination service implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: JTAHLSImple.java,v 1.4.4.1 2005/11/22 10:34:17 kconner Exp $
+ * @since 1.0.
+ */
+
+public class JTAHLSImple implements JTAHLS, UserCoordinatorService
+{
+
+    public JTAHLSImple ()
+    {
+	try
+	{
+	    ActivityManagerFactory.activityManager().addHLS((HLS) this);
+	}
+	catch (Exception ex)
+	{
+	    throw new HLSError(ex.toString());
+	}
+
+	_userTransaction = new UserTransactionImple();
+	_transactionManager = new TransactionManagerImple();
+	_coordManager = new CoordinatorControl();
+    }
+    
+    public UserCoordinatorService coordinatorService ()
+    {
+	return this;
+    }
+    
+    public javax.transaction.UserTransaction userTransaction ()
+    {
+	return _userTransaction;
+    }
+    
+    public javax.transaction.TransactionManager transactionManager ()
+    {
+	return _transactionManager;
+    }
+    
+    /**
+     * An activity has begun and is active on the current thread.
+     */
+
+    public void begun () throws SystemException
+    {
+	_coordManager.begin();
+    }
+
+    /**
+     * The current activity is completing with the specified completion status.
+     *
+     * @param CompletionStatus cs The completion status to use.
+     *
+     * @return The result of terminating the relationship of this HLS and
+     * the current activity.
+     */
+
+    public Outcome complete (CompletionStatus cs) throws SystemException
+    {
+	return _coordManager.complete(cs);
+    }	
+
+    /**
+     * The activity has been suspended.
+     */
+
+    public void suspended () throws SystemException
+    {
+	_coordManager.suspend();
+    }	
+
+    /**
+     * The activity has been resumed on the current thread.
+     */
+
+    public void resumed () throws SystemException
+    {
+	_coordManager.resume();
+    }	
+
+    /**
+     * The activity has completed and is no longer active on the current
+     * thread.
+     */
+
+    public void completed () throws SystemException
+    {
+	_coordManager.completed();
+    }
+
+    /**
+     * The HLS name.
+     */
+
+    public String identity () throws SystemException
+    {
+	return "JTAHLSImple";
+    }
+
+    /**
+     * The activity service maintains a priority ordered list of HLS
+     * implementations. If an HLS wishes to be ordered based on priority
+     * then it can return a non-negative value: the higher the value,
+     * the higher the priority and hence the earlier in the list of HLSes
+     * it will appear (and be used in).
+     *
+     * @return a positive value for the priority for this HLS, or zero/negative
+     * if the order is not important.
+     */
+
+    public int priority () throws SystemException
+    {
+	return 0;
+    }
+
+    /**
+     * Return the context augmentation for this HLS, if any on the current
+     * activity.
+     *
+     * @param ActivityHierarchy current The handle on the current activity
+     * hierarchy. The HLS may use this when determining what information to
+     * place in its context data.
+     *
+     * @return a context object or null if no augmentation is necessary.
+     */
+
+    public Context context () throws SystemException
+    {
+	String contextImple = System.getProperty(Environment.JTA_CONTEXT);
+
+	if (contextImple != null)
+	{
+	    try
+	    {
+		Class c = Class.forName(contextImple);
+		SOAPContext ctx = (SOAPContext) c.newInstance();
+		
+		ctx.initialiseContext(_coordManager.currentCoordinator());
+
+		return ctx;
+	    }
+	    catch (Exception ex)
+	    {
+		throw new SystemException(ex.toString());
+	    }
+	}
+	else
+	    return new com.arjuna.mwlabs.wscf.model.jta.arjunajta.context.soap.JTAContextImple(_coordManager.currentCoordinator());
+    }
+
+    /**
+     * If the application requires and if the coordination protocol supports
+     * it, then this method can be used to execute a coordination protocol on
+     * the currently enlisted participants at any time prior to the termination
+     * of the coordination scope.
+     *
+     * This implementation only supports coordination at the end of the
+     * activity.
+     *
+     * @param CompletionStatus cs The completion status to use when determining
+     * how to execute the protocol.
+     *
+     * @exception WrongStateException Thrown if the coordinator is in a state
+     * the does not allow coordination to occur.
+     * @exception ProtocolViolationException Thrown if the protocol is violated
+     * in some manner during execution.
+     * @exception SystemException Thrown if any other error occurs.
+     *
+     * @return The result of executing the protocol, or null.
+     */
+
+    public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
+    {
+	return _coordManager.coordinate(cs);
+    }
+
+    /**
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the status of the current coordinator. If there is no
+     * activity associated with the thread then NoActivity
+     * will be returned.
+     *
+     * @see com.arjuna.mw.wsas.status.Status
+     */
+
+    public com.arjuna.mw.wsas.status.Status status () throws SystemException
+    {
+	return _coordManager.status();
+    }
+
+    /**
+     * Not supported by basic ArjunaCore.
+     *
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the complete list of qualifiers that have been registered with
+     * the current coordinator.
+     */
+    
+    public Qualifier[] qualifiers () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.qualifiers();
+    }
+
+    /**
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return The unique identity of the current coordinator.
+     */
+
+    public CoordinatorId identifier () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.identifier();
+    }
+
+    public static String className ()
+    {
+	return JTAHLSImple.class.getName();
+    }
+
+    private CoordinatorControl                   _coordManager;
+    private javax.transaction.UserTransaction    _userTransaction;
+    private javax.transaction.TransactionManager _transactionManager;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/sagas/arjunacore/SagasHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,298 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wscf.model.sagas.arjunacore;
+
+import com.arjuna.mw.wscf.model.sagas.api.*;
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+
+import com.arjuna.mw.wscf.common.Environment;
+
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mw.wscf.api.UserCoordinatorService;
+
+import com.arjuna.mw.wsas.context.Context;
+
+import com.arjuna.mw.wsas.ActivityManagerFactory;
+
+import com.arjuna.mw.wsas.activity.Outcome;
+import com.arjuna.mw.wsas.activity.HLS;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.HLSError;
+
+import com.arjuna.mw.wscf.exceptions.*;
+
+/**
+ * The ArjunaCore coordination service implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SagasHLSImple implements SagasHLS, UserCoordinatorService
+{
+
+    public SagasHLSImple ()
+    {
+	try
+	{
+	    ActivityManagerFactory.activityManager().addHLS((HLS) this);
+	}
+	catch (Exception ex)
+	{
+	    throw new HLSError(ex.toString());
+	}
+
+	_coordinatorService = new CoordinatorServiceImple();
+	_coordManager = new CoordinatorControl();
+    }
+    
+    public UserCoordinatorService coordinatorService ()
+    {
+	return this;
+    }
+    
+    public UserCoordinator userCoordinator ()
+    {
+	return _coordinatorService;
+    }
+    
+    public CoordinatorManager coordinatorManager ()
+    {
+	return _coordinatorService;
+    }
+    
+    /**
+     * An activity has begun and is active on the current thread.
+     */
+
+    public void begun () throws SystemException
+    {
+	_coordManager.begin();
+    }
+
+    /**
+     * The current activity is completing with the specified completion status.
+     *
+     * @param CompletionStatus cs The completion status to use.
+     *
+     * @return The result of terminating the relationship of this HLS and
+     * the current activity.
+     */
+
+    public Outcome complete (CompletionStatus cs) throws SystemException
+    {
+	return _coordManager.complete(cs);
+    }	
+
+    /**
+     * The activity has been suspended.
+     */
+
+    public void suspended () throws SystemException
+    {
+	_coordManager.suspend();
+    }	
+
+    /**
+     * The activity has been resumed on the current thread.
+     */
+
+    public void resumed () throws SystemException
+    {
+	_coordManager.resume();
+    }	
+
+    /**
+     * The activity has completed and is no longer active on the current
+     * thread.
+     */
+
+    public void completed () throws SystemException
+    {
+	_coordManager.completed();
+    }
+
+    /**
+     * The HLS name.
+     */
+
+    public String identity () throws SystemException
+    {
+	return "SagasHLSImple";
+    }
+
+    /**
+     * The activity service maintains a priority ordered list of HLS
+     * implementations. If an HLS wishes to be ordered based on priority
+     * then it can return a non-negative value: the higher the value,
+     * the higher the priority and hence the earlier in the list of HLSes
+     * it will appear (and be used in).
+     *
+     * @return a positive value for the priority for this HLS, or zero/negative
+     * if the order is not important.
+     */
+
+    public int priority () throws SystemException
+    {
+	return 0;
+    }
+
+    /**
+     * Return the context augmentation for this HLS, if any on the current
+     * activity.
+     *
+     * @param ActivityHierarchy current The handle on the current activity
+     * hierarchy. The HLS may use this when determining what information to
+     * place in its context data.
+     *
+     * @return a context object or null if no augmentation is necessary.
+     */
+
+    /*
+     * TODO This needs refactoring. It's true that the context format should
+     * be configurable to allow the same implementation to be used in
+     * different protocols (e.g., 2PC mapping to OTS or original Arjuna could
+     * use the same protocol implementation, but the context formats are
+     * different.) However, is this the best way of doing that?
+     */
+
+    public Context context () throws SystemException
+    {
+	String contextImple = System.getProperty(Environment.SAGAS_CONTEXT);
+
+	if (contextImple != null)
+	{
+	    try
+	    {
+		Class c = Class.forName(contextImple);
+		SOAPContext ctx = (SOAPContext) c.newInstance();
+		
+		ctx.initialiseContext(_coordManager.currentCoordinator());
+
+		return ctx;
+	    }
+	    catch (Exception ex)
+	    {
+		ex.printStackTrace();
+		
+		throw new SystemException(ex.toString());
+	    }
+	}
+	else
+	    return new com.arjuna.mwlabs.wscf.model.sagas.arjunacore.context.soap.ArjunaContextImple(_coordManager.currentCoordinator());
+    }
+
+    /**
+     * If the application requires and if the coordination protocol supports
+     * it, then this method can be used to execute a coordination protocol on
+     * the currently enlisted participants at any time prior to the termination
+     * of the coordination scope.
+     *
+     * This implementation only supports coordination at the end of the
+     * activity.
+     *
+     * @param CompletionStatus cs The completion status to use when determining
+     * how to execute the protocol.
+     *
+     * @exception WrongStateException Thrown if the coordinator is in a state
+     * the does not allow coordination to occur.
+     * @exception ProtocolViolationException Thrown if the protocol is violated
+     * in some manner during execution.
+     * @exception SystemException Thrown if any other error occurs.
+     *
+     * @return The result of executing the protocol, or null.
+     */
+
+    public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
+    {
+	return _coordManager.coordinate(cs);
+    }
+
+    /**
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the status of the current coordinator. If there is no
+     * activity associated with the thread then NoActivity
+     * will be returned.
+     *
+     * @see com.arjuna.mw.wsas.status.Status
+     */
+
+    public com.arjuna.mw.wsas.status.Status status () throws SystemException
+    {
+	return _coordManager.status();
+    }
+
+    /**
+     * Not supported by basic ArjunaCore.
+     *
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the complete list of qualifiers that have been registered with
+     * the current coordinator.
+     */
+    
+    public Qualifier[] qualifiers () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.qualifiers();
+    }
+
+    /**
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return The unique identity of the current coordinator.
+     */
+
+    public CoordinatorId identifier () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.identifier();
+    }
+
+    public static String className ()
+    {
+	return SagasHLSImple.class.getName();
+    }
+
+    private CoordinatorControl      _coordManager;
+    private CoordinatorServiceImple _coordinatorService;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/model/twophase/arjunacore/TwoPhaseHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,307 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wscf.model.twophase.arjunacore;
+
+import com.arjuna.mw.wscf.model.twophase.api.*;
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+
+import com.arjuna.mw.wscf.common.Environment;
+
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mw.wscf.api.UserCoordinatorService;
+
+import com.arjuna.mw.wsas.context.Context;
+
+import com.arjuna.mw.wsas.ActivityManagerFactory;
+
+import com.arjuna.mw.wsas.activity.Outcome;
+import com.arjuna.mw.wsas.activity.HLS;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.HLSError;
+
+import com.arjuna.mw.wscf.exceptions.*;
+
+/**
+ * The ArjunaCore coordination service implementation.
+ * 
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class TwoPhaseHLSImple implements TwoPhaseHLS, UserCoordinatorService
+{
+
+	public TwoPhaseHLSImple ()
+	{
+		try
+		{
+			ActivityManagerFactory.activityManager().addHLS((HLS) this);
+		}
+		catch (Exception ex)
+		{
+			throw new HLSError(ex.toString());
+		}
+
+		_coordinatorService = new CoordinatorServiceImple();
+		_coordManager = new CoordinatorControl();
+	}
+
+	public UserCoordinatorService coordinatorService ()
+	{
+		return this;
+	}
+
+	public UserCoordinator userCoordinator ()
+	{
+		return _coordinatorService;
+	}
+
+	public CoordinatorManager coordinatorManager ()
+	{
+		return _coordinatorService;
+	}
+
+	/**
+	 * An activity has begun and is active on the current thread.
+	 */
+
+	public void begun () throws SystemException
+	{
+		_coordManager.begin();
+	}
+
+	/**
+	 * The current activity is completing with the specified completion status.
+	 * 
+	 * @param CompletionStatus
+	 *            cs The completion status to use.
+	 * 
+	 * @return The result of terminating the relationship of this HLS and the
+	 *         current activity.
+	 */
+
+	public Outcome complete (CompletionStatus cs) throws SystemException
+	{
+		return _coordManager.complete(cs);
+	}
+
+	/**
+	 * The activity has been suspended.
+	 */
+
+	public void suspended () throws SystemException
+	{
+		_coordManager.suspend();
+	}
+
+	/**
+	 * The activity has been resumed on the current thread.
+	 */
+
+	public void resumed () throws SystemException
+	{
+		_coordManager.resume();
+	}
+
+	/**
+	 * The activity has completed and is no longer active on the current thread.
+	 */
+
+	public void completed () throws SystemException
+	{
+		_coordManager.completed();
+	}
+
+	/**
+	 * The HLS name.
+	 */
+
+	public String identity () throws SystemException
+	{
+		return "TwoPhaseHLSImple";
+	}
+
+	/**
+	 * The activity service maintains a priority ordered list of HLS
+	 * implementations. If an HLS wishes to be ordered based on priority then it
+	 * can return a non-negative value: the higher the value, the higher the
+	 * priority and hence the earlier in the list of HLSes it will appear (and
+	 * be used in).
+	 * 
+	 * @return a positive value for the priority for this HLS, or zero/negative
+	 *         if the order is not important.
+	 */
+
+	public int priority () throws SystemException
+	{
+		return 0;
+	}
+
+	/**
+	 * Return the context augmentation for this HLS, if any on the current
+	 * activity.
+	 * 
+	 * @param ActivityHierarchy
+	 *            current The handle on the current activity hierarchy. The HLS
+	 *            may use this when determining what information to place in its
+	 *            context data.
+	 * 
+	 * @return a context object or null if no augmentation is necessary.
+	 */
+
+	/*
+	 * TODO This needs refactoring. It's true that the context format should be
+	 * configurable to allow the same implementation to be used in different
+	 * protocols (e.g., 2PC mapping to OTS or original Arjuna could use the same
+	 * protocol implementation, but the context formats are different.) However,
+	 * is this the best way of doing that?
+	 */
+
+	public Context context () throws SystemException
+	{
+		String contextImple = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+
+		if (contextImple != null)
+		{
+			try
+			{
+				Class c = Class.forName(contextImple);
+				SOAPContext ctx = (SOAPContext) c.newInstance();
+
+				ctx.initialiseContext(_coordManager.currentCoordinator());
+
+				return ctx;
+			}
+			catch (Exception ex)
+			{
+				throw new SystemException(ex.toString());
+			}
+		}
+		else
+			return new com.arjuna.mwlabs.wscf.model.twophase.arjunacore.context.soap.ArjunaContextImple(
+					_coordManager.currentCoordinator());
+	}
+
+	/**
+	 * If the application requires and if the coordination protocol supports it,
+	 * then this method can be used to execute a coordination protocol on the
+	 * currently enlisted participants at any time prior to the termination of
+	 * the coordination scope.
+	 * 
+	 * This implementation only supports coordination at the end of the
+	 * activity.
+	 * 
+	 * @param CompletionStatus
+	 *            cs The completion status to use when determining how to
+	 *            execute the protocol.
+	 * 
+	 * @exception WrongStateException
+	 *                Thrown if the coordinator is in a state the does not allow
+	 *                coordination to occur.
+	 * @exception ProtocolViolationException
+	 *                Thrown if the protocol is violated in some manner during
+	 *                execution.
+	 * @exception SystemException
+	 *                Thrown if any other error occurs.
+	 * 
+	 * @return The result of executing the protocol, or null.
+	 */
+
+	public Outcome coordinate (CompletionStatus cs) throws WrongStateException,
+			ProtocolViolationException, SystemException
+	{
+		return _coordManager.coordinate(cs);
+	}
+
+	/**
+	 * @exception SystemException
+	 *                Thrown if any error occurs.
+	 * 
+	 * @return the status of the current coordinator. If there is no activity
+	 *         associated with the thread then NoActivity will be returned.
+	 * 
+	 * @see com.arjuna.mw.wsas.status.Status
+	 */
+
+	public com.arjuna.mw.wsas.status.Status status () throws SystemException
+	{
+		return _coordManager.status();
+	}
+
+	/**
+	 * Not supported by basic ArjunaCore.
+	 * 
+	 * @exception SystemException
+	 *                Thrown if any error occurs.
+	 * 
+	 * @return the complete list of qualifiers that have been registered with
+	 *         the current coordinator.
+	 */
+
+	public Qualifier[] qualifiers () throws NoCoordinatorException,
+			SystemException
+	{
+		return _coordManager.qualifiers();
+	}
+
+	/**
+	 * @exception SystemException
+	 *                Thrown if any error occurs.
+	 * 
+	 * @return The unique identity of the current coordinator.
+	 */
+
+	public CoordinatorId identifier () throws NoCoordinatorException,
+			SystemException
+	{
+		return _coordManager.identifier();
+	}
+
+	public static String className ()
+	{
+		return TwoPhaseHLSImple.class.getName();
+	}
+
+	private CoordinatorControl _coordManager;
+	private CoordinatorServiceImple _coordinatorService;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/protocols/Initializer.java (from rev 19476, labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mwlabs/wscf/protocols/Initializer.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/protocols/Initializer.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes10/com/arjuna/mwlabs/wscf/protocols/Initializer.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,103 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wscf.protocols;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.protocols.ProtocolManager;
+
+import com.arjuna.mw.wsas.exceptions.*;
+
+import com.arjuna.mwlabs.wscf.utils.*;
+
+/**
+ * Register all of the default coordination protocols with the system.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class Initializer
+{
+
+    public Initializer (ProtocolManager manager) throws SystemException
+    {
+	_manager = null;
+	
+	try
+	{
+	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
+	}
+	catch (java.io.FileNotFoundException ex)
+	{
+	}
+	catch (Exception ex)
+	{
+	}
+    }
+    
+    /**
+     * @message com.arjuna.mwlabs.wscf.protocols.Initializer_1 [com.arjuna.mwlabs.wscf.protocols.Initializer_1] - Failed to create: 
+     */
+
+    private final void addProtocol (String impl) throws SystemException
+    {
+	try
+	{
+	    // add in ArjunaCore support
+
+        Class clazz = this.getClass().getClassLoader().loadClass(impl);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		throw new SystemException(wscfLogger.log_mesg.getString("com.arjuna.mwlabs.wscf.protocols.Initializer_1")+impl);
+	    }
+	    else
+	    {
+		_manager.addProtocol(doc, impl);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	    
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private ProtocolManager _manager;
+    
+}
+

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/context/Context.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/context/Context.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/context/Context.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,17 @@
+package com.arjuna.mw.wsc11.context;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Context.java,v 1.1.24.1 2005/11/22 10:34:14 kconner Exp $
+ * @since 1.0.
+ */
+
+public interface Context
+{
+
+    public CoordinationContextType getCoordinationContext ();
+
+    public void setCoordinationContext (CoordinationContextType cc);
+}

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/deploy/WSCFInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/deploy/WSCFInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wsc11/deploy/WSCFInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,78 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wsc11.deploy;
+
+import com.arjuna.mw.wsas.utils.Configuration;
+import com.arjuna.mw.wscf.logging.wscfLogger;
+import com.arjuna.mwlabs.wsc11.ContextFactoryMapperImple;
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.wsc11.ContextFactoryMapper;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * Initialise WSCF.
+ * @author kevin
+ */
+public class WSCFInitialisation implements ServletContextListener
+{
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     *
+     * @message com.arjuna.mw.wsc11.deploy.WSCFI_1 [com.arjuna.mw.wsc11.deploy.WSCFI_1] - WSCF11 Initialisation: init failed:
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSCF11) {
+           public void run() {
+               try
+               {
+                   Configuration.initialise("/wscf11.xml");
+
+                   final ContextFactoryMapper WSCFImpl = ContextFactoryMapper.getFactory() ;
+
+                   WSCFImpl.setSubordinateContextFactoryMapper(new ContextFactoryMapperImple());
+               }
+               catch (Exception exception)
+               {
+                   wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc11.deploy.WSCFI_1", exception);
+               }
+               catch (Error error)
+               {
+                   wscfLogger.arjLoggerI18N.error("com.arjuna.mw.wsc11.deploy.WSCFI_1", error);
+               }
+           }
+        };
+        // this is the last WSCF callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSCF11);
+
+    }
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,171 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mwlabs.wscf.UserCoordinatorImple;
+
+import com.arjuna.mw.wscf11.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.UserCoordinator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+import java.io.FileNotFoundException;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.12 2005/05/19 12:13:20 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf11.UCF_1 [com.arjuna.mw.wscf11.UCF_1] - Failed to create {0} doc!
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.UCF_1",
+					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		UserCoordinatorImple coord = (UserCoordinatorImple) _implementations.get(protocolType);
+
+		if (coord == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    coord = new UserCoordinatorImple(implementation);
+
+		    _implementations.put(protocolType, coord);
+		}
+
+		return coord;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+    static
+    {
+	try
+	{
+	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf.xml");
+	}
+	catch (FileNotFoundException ex)
+	{
+	}
+	catch (Exception ex)
+	{
+	    throw new ExceptionInInitializerError(ex.toString());
+	}
+    }
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/common/Environment.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,46 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.common;
+
+/**
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Environment.java,v 1.6 2004/03/15 13:25:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class Environment
+{
+    public static final String PROTOCOL_IMPLEMENTATION = "com.arjuna.mw.wscf11.protocolImplementation";
+    public static final String TWO_PHASE_CONTEXT = "com.arjuna.mw.wscf11.protocols.twophase.context";
+    public static final String SAGAS_CONTEXT = "com.arjuna.mw.wscf11.protocols.sagas.context";
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,152 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.model.as;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mwlabs.wscf.model.as.CoordinatorManagerImple;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf11.protocols.*;
+import com.arjuna.mw.wscf.utils.DomUtil;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.model.as.CoordinatorManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.Hashtable;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.6 2005/03/10 15:37:03 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf11.model.as.CMF_1 [com.arjuna.mw.wscf11.model.as.CMF_1] - Failed to create
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.model.as.CMF_1",
+					      new Object[]{com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.ArjunaCoreHLS.class.getName()});
+	    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		CoordinatorManagerImple coord = (CoordinatorManagerImple) _implementations.get(protocolType);
+
+		if (coord == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    coord = new CoordinatorManagerImple(implementation);
+
+		    _implementations.put(protocolType, coord);
+		}
+
+		return coord;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static Hashtable       _implementations = new Hashtable();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,163 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.model.sagas;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf11.model.sagas.arjunacore.SagasHLSImple;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf11.model.sagas.CMF_1 [com.arjuna.mw.wscf11.model.sagas.CMF_1] - Failed to create
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.model.sagas.CMF_1",
+					      new Object[]{SagasHLSImple.className()});
+    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
+
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (SagasHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (SagasHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+
+		return coordHLS.coordinatorManager();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/sagas/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.model.sagas;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+import com.arjuna.mw.wscf.model.sagas.api.UserCoordinator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf11.model.sagas.arjunacore.SagasHLSImple;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.4 2005/05/19 12:13:23 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf1.model.sagas.UCF_1 [com.arjuna.mw.wscf11.model.sagas.UCF_1] - Failed to create
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(SagasHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.model.sagas.UCF_1",
+					      new Object[]{SagasHLSImple.className()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		SagasHLS coordHLS = (SagasHLS) _implementations.get(protocolType);
+
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (SagasHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (SagasHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+
+		return coordHLS.userCoordinator();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/CoordinatorManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/CoordinatorManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.model.twophase;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf11.model.twophase.arjunacore.TwoPhaseHLSImple;
+
+/**
+ * The factory to return the specific CoordinatorManager implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CoordinatorManagerFactory.java,v 1.8 2005/05/19 12:13:25 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CoordinatorManagerFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf11.model.twophase.CMF_1 [com.arjuna.mw.wscf11.model.twophase.CMF_1] - Failed to create
+     */
+
+    public static CoordinatorManager coordinatorManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.model.twophase.CMF_1",
+					      new Object[]{TwoPhaseHLSImple.className()});
+	    }
+	    else
+		return coordinatorManager(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static CoordinatorManager coordinatorManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
+
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (TwoPhaseHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (TwoPhaseHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+
+		return coordHLS.coordinatorManager();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/UserCoordinatorFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/UserCoordinatorFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/twophase/UserCoordinatorFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,162 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.model.twophase;
+
+import com.arjuna.mw.wscf.logging.wscfLogger;
+
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
+
+import java.util.HashMap;
+
+import com.arjuna.mwlabs.wscf11.model.twophase.arjunacore.TwoPhaseHLSImple;
+
+/**
+ * The factory which returns the UserCoordinator implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserCoordinatorFactory.java,v 1.6 2005/05/19 12:13:25 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserCoordinatorFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wscf11.model.twophase.UCF_1 [com.arjuna.mw.wscf11.model.twophase.UCF_1] - Failed to create
+     */
+
+    public static UserCoordinator userCoordinator () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseHLSImple.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wscfLogger.arjLoggerI18N.warn("com.arjuna.mw.wscf11.model.twophase.UCF_1",
+					      new Object[]{TwoPhaseHLSImple.className()});
+	    }
+	    else
+		return userCoordinator(doc);
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the CoordinatorManager implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserCoordinator userCoordinator (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, CoordinatorXSD.coordinatorType);
+		String protocolType = child.getNodeValue();
+		TwoPhaseHLS coordHLS = (TwoPhaseHLS) _implementations.get(protocolType);
+
+		if (coordHLS == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class c = Class.forName((String) implementation);
+
+			coordHLS = (TwoPhaseHLS) c.newInstance();
+		    }
+		    else
+			coordHLS = (TwoPhaseHLS) implementation;
+
+		    _implementations.put(protocolType, coordHLS);
+		}
+
+		return coordHLS.userCoordinator();
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,448 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ProtocolManager.java,v 1.13 2005/05/19 12:13:28 nmcl Exp $
+ */
+
+package com.arjuna.mw.wscf11.protocols;
+
+import com.arjuna.mw.wscf11.common.Environment;
+import com.arjuna.mw.wscf.exceptions.ProtocolAlreadyRegisteredException;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.exceptions.UnknownProtocolImplementationException;
+import com.arjuna.mw.wscf.logging.wscfLogger;
+import com.arjuna.mw.wscf.utils.CoordinationXML;
+import com.arjuna.mwlabs.wscf11.protocols.Initializer;
+import com.arjuna.mwlabs.wscf.protocols.ProtocolEntry;
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.Vector;
+
+/**
+ * The ProtocolManager is the way in which protocol implementations may be
+ * registered with the system.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id:$
+ * @since 1.0.
+ */
+
+public class ProtocolManager
+{
+
+	/**
+	 * Add a specific protocol implementation to the factory. More than one
+	 * implementation may provide the same protocol. They may differ by
+	 * coordinator-name only.
+	 *
+	 * @param     protocol The XML definition of the protocol.
+	 * @param     className The name of the class that implements the specified
+	 *            protocol.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolAlreadyRegisteredException
+	 *                Thrown if the exact same protocol definition has already
+	 *                been registered.
+	 * @exception IllegalArgumentException
+	 *                Thrown if either of the parameters is invalid.
+	 */
+
+	public void addProtocol (org.w3c.dom.Document protocol, Object className)
+			throws ProtocolAlreadyRegisteredException,
+			IllegalArgumentException
+	{
+		if ((protocol == null) || (className == null))
+			throw new IllegalArgumentException();
+
+		if (present(protocol))
+			throw new ProtocolAlreadyRegisteredException();
+		else
+		{
+			ProtocolEntry e = new ProtocolEntry(protocol, className);
+			Vector impls = (Vector) _protocols.get(e.protocolType());
+
+			if (impls == null)
+			{
+				impls = new Vector();
+
+				_protocols.put(e.protocolType(), impls);
+			}
+
+			impls.add(e);
+		}
+	}
+
+	/**
+	 * Replace a specific protocol implementation in the factory.
+	 *
+	 * @param     protocol The XML definition of the protocol.
+	 * @param     className The name of the class that implements the specified
+	 *            protocol.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
+	 *                Thrown if the protocol to be removed has not been
+	 *                registered.
+	 * @exception IllegalArgumentException
+	 *                Thrown if either of the parameters is invalid.
+	 */
+
+	public void replaceProtocol (org.w3c.dom.Document protocol, Object className)
+			throws ProtocolNotRegisteredException, IllegalArgumentException
+	{
+		synchronized (this)
+		{
+			CoordinationXML protocolDef = new CoordinationXML(protocol);
+			Vector impls = (Vector) _protocols.get(protocolDef.protocolType());
+			boolean found = false;
+
+			if (impls != null)
+			{
+				for (int i = 0; (i < impls.size()) && !found; i++)
+				{
+					ProtocolEntry entry = (ProtocolEntry) impls.elementAt(i);
+
+					// currently replaces only on type: should be exact match!
+
+					if (sameProtocolType(entry, protocolDef))
+					{
+						impls.remove(entry);
+
+						try
+						{
+							addProtocol(protocol, className);
+						}
+						catch (Exception ex)
+						{
+							throw new IllegalArgumentException(ex.toString());
+						}
+
+						found = true;
+					}
+				}
+			}
+
+			if (!found)
+				throw new ProtocolNotRegisteredException();
+		}
+	}
+
+	/**
+	 * @param     protocol The XML definition of the coordination protocol.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
+	 *                Thrown if the requested coordination protocol has not been
+	 *                registered.
+	 * @exception IllegalArgumentException
+	 *                Thrown if the parameter is invalid.
+	 *
+	 * @return The class that implements the specified coordination protocol.
+	 *
+	 * @message com.arjuna.mw.wscf11.protocols.ProtocolManager_1
+	 *          [com.arjuna.mw.wscf11.protocols.ProtocolManager_1] - Could not
+	 *          find protocol:
+	 */
+
+	public Object getProtocolImplementation (org.w3c.dom.Document protocol)
+			throws ProtocolNotRegisteredException, IllegalArgumentException
+	{
+		/*
+		 * Only checks the coordination-type via the hashtable. Now we need to
+		 * check the coordination-name.
+		 */
+
+		CoordinationXML protocolDef = new CoordinationXML(protocol);
+		Vector impls = (Vector) _protocols.get(protocolDef.protocolType());
+
+		if (impls != null)
+		{
+			for (int i = 0; i < impls.size(); i++)
+			{
+				ProtocolEntry entry = (ProtocolEntry) impls.elementAt(i);
+
+				if (sameProtocolType(entry, protocolDef))
+				{
+					return entry.implementationClass();
+				}
+			}
+		}
+
+		throw new ProtocolNotRegisteredException(
+				wscfLogger.log_mesg.getString("com.arjuna.mw.wscf11.protocols.ProtocolManager_1")
+						+ protocolDef.protocolType());
+	}
+
+	/**
+	 * Remove the specified protocol definition from the factory.
+	 *
+	 * @param     protocol The XML definition of the coordination protocol.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException
+	 *                Thrown if the protocol to be removed has not been
+	 *                registered.
+	 * @exception IllegalArgumentException
+	 *                Thrown if the paramater is invalid (e.g., null).
+	 *
+	 * @return the protocol implementation removed.
+	 */
+
+	public Object removeProtocol (org.w3c.dom.Document protocol)
+			throws ProtocolNotRegisteredException, IllegalArgumentException
+	{
+		CoordinationXML protocolDef = new CoordinationXML(protocol);
+		Vector impls = (Vector) _protocols.get(protocolDef.protocolType());
+
+		if (impls != null)
+		{
+			for (int i = 0; i < impls.size(); i++)
+			{
+				ProtocolEntry entry = (ProtocolEntry) impls.elementAt(i);
+
+				if (sameProtocol(entry, protocolDef))
+				{
+					impls.remove(entry);
+
+					return entry.implementationClass();
+				}
+			}
+		}
+
+		throw new ProtocolNotRegisteredException();
+	}
+
+	/*
+	 * Do we need this?
+	 */
+
+	/**
+	 * Remove the specified coordination protocol implementation class from the
+	 * factory.
+	 *
+	 * @param     className The class to remove.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.UnknownProtocolImplementationException
+	 *                Thrown if the specified implementation class has not been
+	 *                registered.
+	 * @exception IllegalArgumentException
+	 *                Thrown if the parameter is invalid.
+	 *
+	 * @return the protocol implementation removed.
+	 */
+
+	public Object removeProtocolImplementation (Object className)
+			throws UnknownProtocolImplementationException,
+			IllegalArgumentException
+	{
+		throw new UnknownProtocolImplementationException();
+	}
+
+	/**
+	 * Is the document present exactly as it appears, i.e., even the name is the
+	 * same?
+	 *
+	 * @param     protocol The XML definition of the coordination protocol.
+	 *
+	 * @exception IllegalArgumentException
+	 *                Thrown if the parameter is invalid (e.g., null).
+	 *
+	 * @return <code>true</code> if there is an exact match for the specified
+	 *         protocol, <code>false</code> otherwise.
+	 */
+
+	public final boolean present (org.w3c.dom.Document protocol)
+			throws IllegalArgumentException
+	{
+		/*
+		 * Only checks the coordination-type via the hashtable. Now we need to
+		 * check the coordination-name.
+		 */
+
+		boolean found = false;
+
+		CoordinationXML protocolDef = new CoordinationXML(protocol);
+		Vector impls = (Vector) _protocols.get(protocolDef.protocolType());
+
+		if (impls != null)
+		{
+			for (int i = 0; (i < impls.size()) && !found; i++)
+			{
+				ProtocolEntry entry = (ProtocolEntry) impls.elementAt(i);
+
+				if (sameProtocolType(entry, protocolDef))
+					found = true;
+			}
+		}
+
+		return found;
+	}
+
+	/**
+	 * Is the document present but with a different name?
+	 *
+	 * @param     protocol The XML definition of the coordination protocol.
+	 *
+	 * @exception IllegalArgumentException
+	 *                Thrown if the parameter is invalid (e.g., null).
+	 *
+	 * @return <code>true</code> if there is at match for the specified
+	 *         protocol, <code>false</code> otherwise.
+	 */
+
+	public final boolean presentWithDifferentName (org.w3c.dom.Document protocol)
+			throws IllegalArgumentException
+	{
+		/*
+		 * Check the registered protocols and if the types are the same but
+		 * differ by name (essentially who implemented them) then they are not
+		 * identical.
+		 */
+
+		boolean found = false;
+		CoordinationXML protocolDef = new CoordinationXML(protocol);
+		Vector impls = (Vector) _protocols.get(protocolDef.protocolType());
+
+		if (impls != null)
+		{
+			if (protocolDef.protocolName() != null)
+			{
+				for (int i = 0; (i < impls.size()) && !found; i++)
+				{
+					ProtocolEntry entry = (ProtocolEntry) impls.elementAt(i);
+
+					if (sameProtocol(entry, protocolDef))
+						found = true;
+				}
+			}
+			else
+				found = true; // any will do
+		}
+
+		return found;
+	}
+
+	protected ProtocolManager()
+	{
+		initialise();
+	}
+
+	private final boolean sameProtocolType (ProtocolEntry pe, CoordinationXML cx)
+	{
+		if (pe.protocolType() != null)
+		{
+			if (cx.protocolType() != null)
+			{
+				return cx.protocolType().equals(pe.protocolType());
+			}
+		}
+
+		return false;
+	}
+
+	private final boolean sameProtocol (ProtocolEntry pe, CoordinationXML cx)
+	{
+		if (sameProtocolType(pe, cx))
+		{
+			if (pe.protocolName() != null)
+			{
+				if (cx.protocolName() != null)
+					return cx.protocolName().equals(pe.protocolName());
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * @message com.arjuna.mw.wscf11.protocols.ProtocolManager_2
+	 *          [com.arjuna.mw.wscf11.protocols.ProtocolManager_2] - Failed to
+	 *          find document:
+	 */
+
+	private synchronized final void initialise ()
+	{
+		if (_initialised)
+			return;
+		else
+			_initialised = true;
+
+		// TODO sort out configuration!
+
+		try
+		{
+			Initializer init = new Initializer(this);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+
+		Properties props = System.getProperties();
+		Enumeration names = props.propertyNames();
+
+		while (names.hasMoreElements())
+		{
+			String name = (String) names.nextElement();
+
+			if (name.startsWith(Environment.PROTOCOL_IMPLEMENTATION))
+			{
+				String className = props.getProperty(name);
+
+				try
+				{
+                    Class clazz = this.getClass().getClassLoader().loadClass(className);
+					ProtocolLocator pl = new ProtocolLocator(clazz);
+					org.w3c.dom.Document doc = pl.getProtocol();
+
+					if (doc == null)
+					{
+						// TODO
+
+						throw new ExceptionInInitializerError(
+								wscfLogger.log_mesg.getString("com.arjuna.mw.wscf11.protocols.ProtocolManager_2")
+										+ className);
+					}
+					else
+					{
+						addProtocol(doc, className);
+					}
+				}
+				catch (Exception ex)
+				{
+					ex.printStackTrace();
+
+					throw new ExceptionInInitializerError(ex.toString());
+				}
+			}
+		}
+	}
+
+	private HashMap _protocols = new HashMap();
+	private boolean _initialised = false;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolRegistry.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolRegistry.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/protocols/ProtocolRegistry.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id:$
+ */
+
+package com.arjuna.mw.wscf11.protocols;
+
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ProtocolRegistry.java,v 1.2 2003/03/04 12:55:56 nmcl Exp $
+ * @since 1.0.
+ */
+
+// TODO we need a separate instance for WSTX
+
+public class ProtocolRegistry
+{
+
+    public static ProtocolManager sharedManager ()
+    {
+	return _shared;
+    }
+
+    public static ProtocolManager createManager ()
+    {
+	return new ProtocolManager();
+    }
+
+    private static ProtocolManager _shared = new ProtocolManager();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wsc11/ContextFactoryMapperImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wsc11/ContextFactoryMapperImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wsc11/ContextFactoryMapperImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,177 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextFactoryMapperImple.java,v 1.12.4.1 2005/11/22 10:34:09 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wsc11;
+
+import com.arjuna.mw.wscf.common.CoordinatorXSD;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
+import com.arjuna.wsc11.ContextFactoryMapper;
+import com.arjuna.wsc11.ContextFactory;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ContextFactoryMapperImple.java,v 1.11 2004/08/10 15:10:27
+ *          kconner Exp $
+ * @since 1.0.
+ */
+
+public class ContextFactoryMapperImple extends ContextFactoryMapper
+{
+
+	public ContextFactoryMapperImple()
+	{
+		_protocols = ProtocolRegistry.createManager();
+	}
+
+	public void addContextFactory (String coordinationTypeURI, ContextFactory contextFactory)
+	{
+		try
+		{
+			_protocols.addProtocol(convert(coordinationTypeURI), contextFactory);
+
+			contextFactory.install(coordinationTypeURI);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	public void removeContextFactory (String coordinationTypeURI)
+	{
+		try
+		{
+			ContextFactory contextFactory = (ContextFactory) _protocols.removeProtocol(convert(coordinationTypeURI));
+
+			contextFactory.uninstall(coordinationTypeURI);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	/*
+	 * The factory implementation must initialise the activity service with the
+	 * correct HLS.
+	 */
+
+	public ContextFactory getContextFactory (String coordinationTypeURI)
+	{
+		try
+		{
+			org.w3c.dom.Document doc = convert(coordinationTypeURI);
+			Object type = _protocols.getProtocolImplementation(convert(coordinationTypeURI));
+
+			if (type instanceof String)
+			{
+				Class c = Class.forName((String) type);
+
+				ContextFactory factory = (ContextFactory) c.newInstance();
+
+				_protocols.replaceProtocol(doc, factory);
+
+				return factory;
+			}
+			else
+			{
+				return (ContextFactory) type;
+			}
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+
+		return null;
+	}
+
+	public void setSubordinateContextFactoryMapper (ContextFactoryMapper subordinateContextFactoryMapper)
+	{
+	}
+
+	public ContextFactoryMapper getSubordinateContextFactoryMapper ()
+	{
+		return null;
+	}
+
+	public void setDefaultContextFactory (ContextFactory defaultContextFactory)
+	{
+	}
+
+	public ContextFactory getDefaultContextFactory ()
+	{
+		return null;
+	}
+
+	private org.w3c.dom.Document convert (String coordinationTypeURI)
+			throws Exception
+	{
+		DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+		DocumentBuilder builder = factory.newDocumentBuilder();
+		org.w3c.dom.Document doc = builder.newDocument();
+		org.w3c.dom.Element rootElement = doc.createElement(_wscRootElement);
+		org.w3c.dom.Element elem = doc.createElement(CoordinatorXSD.coordinatorType);
+
+		elem.appendChild(doc.createTextNode(coordinationTypeURI));
+
+		rootElement.appendChild(elem);
+
+		doc.appendChild(rootElement);
+
+		return doc;
+	}
+
+	private void writeObject (java.io.ObjectOutputStream objectOutputStream)
+			throws java.io.IOException
+	{
+	}
+
+	private void readObject (java.io.ObjectInputStream objectInputStream)
+			throws java.io.IOException, ClassNotFoundException
+	{
+	}
+
+	public static final String localName ()
+	{
+		// return "com/arjuna/mwlabs/wsc/contextfactorymapper";
+		return "comarjunamwlabswsccontextfactorymapperws";
+	}
+
+	private ProtocolManager _protocols;
+
+	private static final String _wscRootElement = "WS-C";
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/sagas/arjunacore/SagasHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,291 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wscf11.model.sagas.arjunacore;
+
+import com.arjuna.mw.wscf.model.sagas.api.*;
+import com.arjuna.mw.wscf.model.sagas.hls.SagasHLS;
+
+import com.arjuna.mw.wscf11.common.Environment;
+
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mw.wscf.api.UserCoordinatorService;
+
+import com.arjuna.mw.wsas.context.Context;
+
+import com.arjuna.mw.wsas.ActivityManagerFactory;
+
+import com.arjuna.mw.wsas.activity.Outcome;
+import com.arjuna.mw.wsas.activity.HLS;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.HLSError;
+
+import com.arjuna.mw.wscf.exceptions.*;
+import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.CoordinatorServiceImple;
+import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.CoordinatorControl;
+
+/**
+ * The ArjunaCore coordination service implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SagasHLSImple.java,v 1.3.4.1 2005/11/22 10:34:09 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SagasHLSImple implements SagasHLS, UserCoordinatorService
+{
+
+    public SagasHLSImple()
+    {
+	try
+	{
+	    ActivityManagerFactory.activityManager().addHLS((HLS) this);
+	}
+	catch (Exception ex)
+	{
+	    throw new HLSError(ex.toString());
+	}
+
+	_coordinatorService = new CoordinatorServiceImple();
+	_coordManager = new CoordinatorControl();
+    }
+
+    public UserCoordinatorService coordinatorService ()
+    {
+	return this;
+    }
+
+    public UserCoordinator userCoordinator ()
+    {
+	return _coordinatorService;
+    }
+
+    public CoordinatorManager coordinatorManager ()
+    {
+	return _coordinatorService;
+    }
+
+    /**
+     * An activity has begun and is active on the current thread.
+     */
+
+    public void begun () throws SystemException
+    {
+	_coordManager.begin();
+    }
+
+    /**
+     * The current activity is completing with the specified completion status.
+     *
+     * @param cs The completion status to use.
+     *
+     * @return The result of terminating the relationship of this HLS and
+     * the current activity.
+     */
+
+    public Outcome complete (CompletionStatus cs) throws SystemException
+    {
+	return _coordManager.complete(cs);
+    }
+
+    /**
+     * The activity has been suspended.
+     */
+
+    public void suspended () throws SystemException
+    {
+	_coordManager.suspend();
+    }
+
+    /**
+     * The activity has been resumed on the current thread.
+     */
+
+    public void resumed () throws SystemException
+    {
+	_coordManager.resume();
+    }
+
+    /**
+     * The activity has completed and is no longer active on the current
+     * thread.
+     */
+
+    public void completed () throws SystemException
+    {
+	_coordManager.completed();
+    }
+
+    /**
+     * The HLS name.
+     */
+
+    public String identity () throws SystemException
+    {
+	return "SagasHLSImple";
+    }
+
+    /**
+     * The activity service maintains a priority ordered list of HLS
+     * implementations. If an HLS wishes to be ordered based on priority
+     * then it can return a non-negative value: the higher the value,
+     * the higher the priority and hence the earlier in the list of HLSes
+     * it will appear (and be used in).
+     *
+     * @return a positive value for the priority for this HLS, or zero/negative
+     * if the order is not important.
+     */
+
+    public int priority () throws SystemException
+    {
+	return 0;
+    }
+
+    /**
+     * Return the context augmentation for this HLS, if any on the current
+     * activity.
+     *
+     * @return a context object or null if no augmentation is necessary.
+     */
+
+    /*
+     * TODO This needs refactoring. It's true that the context format should
+     * be configurable to allow the same implementation to be used in
+     * different protocols (e.g., 2PC mapping to OTS or original Arjuna could
+     * use the same protocol implementation, but the context formats are
+     * different.) However, is this the best way of doing that?
+     */
+
+    public Context context () throws SystemException
+    {
+        String contextImple = System.getProperty(Environment.SAGAS_CONTEXT);
+
+        if (contextImple != null) {
+            try {
+                Class c = Class.forName(contextImple);
+                SOAPContext ctx = (SOAPContext) c.newInstance();
+
+                ctx.initialiseContext(_coordManager.currentCoordinator());
+
+                return ctx;
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                throw new SystemException(ex.toString());
+            }
+        } else {
+            throw new SystemException("SAGAS 1.1 context implementation must be specified by setting environment property " + Environment.SAGAS_CONTEXT);
+        }
+    }
+
+    /**
+     * If the application requires and if the coordination protocol supports
+     * it, then this method can be used to execute a coordination protocol on
+     * the currently enlisted participants at any time prior to the termination
+     * of the coordination scope.
+     *
+     * This implementation only supports coordination at the end of the
+     * activity.
+     *
+     * @param cs The completion status to use when determining
+     * how to execute the protocol.
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the coordinator is in a state
+     * the does not allow coordination to occur.
+     * @exception com.arjuna.mw.wsas.exceptions.ProtocolViolationException Thrown if the protocol is violated
+     * in some manner during execution.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     *
+     * @return The result of executing the protocol, or null.
+     */
+
+    public Outcome coordinate (CompletionStatus cs) throws WrongStateException, ProtocolViolationException, SystemException
+    {
+	return _coordManager.coordinate(cs);
+    }
+
+    /**
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs.
+     *
+     * @return the status of the current coordinator. If there is no
+     * activity associated with the thread then NoActivity
+     * will be returned.
+     *
+     * @see com.arjuna.mw.wsas.status.Status
+     */
+
+    public com.arjuna.mw.wsas.status.Status status () throws SystemException
+    {
+	return _coordManager.status();
+    }
+
+    /**
+     * Not supported by basic ArjunaCore.
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs.
+     *
+     * @return the complete list of qualifiers that have been registered with
+     * the current coordinator.
+     */
+
+    public Qualifier[] qualifiers () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.qualifiers();
+    }
+
+    /**
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs.
+     *
+     * @return The unique identity of the current coordinator.
+     */
+
+    public CoordinatorId identifier () throws NoCoordinatorException, SystemException
+    {
+	return _coordManager.identifier();
+    }
+
+    public static String className ()
+    {
+    	return SagasHLSImple.class.getName();
+    }
+
+    private CoordinatorControl      _coordManager;
+    private CoordinatorServiceImple _coordinatorService;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/model/twophase/arjunacore/TwoPhaseHLSImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,296 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wscf11.model.twophase.arjunacore;
+
+import com.arjuna.mw.wscf.model.twophase.api.*;
+import com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS;
+
+import com.arjuna.mw.wscf11.common.Environment;
+
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mw.wscf.api.UserCoordinatorService;
+
+import com.arjuna.mw.wsas.context.Context;
+
+import com.arjuna.mw.wsas.ActivityManagerFactory;
+
+import com.arjuna.mw.wsas.activity.Outcome;
+import com.arjuna.mw.wsas.activity.HLS;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.HLSError;
+
+import com.arjuna.mw.wscf.exceptions.*;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorServiceImple;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorControl;
+
+/**
+ * The ArjunaCore coordination service implementation.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TwoPhaseHLSImple.java,v 1.6.4.1 2005/11/22 10:34:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class TwoPhaseHLSImple implements TwoPhaseHLS, UserCoordinatorService
+{
+
+	public TwoPhaseHLSImple()
+	{
+		try
+		{
+			ActivityManagerFactory.activityManager().addHLS((HLS) this);
+		}
+		catch (Exception ex)
+		{
+			throw new HLSError(ex.toString());
+		}
+
+		_coordinatorService = new CoordinatorServiceImple();
+		_coordManager = new CoordinatorControl();
+	}
+
+	public UserCoordinatorService coordinatorService ()
+	{
+		return this;
+	}
+
+	public UserCoordinator userCoordinator ()
+	{
+		return _coordinatorService;
+	}
+
+	public CoordinatorManager coordinatorManager ()
+	{
+		return _coordinatorService;
+	}
+
+	/**
+	 * An activity has begun and is active on the current thread.
+	 */
+
+	public void begun () throws SystemException
+	{
+		_coordManager.begin();
+	}
+
+	/**
+	 * The current activity is completing with the specified completion status.
+	 *
+	 * @param cs The completion status to use.
+	 *
+	 * @return The result of terminating the relationship of this HLS and the
+	 *         current activity.
+	 */
+
+	public Outcome complete (CompletionStatus cs) throws SystemException
+	{
+		return _coordManager.complete(cs);
+	}
+
+	/**
+	 * The activity has been suspended.
+	 */
+
+	public void suspended () throws SystemException
+	{
+		_coordManager.suspend();
+	}
+
+	/**
+	 * The activity has been resumed on the current thread.
+	 */
+
+	public void resumed () throws SystemException
+	{
+		_coordManager.resume();
+	}
+
+	/**
+	 * The activity has completed and is no longer active on the current thread.
+	 */
+
+	public void completed () throws SystemException
+	{
+		_coordManager.completed();
+	}
+
+	/**
+	 * The HLS name.
+	 */
+
+	public String identity () throws SystemException
+	{
+		return "TwoPhaseHLSImple";
+	}
+
+	/**
+	 * The activity service maintains a priority ordered list of HLS
+	 * implementations. If an HLS wishes to be ordered based on priority then it
+	 * can return a non-negative value: the higher the value, the higher the
+	 * priority and hence the earlier in the list of HLSes it will appear (and
+	 * be used in).
+	 *
+	 * @return a positive value for the priority for this HLS, or zero/negative
+	 *         if the order is not important.
+	 */
+
+	public int priority () throws SystemException
+	{
+		return 0;
+	}
+
+	/**
+	 * Return the context augmentation for this HLS, if any on the current
+	 * activity.
+	 *
+	 * @return a context object or null if no augmentation is necessary.
+	 */
+
+	/*
+	 * TODO This needs refactoring. It's true that the context format should be
+	 * configurable to allow the same implementation to be used in different
+	 * protocols (e.g., 2PC mapping to OTS or original Arjuna could use the same
+	 * protocol implementation, but the context formats are different.) However,
+	 * is this the best way of doing that?
+	 */
+
+	public Context context () throws SystemException
+	{
+		String contextImple = System.getProperty(Environment.TWO_PHASE_CONTEXT);
+
+		if (contextImple != null){
+			try {
+				Class c = Class.forName(contextImple);
+				SOAPContext ctx = (SOAPContext) c.newInstance();
+
+				ctx.initialiseContext(_coordManager.currentCoordinator());
+
+				return ctx;
+			} catch (Exception ex) {
+				throw new SystemException(ex.toString());
+			}
+		} else {
+            throw new SystemException("Two Phase 1.1 context implementation must be specified by setting environment property " + Environment.TWO_PHASE_CONTEXT);
+        }
+    }
+	/**
+	 * If the application requires and if the coordination protocol supports it,
+	 * then this method can be used to execute a coordination protocol on the
+	 * currently enlisted participants at any time prior to the termination of
+	 * the coordination scope.
+	 *
+	 * This implementation only supports coordination at the end of the
+	 * activity.
+	 *
+	 * @param cs The completion status to use when determining how to
+	 *            execute the protocol.
+	 *
+	 * @exception com.arjuna.mw.wsas.exceptions.WrongStateException
+	 *                Thrown if the coordinator is in a state the does not allow
+	 *                coordination to occur.
+	 * @exception com.arjuna.mw.wsas.exceptions.ProtocolViolationException
+	 *                Thrown if the protocol is violated in some manner during
+	 *                execution.
+	 * @exception com.arjuna.mw.wsas.exceptions.SystemException
+	 *                Thrown if any other error occurs.
+	 *
+	 * @return The result of executing the protocol, or null.
+	 */
+
+	public Outcome coordinate (CompletionStatus cs) throws WrongStateException,
+			ProtocolViolationException, SystemException
+	{
+		return _coordManager.coordinate(cs);
+	}
+
+	/**
+	 * @exception com.arjuna.mw.wsas.exceptions.SystemException
+	 *                Thrown if any error occurs.
+	 *
+	 * @return the status of the current coordinator. If there is no activity
+	 *         associated with the thread then NoActivity will be returned.
+	 *
+	 * @see com.arjuna.mw.wsas.status.Status
+	 */
+
+	public com.arjuna.mw.wsas.status.Status status () throws SystemException
+	{
+		return _coordManager.status();
+	}
+
+	/**
+	 * Not supported by basic ArjunaCore.
+	 *
+	 * @exception com.arjuna.mw.wsas.exceptions.SystemException
+	 *                Thrown if any error occurs.
+	 *
+	 * @return the complete list of qualifiers that have been registered with
+	 *         the current coordinator.
+	 */
+
+	public Qualifier[] qualifiers () throws NoCoordinatorException,
+			SystemException
+	{
+		return _coordManager.qualifiers();
+	}
+
+	/**
+	 * @exception com.arjuna.mw.wsas.exceptions.SystemException
+	 *                Thrown if any error occurs.
+	 *
+	 * @return The unique identity of the current coordinator.
+	 */
+
+	public CoordinatorId identifier () throws NoCoordinatorException,
+			SystemException
+	{
+		return _coordManager.identifier();
+	}
+
+	public static String className ()
+	{
+		return TwoPhaseHLSImple.class.getName();
+	}
+
+	private CoordinatorControl _coordManager;
+	private CoordinatorServiceImple _coordinatorService;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mwlabs/wscf11/protocols/Initializer.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,99 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wscf11.protocols;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.logging.wscfLogger;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+/**
+ * Register all of the default coordination protocols with the system.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Initializer.java,v 1.7 2005/05/19 12:13:39 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class Initializer
+{
+
+    public Initializer(ProtocolManager manager) throws SystemException
+    {
+	_manager = null;
+
+	try
+	{
+	    com.arjuna.mw.wsas.utils.Configuration.initialise("/wscf11.xml");
+	}
+	catch (java.io.FileNotFoundException ex)
+	{
+	}
+	catch (Exception ex)
+	{
+	}
+    }
+
+    /**
+     * @message com.arjuna.mwlabs.wscf11.protocols.Initializer_1 [com.arjuna.mwlabs.wscf11.protocols.Initializer_1] - Failed to create:
+     */
+
+    private final void addProtocol (String impl) throws SystemException
+    {
+	try
+	{
+	    // add in ArjunaCore support
+
+        Class clazz = this.getClass().getClassLoader().loadClass(impl);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		throw new SystemException(wscfLogger.log_mesg.getString("com.arjuna.mwlabs.wscf11.protocols.Initializer_1")+impl);
+	    }
+	    else
+	    {
+		_manager.addProtocol(doc, impl);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private ProtocolManager _manager;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/config/wscf11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/config/wscf11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/config/wscf11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,45 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<wscf-config>
+	<properties>
+        <property name="com.arjuna.mw.wscf11.protocols.twophase.context"
+        value="com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple"/>
+        <property name="com.arjuna.mw.wscf11.protocols.sagas.context"
+        value="com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf11.protocolImplementation1"
+	    value="com.arjuna.mwlabs.wscf11.model.twophase.arjunacore.TwoPhaseHLSImple"/>
+	    <property
+	    name="com.arjuna.mw.wscf11.protocolImplementation2"
+	    value="com.arjuna.mwlabs.wscf11.model.sagas.arjunacore.SagasHLSImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation3"
+        value="com.arjuna.mwlabs.wst11.at.ContextFactoryImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation4"
+        value="com.arjuna.mwlabs.wst11.ba.ContextFactoryImple"/>
+
+	    <property
+	    name="com.arjuna.ats.arjuna.objectstore.objectStoreDir"
+	    value="XTSObjectStore"/>
+	</properties>
+</wscf-config>

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel1.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel1.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel1.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -81,7 +81,8 @@
 
 	    org.w3c.dom.Document implementationDoc = null;
 	
-        ProtocolLocator pl = new ProtocolLocator(testProtocolClassName);
+        Class clazz = this.getClass().getClassLoader().loadClass(testProtocolClassName);
+        ProtocolLocator pl = new ProtocolLocator(clazz);
 
         implementationDoc = pl.getProtocol();
 

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel2.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel2.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel2.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -69,7 +69,8 @@
 	
 	try
 	{
-	    ProtocolLocator pl = new ProtocolLocator(className);
+        Class clazz = this.getClass().getClassLoader().loadClass(className);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
 
 	    implementationDoc = pl.getProtocol();
 	}

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel3.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel3.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/as/jta/TopLevel3.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -70,7 +70,8 @@
 	
 	try
 	{
-	    ProtocolLocator pl = new ProtocolLocator(className);
+        Class clazz = this.getClass().getClassLoader().loadClass(className);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
 
 	    implementationDoc = pl.getProtocol();
 	}

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/junit/model/twophase/StartEnd.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -64,7 +64,8 @@
 	
 	//	System.setProperty("com.arjuna.mw.wscf.protocolImplementation", className);
 	
-	    ProtocolLocator pl = new ProtocolLocator(className);
+        Class clazz = this.getClass().getClassLoader().loadClass(className);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
 
 	    implementationDoc = pl.getProtocol();
 

Added: labs/jbosstm/trunk/XTS/WSCF/xml/Sagas11HLSImple.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/xml/Sagas11HLSImple.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/xml/Sagas11HLSImple.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,23 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+<coordination-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\mlittle\Desktop\standards work\WS architecture\WSCF\0.8.2\xml\WSCF.xsd">
+<coordinator-type>urn:tx-sagas11-commit</coordinator-type>
+</coordination-type>

Added: labs/jbosstm/trunk/XTS/WSCF/xml/TwoPhase11HLSImple.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/xml/TwoPhase11HLSImple.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/xml/TwoPhase11HLSImple.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,23 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+<coordination-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\mlittle\Desktop\standards work\WS architecture\WSCF\0.8.2\xml\WSCF.xsd">
+<coordinator-type>urn:tx-two-phase11-commit</coordinator-type>
+</coordination-type>

Added: labs/jbosstm/trunk/XTS/WSCF/xml/wscf11_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/xml/wscf11_web-app.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/xml/wscf11_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,32 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Arjuna WS-CF11</display-name>
+
+    <description>Arjuna WS-CF11</description>
+
+    <listener>
+        <listener-class>com.arjuna.mw.wsc11.deploy.WSCFInitialisation</listener-class>
+    </listener>
+</web-app>

Modified: labs/jbosstm/trunk/XTS/WSCF/xml/wscf_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/xml/wscf_web-app.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSCF/xml/wscf_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -19,7 +19,7 @@
   @author JBoss Inc.
 -->
 
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtd/web-app_2_3.dtd">
 
 <web-app>
     <display-name>Arjuna WS-CF</display-name>

Modified: labs/jbosstm/trunk/XTS/WSTX/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -36,9 +36,13 @@
 	<property name="port" value="8080"/>
 
 	<!-- Path names -->
-	<property name="com.arjuna.mwlabs.wstx.src" value="classes"/>
+    <property name="com.arjuna.mwlabs.wstx.src" value="classes"/>
+    <property name="com.arjuna.mwlabs.wstx.src10" value="classes10"/>
+    <property name="com.arjuna.mwlabs.wstx.src11" value="classes11"/>
 	<property name="com.arjuna.mwlabs.wstx.dest.root" value="build"/>
-	<property name="com.arjuna.mwlabs.wstx.dest" value="build/classes"/>
+    <property name="com.arjuna.mwlabs.wstx.dest" value="build/classes"/>
+    <property name="com.arjuna.mwlabs.wstx.dest10" value="build/classes10/classes"/>
+    <property name="com.arjuna.mwlabs.wstx.dest11" value="build/classes11/classes"/>
 	<property name="com.arjuna.mwlabs.wstx.webapps.dest" value="build/webapps"/>
 	<property name="com.arjuna.mwlabs.wstx.jar.dest" value="build/lib"/>
 	<property name="com.arjuna.mwlabs.wstx.htdocs.dest" value="build/htdocs"/>
@@ -64,12 +68,18 @@
     <property name="jta.lib.jars" value="jbossjta.jar"/>
     <property name="jta.ext.jars" value="jbossts-common.jar"/>
     <property name="jta.ext.compile.jars" value="commons-logging.jar"/>
-    <property name="xts.ext.compile.jars" value="jaxrpc.jar saaj-api.jar servlet.jar stax-api-1.0.jar wstx-asl-2.0.3.jar glue.jar jaxws-2_1-mrel2-api.jar"/>
+    <property name="xts.ext.compile.jars" value="jaxb-api.jar jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jbossws-client.jar jboss-saaj.jar"/>
 
     <property name="wsas.libs" value="wsas.jar"/>
     <property name="wsc.libs" value="ws-c.jar"/>
+    <property name="wsc10.libs" value="ws-c10.jar"/>
+    <property name="wsc11.libs" value="ws-c11.jar"/>
     <property name="wscf.libs" value="wscf.jar"/>
+    <property name="wscf10.libs" value="wscf10.jar"/>
+    <property name="wscf11.libs" value="wscf11.jar"/>
     <property name="wst.libs" value="ws-t.jar"/>
+    <property name="wst10.libs" value="ws-t10.jar"/>
+    <property name="wst11.libs" value="ws-t11.jar"/>
     <property name="wstx.libs" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
 
     <property name="tests.libs" value="junit.jar"/>
@@ -112,6 +122,18 @@
         <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst.libs}"/>
     </path>
 
+    <path id="com.arjuna.mwlabs.wstx.lib.classpath10">
+        <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc10.libs}"/>
+        <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf10.libs}"/>
+        <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst10.libs}"/>
+    </path>
+
+    <path id="com.arjuna.mwlabs.wstx.lib.classpath11">
+        <fileset dir="${com.arjuna.mwlabs.wsc.jar.dest}" includes="${wsc11.libs}"/>
+        <fileset dir="${com.arjuna.mwlabs.wscf.jar.dest}" includes="${wscf11.libs}"/>
+        <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst11.libs}"/>
+    </path>
+
 	<!-- Initialisation -->
 	<target name="com.arjuna.mwlabs.wstx.init">
 		<!-- Define default build properties -->
@@ -119,7 +141,9 @@
 			<format property="com.arjuna.mw.wstx.date" pattern="yyyy/mm/dd hh:mm aa"/>
 		</tstamp>
 		<!-- Make the destination directory -->
-		<mkdir dir="${com.arjuna.mwlabs.wstx.dest}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wstx.dest}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wstx.dest10}"/>
+        <mkdir dir="${com.arjuna.mwlabs.wstx.dest11}"/>
 		<mkdir dir="${com.arjuna.mwlabs.wstx.webapps.dest}"/>
 	</target>
 
@@ -129,18 +153,48 @@
 	depends="com.arjuna.mwlabs.wstx.compile,
 		com.arjuna.mw.wstx.htdocs, com.arjuna.mwlabs.wstx.generateresourcebundle"/>
 
-	<target name="com.arjuna.mwlabs.wstx.compile" depends="com.arjuna.mwlabs.wstx.init">
-		<echo message="Compiling module"/>
-		<javac srcdir="${com.arjuna.mwlabs.wstx.src}"
+    <target name="com.arjuna.mwlabs.wstx.compile" depends="com.arjuna.mwlabs.wstx.compile11, com.arjuna.mwlabs.wstx.compile10"/>
+
+    <target name="com.arjuna.mwlabs.wstx.compile10" depends="com.arjuna.mwlabs.wstx.compile-generic">
+        <echo message="Compiling module 1.0 code"/>
+        <javac srcdir="${com.arjuna.mwlabs.wstx.src10}"
+                       destdir="${com.arjuna.mwlabs.wstx.dest10}"
+                       debug="on">
+            <classpath>
+                <path>
+                    <pathelement path="${com.arjuna.mwlabs.wstx.dest}"/>
+                </path>
+                <path refid="com.arjuna.mwlabs.wstx.lib.classpath10"/>
+                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
+            </classpath>
+        </javac>
+    </target>
+
+    <target name="com.arjuna.mwlabs.wstx.compile11" depends="com.arjuna.mwlabs.wstx.compile-generic">
+        <echo message="Compiling module 1.1 code"/>
+        <javac srcdir="${com.arjuna.mwlabs.wstx.src11}"
+                       destdir="${com.arjuna.mwlabs.wstx.dest11}"
+                       debug="on">
+            <classpath>
+                <path>
+                    <pathelement path="${com.arjuna.mwlabs.wstx.dest}"/>
+                </path>
+                <path refid="com.arjuna.mwlabs.wstx.lib.classpath11"/>
+                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
+            </classpath>
+        </javac>
+    </target>
+
+    <target name="com.arjuna.mwlabs.wstx.compile-generic" depends="com.arjuna.mwlabs.wstx.init">
+        <echo message="Compiling module generic code"/>
+        <javac srcdir="${com.arjuna.mwlabs.wstx.src}"
                        destdir="${com.arjuna.mwlabs.wstx.dest}"
-                       excludes="${com.arjuna.mwlabs.wstx.compile.excludes}"
-                       debug="yes"
-	        >
-			<classpath>
-				<path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
-			</classpath>
-		</javac>
-	</target>
+                       debug="on">
+            <classpath>
+                <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
+            </classpath>
+        </javac>
+    </target>
 
 	<!-- htdocs paths -->
 	<path id="com.arjuna.mw.wstx.htdocs.path">
@@ -151,32 +205,60 @@
 	<property name="com.arjuna.mwlabs.wstx.htdocs.list" value="com.arjuna.mw.*"/>
 
 	<target name="com.arjuna.mw.wstx.war" depends="com.arjuna.mw.wstx.jar">
-	  <war warfile="${com.arjuna.mwlabs.wstx.webapps.dest}/${com.arjuna.mwlabs.ts.modulename}.war" webxml="xml/wstx_web-app.xml">
-        <manifest>
-            <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
-        </manifest>
-	  </war>
-	</target>
+        <war warfile="${com.arjuna.mwlabs.wstx.webapps.dest}/${com.arjuna.mwlabs.ts.modulename}10.war" webxml="xml/wstx_web-app.xml">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar ${com.arjuna.mwlabs.ts.modulename}10.jar"/>
+            </manifest>
+        </war>
+        <war warfile="${com.arjuna.mwlabs.wstx.webapps.dest}/${com.arjuna.mwlabs.ts.modulename}11.war" webxml="xml/wstx_web-app11.xml">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar ${com.arjuna.mwlabs.ts.modulename}11.jar"/>
+            </manifest>
+        </war>
+    </target>
 
 	<!-- Jar targets -->
 	<target name="com.arjuna.mw.wstx.jar" depends="com.arjuna.mw.wstx.compile">
 		<echo message="Building jar file"/>
 		<mkdir dir="${com.arjuna.mwlabs.wstx.jar.dest}"/>
 
-		<copy file="xml/UserTwoPhaseTx.xml"
-		tofile="${com.arjuna.mwlabs.wstx.dest}/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.xml"/>
+        <copy file="xml/UserTwoPhaseTx.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.xml"/>
 
-		<copy file="xml/AtomicTransaction.xml"
-		tofile="${com.arjuna.mwlabs.wstx.dest}/com/arjuna/mwlabs/wst/at/ContextFactoryImple.xml"/>
-		<copy file="xml/BusinessActivity.xml"
-		tofile="${com.arjuna.mwlabs.wstx.dest}/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.xml"/>
+        <copy file="xml/UserTwoPhaseTx.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.xml"/>
 
-		<jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"
-            basedir="${com.arjuna.mwlabs.wstx.dest}">
+        <copy file="xml/AtomicTransaction.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wst/at/ContextFactoryImple.xml"/>
+        <copy file="xml/BusinessActivity.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest10}/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.xml"/>
+
+        <copy file="xml/AtomicTransaction11.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.xml"/>
+        <copy file="xml/BusinessActivity11.xml"
+              tofile="${com.arjuna.mwlabs.wstx.dest11}/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.xml"/>
+
+
+        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"
+             basedir="${com.arjuna.mwlabs.wstx.dest}">
             <manifest>
                 <attribute name="Class-Path" value="${wst.libs} ${wscf.libs}"/>
             </manifest>
+            <fileset dir="../WS-C/build/dev/dd/" includes="wsdl/*"/>
+            <fileset dir="../WS-T/build/dev/dd/" includes="wsdl/*"/>
         </jar>
+        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar"
+             basedir="${com.arjuna.mwlabs.wstx.dest10}">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar ${wst.libs} ${wst10.libs} ${wscf.libs}"/>
+            </manifest>
+        </jar>
+        <jar jarfile="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"
+             basedir="${com.arjuna.mwlabs.wstx.dest11}">
+            <manifest>
+                <attribute name="Class-Path" value="${com.arjuna.mwlabs.ts.modulename}.jar ${wst.libs} ${wst11.libs} ${wscf.libs}"/>
+            </manifest>
+        </jar>
 	</target>
 
 	<target name="com.arjuna.mw.wstx.htdocs"
@@ -205,13 +287,24 @@
 
             <classpath-builder filename="${com.arjuna.mwlabs.classpathbuilderfilename}" inproperty="build.classpath"/>
 
-            <javadoc    sourcepath="${com.arjuna.mwlabs.wstx.src}"
-                        packagenames="com.arjuna.*"
+            <javadoc    packagenames="com.arjuna.*"
                         failonerror="yes"
                         private="yes"
                         defaultexcludes="yes"
                         classpath="${build.classpath}">
 
+                <packageset dir="${com.arjuna.mwlabs.wstx.src}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
+                <packageset dir="${com.arjuna.mwlabs.wstx.src10}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
+                <packageset dir="${com.arjuna.mwlabs.wstx.src11}" defaultexcludes="yes">
+                  <include name="com/arjuna/**"/>
+                </packageset>
+
                  <doclet name="com.hp.mw.buildsystem.doclet.resbundledoclet.ResourceBundleDoclet">
                     <path>
                         <pathelement path="${com.arjuna.buildsystem.classpath}"/>

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManager.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,133 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.wsc.AlreadyRegisteredException;
-import com.arjuna.wst.BAParticipantManager;
-import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
-import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that the core exposes in order to allow different
- * types of participants to be enrolled. The messaging layer continues to
- * work in terms of the registrar, but internally we map to one of these
- * methods.
- *
- * As with UserTransaction a TransactionManager does not represent a specific
- * transaction, but rather is responsible for providing access to an implicit
- * per-thread transaction context.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
- * @since XTS 1.0.
- */
-
-public abstract class BusinessActivityManager
-{
-    /**
-     * The manager.
-     */
-    private static BusinessActivityManager MANAGER ;
-    
-    /**
-     * Get the business activity manager.
-     * @return The business activity manager.
-     */
-    public static synchronized BusinessActivityManager getBusinessActivityManager()
-    {
-        return MANAGER ;
-    }
-    
-    /**
-     * Set the business activity manager.
-     * @param manager The business activity manager.
-     */
-    public static synchronized void setBusinessActivityManager(final BusinessActivityManager manager)
-    {
-        MANAGER = manager ;
-    }
-
-    /**
-     * Enlist a participant for the BusinessAgreement protocol.
-     *
-     * @return the BAParticipantManager for this transaction.
-     */
-    public abstract BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion(
-        final BusinessAgreementWithParticipantCompletionParticipant bap, final String id)
-        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
-
-    /**
-     * Enlist a participant for the BusinessAgreementWithCoordinatorCompletion protocol.
-     *
-     * @return the BAParticipantManager for this transaction.
-     */
-    public abstract BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion(
-        final BusinessAgreementWithCoordinatorCompletionParticipant bawcp, final String id)
-        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
-
-    /**
-     * The resume method can be used to (re-)associate a thread with a 
-     * transaction(s) via its TxContext. Prior to association, the thread is
-     * disassociated with any transaction(s) with which it may be currently
-     * associated. If the TxContext is null, then the thread is associated with
-     * no transaction. The UnknownTransactionException exception is thrown if
-     * the transaction that the TxContext refers to is invalid in the scope of
-     * the invoking thread.
-     */
-    public abstract void resume(final TxContext txContext)
-        throws UnknownTransactionException, SystemException;
-
-    /**
-     * A thread of control may require periods of non-transactionality so that
-     * it may perform work that is not associated with a specific transaction.
-     * In order to do this it is necessary to disassociate the thread from any
-     * transactions. The suspend method accomplishes this, returning a
-     * TxContext instance, which is a handle on the transaction. The thread is
-     * then no longer associated with any transaction.
-     */
-    public abstract TxContext suspend()
-        throws SystemException;
-    
-    /**
-     * The currentTransaction method returns the TxContext for the current
-     * transaction, or null if there is none. Unlike suspend, this method does
-     * not disassociate the current thread from the transaction(s). This can
-     * be used to enable multiple threads to execute within the scope of the
-     * same transaction.
-     */
-    public abstract TxContext currentTransaction()
-        throws SystemException;
-    
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,41 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BusinessActivityManagerFactory.java,v 1.4.8.1 2005/11/22 10:36:06 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-
-public class BusinessActivityManagerFactory
-{
-    public static BusinessActivityManager businessActivityManager ()
-    {
-        return BusinessActivityManager.getBusinessActivityManager() ;
-	}
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManager.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,141 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.wst.*;
-
-import com.arjuna.wsc.AlreadyRegisteredException;
-
-/**
- * This is the interface that the core exposes in order to allow different
- * types of participants to be enrolled. The messaging layer continues to
- * work in terms of the registrar, but internally we map to one of these
- * methods.
- *
- * This could also be the interface that high-level users see (e.g., at the
- * application Web Service).
- *
- * As with UserTransaction a TransactionManager does not represent a specific
- * transaction, but rather is responsible for providing access to an implicit
- * per-thread transaction context.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
- * @since XTS 1.0.
- */
-
-public abstract class TransactionManager
-{
-    /**
-     * The manager.
-     */
-    private static TransactionManager TRANSACTION_MANAGER ;
-    
-    /**
-     * Get the transaction manager.
-     * @return The transaction manager.
-     */
-    public static synchronized TransactionManager getTransactionManager()
-    {
-        return TRANSACTION_MANAGER ;
-    }
-    
-    /**
-     * Set the transaction manager.
-     * @param manager The transaction manager.
-     */
-    public static synchronized void setTransactionManager(final TransactionManager manager)
-    {
-        TRANSACTION_MANAGER = manager ;
-    }
-
-    /**
-     * Enlist the specified participant with current transaction such that it
-     * will participate in the Volatile 2PC protocol; a unique identifier for
-     * the participant is also required. If there is no transaction associated
-     * with the invoking thread then the UnknownTransactionException exception
-     * is thrown. If the coordinator already has a participant enrolled with
-     * the same identifier, then AlreadyRegisteredException will be thrown. If
-     * the transaction is not in a state where participants can be enrolled
-     * (e.g., it is terminating) then WrongStateException will be thrown.
-     */
-    public abstract void enlistForVolatileTwoPhase(final Volatile2PCParticipant pzp, final String id)
-        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
-
-    /**
-     * Enlist the specified participant with current transaction such that it
-     * will participate in the 2PC protocol; a unique identifier for the
-     * participant is also required. If there is no transaction associated with
-     * the invoking thread then the UnknownTransactionException exception is
-     * thrown. If the coordinator already has a participant enrolled with the 
-     * same identifier, then AlreadyRegisteredException will be thrown. If the
-     * transaction is not in a state where participants can be enrolled (e.g.,
-     * it is terminating) then WrongStateException will be thrown.
-     */
-    public abstract void enlistForDurableTwoPhase(final Durable2PCParticipant tpp, final String id)
-        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
-
-    public abstract int replay () throws SystemException;
-
-    /**
-     * The resume method can be used to (re-)associate a thread with a 
-     * transaction(s) via its TxContext. Prior to association, the thread is
-     * disassociated with any transaction(s) with which it may be currently
-     * associated. If the TxContext is null, then the thread is associated with
-     * no transaction. The UnknownTransactionException exception is thrown if
-     * the transaction that the TxContext refers to is invalid in the scope of
-     * the invoking thread.
-     */
-    public abstract void resume(final TxContext txContext)
-        throws UnknownTransactionException, SystemException;
-
-    /**
-     * A thread of control may require periods of non-transactionality so that
-     * it may perform work that is not associated with a specific transaction.
-     * In order to do this it is necessary to disassociate the thread from any
-     * transactions. The suspend method accomplishes this, returning a
-     * TxContext instance, which is a handle on the transaction. The thread is
-     * then no longer associated with any transaction.
-     */
-    public abstract TxContext suspend()
-        throws SystemException;
-    
-    /**
-     * The currentTransaction method returns the TxContext for the current
-     * transaction, or null if there is none. Unlike suspend, this method does
-     * not disassociate the current thread from the transaction(s). This can
-     * be used to enable multiple threads to execute within the scope of the
-     * same transaction.
-     */
-    public abstract TxContext currentTransaction()
-        throws SystemException;
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,41 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManagerFactory.java,v 1.8.8.1 2005/11/22 10:36:05 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-
-public class TransactionManagerFactory
-{
-    public static TransactionManager transactionManager ()
-    {
-    	return TransactionManager.getTransactionManager() ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivity.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivity.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivity.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,126 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that allows BAs to be started and terminated.
- * The messaging layer converts the messages into calls on this.
- *
- * Importantly, a UserBusinessActivity does not represent a specific
- * transaction, but rather is responsible for providing access to an implicit
- * per-thread  transaction context; it is similar to the UserTransaction in
- * the JTA specification. Therefore, all of the UserTransaction methods
- * implicitly act on the current thread of control.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
- * @since XTS 1.0.
- */
-
-public abstract class UserBusinessActivity
-{
-    /**
-     * The user business activity.
-     */
-    private static UserBusinessActivity USER_BUSINESS_ACTIVITY ;
-    
-    /**
-     * Get the user business activity.
-     * @return The user business activity.
-     */
-    public static synchronized UserBusinessActivity getUserBusinessActivity()
-    {
-        return USER_BUSINESS_ACTIVITY ;
-    }
-    
-    /**
-     * Set the user business activity.
-     * @param userBusinessActivity The user business activity.
-     */
-    public static synchronized void setUserBusinessActivity(final UserBusinessActivity userBusinessActivity)
-    {
-        USER_BUSINESS_ACTIVITY = userBusinessActivity ;
-    }
-
-    public static final int ATOMIC_OUTCOME = 0;
-    public static final int MIXED_OUTCOME = 1;
-    
-    /**
-     * Start a new business activity with atomic outcome.
-     * If one is already associated with this thread
-     * then the WrongStateException will be thrown. Upon success, this
-     * operation associates the newly created transaction with the current
-     * thread.
-     */
-    public abstract void begin()
-        throws WrongStateException, SystemException;
-
-    /**
-     * Start a new BA with atomic outcome and the specified timeout as
-     * its lifetime.
-     * If one is already associated with this thread then the
-     * WrongStateException will be thrown.
-     */
-    public abstract void begin(final int timeout)
-        throws WrongStateException, SystemException;
-
-    /**
-     * The BA is normally terminated by the close method. This signals to
-     * all registered participants that the BA has ended and no compensation
-     * is required.
-     */
-    public abstract void close()
-        throws TransactionRolledBackException, UnknownTransactionException, SystemException;
-
-    /**
-     * If the BA must undo its work then the cancel method is used. Any
-     * participants that can compensate are forced to do so.
-     */
-    public abstract void cancel()
-        throws UnknownTransactionException, SystemException;
-
-    /**
-     * If participants have registered for the BusinessAgreementWithComplete
-     * protocol then they will be expecting the application to inform them
-     * when all work intended for them has been sent (and responded to). The
-     * complete method is used for this purpose.
-     */
-    public abstract void complete()
-        throws UnknownTransactionException, SystemException;
-
-    public abstract String transactionIdentifier();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivityFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivityFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivityFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,42 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserBusinessActivityFactory.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.mw.wst.UserBusinessActivity;
-
-public class UserBusinessActivityFactory
-{
-    public static UserBusinessActivity userBusinessActivity ()
-    {
-        return UserBusinessActivity.getUserBusinessActivity() ;
-	}
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransaction.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransaction.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,118 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- * Importantly, a UserTransaction does not represent a specific transaction,
- * but rather is responsible for providing access to an implicit per-thread 
- * transaction context; it is similar to the UserTransaction in the JTA
- * specification. Therefore, all of the UserTransaction methods implicitly act
- * on the current thread of control.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
- * @since XTS 1.0.
- */
-
-public abstract class UserTransaction
-{
-    /**
-     * The transaction.
-     */
-    private static UserTransaction USER_TRANSACTION ;
-    
-    /**
-     * Get the user transaction.
-     * @return the user transaction.
-     */
-    public static synchronized UserTransaction getUserTransaction()
-    {
-        return USER_TRANSACTION ;
-    }
-    
-    /**
-     * Set the user transaction.
-     * @param userTransaction The user transaction.
-     */
-    public static synchronized void setUserTransaction(final UserTransaction userTransaction)
-    {
-        USER_TRANSACTION = userTransaction ;
-    }
-    
-    /**
-     * Start a new transaction. If one is already associated with this thread
-     * then the WrongStateException will be thrown. Upon success, this
-     * operation associates the newly created transaction with the current
-     * thread.
-     */
-    public abstract void begin()
-        throws WrongStateException, SystemException;
-
-    /**
-     * Start a new transaction with the specified timeout as its lifetime.
-     * If one is already associated with this thread then the
-     * WrongStateException will be thrown.
-     */
-    public abstract void begin(final int timeout)
-        throws WrongStateException, SystemException;
-    
-    /**
-     * The transaction is committed by the commit method. This will execute
-     * the PhaseZero, 2PC and OutcomeNotification protocols prior to returning.
-     * If there is no transaction associated with the invoking thread then
-     * UnknownTransactionException is thrown. If the transaction ultimately
-     * rolls back then the TransactionRolledBackException is thrown. When
-     * complete, this operation disassociates the transaction from the current
-     * thread such that it becomes associated with no transaction.
-     */
-    public abstract void commit()
-        throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException;
-
-    /**
-     * The rollback operation will terminate the transaction and return
-     * normally if it succeeded, while throwing an appropriate exception if it
-     * didn't. If there is no transaction associated with the invoking thread
-     * then UnknownTransactionException is thrown.
-     */
-    public abstract void rollback()
-        throws UnknownTransactionException, SecurityException, SystemException;
-
-    public abstract String transactionIdentifier ();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransactionFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,41 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransactionFactory.java,v 1.9.8.1 2005/11/22 10:36:05 kconner Exp $
- */
-
-package com.arjuna.mw.wst;
-
-
-public class UserTransactionFactory
-{
-    public static UserTransaction userTransaction ()
-    {
-        return UserTransaction.getUserTransaction() ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelper.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,96 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-package com.arjuna.mw.wst.common;
-
-import javax.xml.soap.SOAPEnvelope;
-import javax.xml.soap.SOAPHeaderElement;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.w3c.dom.Element;
-
-import com.arjuna.webservices.adapters.DOMXMLStreamReader;
-import com.arjuna.webservices.adapters.DOMXMLStreamWriter;
-import com.arjuna.webservices.adapters.SAAJXMLStreamReader;
-import com.arjuna.webservices.adapters.SAAJXMLStreamWriter;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-/**
- * Helper class for serialising Coordination Contexts into SOAP headers.
- * @author kevin
- */
-public class CoordinationContextHelper
-{
-    /**
-     * Serialise a coordination context to a SAAJ SOAP Header Element.
-     * @param env The SOAP envelope.
-     * @param headerElement The SOAP header element to populate.
-     * @param coordinationContext The coordination context.
-     * @throws XMLStreamException for errors during parsing.
-     */
-    public static void serialise(final SOAPEnvelope env, final SOAPHeaderElement headerElement, final CoordinationContextType coordinationContext)
-        throws XMLStreamException
-    {
-        final XMLStreamWriter out = new SAAJXMLStreamWriter(env, headerElement) ;
-        coordinationContext.writeContent(out) ;
-    }
-
-    /**
-     * Deserialise a coordination context from a SAAJ SOAP Header Element.
-     * @param env The SOAP envelope.
-     * @param headerElement The SOAP header element to deserialise.
-     * @return The coordination context.
-     * @throws XMLStreamException for errors during parsing.
-     */
-    public static CoordinationContextType deserialise(final SOAPEnvelope env, final SOAPHeaderElement headerElement)
-        throws XMLStreamException
-    {
-        final XMLStreamReader in = new SAAJXMLStreamReader(headerElement) ;
-        return new CoordinationContextType(in) ;
-    }
-
-    /**
-     * Serialise a coordination context to a DOM SOAP Header Element.
-     * @param headerElement The SOAP header element to populate.
-     * @param coordinationContext The coordination context.
-     * @throws XMLStreamException for errors during parsing.
-     */
-    public static void serialise(final Element headerElement, final CoordinationContextType coordinationContext)
-        throws XMLStreamException
-    {
-        final XMLStreamWriter out = new DOMXMLStreamWriter(headerElement) ;
-        coordinationContext.writeContent(out) ;
-    }
-
-    /**
-     * Deserialise a coordination context from a DOM SOAP Header Element.
-     * @param headerElement The SOAP header element to deserialise.
-     * @return The coordination context.
-     * @throws XMLStreamException for errors during parsing.
-     */
-    public static CoordinationContextType deserialise(final Element headerElement)
-        throws XMLStreamException
-    {
-        final XMLStreamReader in = new DOMXMLStreamReader(headerElement) ;
-        return new CoordinationContextType(in) ;
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/Environment.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,42 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Environment.java,v 1.6 2004/09/09 08:48:48 kconner Exp $
- */
-
-package com.arjuna.mw.wst.common;
-
-/**
- */
-
-public interface Environment
-{
-
-    public static final String COORDINATOR_URL = "com.arjuna.mw.wst.coordinatorURL";
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManagerFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,165 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
- */
-
-package com.arjuna.mw.wstx;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-
-import com.arjuna.mw.wstx.common.TransactionXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.HashMap;
-
-/**
- * This class is used to obtain the TransactionManager implementation to
- * use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
- * @since 1.0.
- */
-
-public class TransactionManagerFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wstx.TransactionManagerFactory_1 [com.arjuna.mw.wstx.TransactionManagerFactory_1] - Failed to create document: 
-     */
-
-    public static TransactionManager transactionManager () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class.getName());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx.TransactionManagerFactory_1",
-					      new Object[]{com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class.getName()});
-	    }
-	    else
-	    {
-		if (!_protocolManager.present(doc))
-		    _protocolManager.addProtocol(doc, com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class.getName());
-		
-		return transactionManager(doc);
-	    }
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static TransactionManager transactionManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
-		String protocolType = child.getNodeValue();
-		TransactionManager tx = (TransactionManager) _implementations.get(protocolType);
-	
-		if (tx == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-	
-		    if (implementation instanceof String)
-		    {
-			Class txImpl = Class.forName((String) implementation);
-
-			tx = (TransactionManager) txImpl.newInstance();
-		    }
-		    else
-			tx = (TransactionManager) implementation;
-
-		    _implementations.put(protocolType, tx);
-		}
-
-		return tx;
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-	    
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-    
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransactionFactory.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,164 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
- */
-
-package com.arjuna.mw.wstx;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-
-import com.arjuna.mw.wstx.common.TransactionXSD;
-
-import com.arjuna.mw.wscf.protocols.*;
-import com.arjuna.mw.wscf.utils.*;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-import java.util.HashMap;
-
-/**
- * Return the UserTransaction implementation to use.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
- * @since 1.0.
- */
-
-public class UserTransactionFactory
-{
-
-    /**
-     * @exception ProtocolNotRegisteredException Thrown if the default
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use. The default
-     * coordination protocol is used (two-phase commit) with its
-     * associated implementation.
-     *
-     * @message com.arjuna.mw.wstx.UserTransactionFactory_1 [com.arjuna.mw.wstx.UserTransactionFactory_1] - Failed to create document: 
-     */
-
-    public static UserTransaction userTransaction () throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class.getName());
-	    org.w3c.dom.Document doc = pl.getProtocol();
-	    
-	    if (doc == null)
-	    {
-		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx.UserTransactionFactory_1",
-					      new Object[]{com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class.getName()});
-	    }
-	    else
-	    {
-		if (!_protocolManager.present(doc))
-		    _protocolManager.addProtocol(doc, com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class.getName());
-		
-		return userTransaction(doc);
-	    }
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-
-	    throw new SystemException(ex.toString());
-	}
-
-	return null;
-    }
-
-    /**
-     * Obtain a reference to a coordinator that implements the specified
-     * protocol.
-     *
-     * @param protocol The XML definition of the type of
-     * coordination protocol required.
-     *
-     * @exception ProtocolNotRegisteredException Thrown if the requested
-     * protocol is not available.
-     *
-     * @return the UserCoordinator implementation to use.
-     */
-    
-    /*
-     * Have the type specified in XML. More data may be specified, which
-     * can be passed to the implementation in the same way ObjectName was.
-     */
-
-    public static UserTransaction userTransaction (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
-    {
-	try
-	{
-	    synchronized (_implementations)
-	    {
-		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
-		String protocolType = child.getNodeValue();
-		UserTransaction tx = (UserTransaction) _implementations.get(protocolType);
-	
-		if (tx == null)
-		{
-		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
-	
-		    if (implementation instanceof String)
-		    {
-			Class txImpl = Class.forName((String) implementation);
-			
-			tx = (UserTransaction) txImpl.newInstance();
-		    }
-		    else
-			tx = (UserTransaction) implementation;
-
-		    _implementations.put(protocolType, tx);
-		}
-
-		return tx;
-	    }
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    throw ex;
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-	    
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
-    private static HashMap         _implementations = new HashMap();
-    
-}
-

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,264 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: ContextFactoryImple.java,v 1.16.4.1 2005/11/22 10:36:21 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at;
-
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wscf.model.twophase.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wscf.coordinator.LocalFactory;
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorControl;
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorServiceImple;
-import com.arjuna.mwlabs.wst.at.context.ArjunaContextImple;
-import com.arjuna.mwlabs.wst.at.participants.CleanupSynchronization;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.stax.URI;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ContextFactory;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc.InvalidProtocolException;
-
-public class ContextFactoryImple implements ContextFactory, LocalFactory
-{
-	public ContextFactoryImple ()
-	{
-		try
-		{
-			_coordManager = CoordinatorManagerFactory.coordinatorManager();
-
-            _theRegistrar = new RegistrarImple();
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-		}
-	}
-
-	/**
-	 * Called when a context factory is added to a context factory mapper. This
-	 * method will be called multiple times if the context factory is added to
-	 * multiple context factory mappers or to the same context mapper with
-	 * different protocol identifiers.
-	 * 
-	 * @param coordinationTypeURI
-	 *            the coordination type uri
-	 */
-	public void install(final String coordinationTypeURI)
-	{
-	}
-
-	// TODO interposition
-
-	/*
-	 * If there is a context passed through to create then this newly created
-	 * coordinator should be interposed.
-	 */
-
-	/**
-	 * Creates a coordination context.
-	 * 
-	 * @param coordinationTypeURI
-	 *            the coordination type uri
-	 * @param expires
-	 *            the expire date/time for the returned context, can be null
-	 * @param currentContext
-	 *            the current context, can be null
-	 * 
-	 * @return the created coordination context
-	 * 
-	 * @throws InvalidCreateParametersException
-	 *             if a parameter passed is invalid this activity identifier.
-	 * 
-	 * @message com.arjuna.mwlabs.wst.at.ContextFactoryImple_1
-	 *          [com.arjuna.mwlabs.wst.at.ContextFactoryImple_1] - Invalid type
-	 *          URI: < {0} , {1} >
-	 * @message com.arjuna.mwlabs.wst.at.ContextFactoryImple_3
-	 *          [com.arjuna.mwlabs.wst.at.ContextFactoryImple_3] - Invalid type
-	 *          URI:
-	 */
-
-	public CoordinationContextType create (final String coordinationTypeURI, final Long expires,
-            final CoordinationContextType currentContext)
-			throws InvalidCreateParametersException
-	{
-		if (coordinationTypeURI.equals(AtomicTransactionConstants.WSAT_PROTOCOL))
-		{
-			try
-			{
-				// make sure no transaction is currently associated
-
-				_coordManager.suspend();
-
-				final int timeout ;
-                if (expires == null)
-                {
-                    timeout = 0 ;
-                }
-                else
-                {
-                    final long timeoutVal = expires.longValue() ;
-                    timeout = (timeoutVal > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeoutVal) ;
-                }
-
-				_coordManager.begin(timeout);
-				
-                final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
-                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-                final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
-                
-                final CoordinationContextType coordinationContext = new CoordinationContextType() ;
-                coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
-                coordinationContext.setIdentifier(new AttributedURIType("urn:"+arjunaContext.getTransactionIdentifier())) ;
-                final int transactionExpires = arjunaContext.getTransactionExpires() ;
-                if (transactionExpires > 0)
-                {
-                    coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
-                }
-                final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
-                InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, arjunaContext.getTransactionIdentifier()) ;
-                coordinationContext.setRegistrationService(registrationCoordinator) ;
-
-				/*
-				 * Now add the registrar for this specific coordinator to the
-				 * mapper.
-				 */
-
-				_coordManager.enlistSynchronization(new CleanupSynchronization(_coordManager.identifier().toString(), _theRegistrar));
-
-				/*
-				 * TODO Uughh! This does a suspend for us! Left over from original
-				 * WS-AS stuff.
-				 * 
-				 * TODO
-				 * REFACTOR, REFACTOR, REFACTOR.
-				 */
-				
-				_theRegistrar.associate();
-
-				return coordinationContext;
-			}
-			catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
-			{
-				ex.printStackTrace();
-				
-				throw new InvalidCreateParametersException();
-			}
-			catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-			{
-				ex.printStackTrace();
-			}
-			catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-			{
-				ex.printStackTrace();
-				
-				throw new InvalidCreateParametersException();
-			}
-			catch (Exception ex)
-			{
-				// TODO handle properly
-
-				ex.printStackTrace();
-			}
-		}
-		else
-		{
-			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.ContextFactoryImple_1", new Object[]
-			{ AtomicTransactionConstants.WSAT_PROTOCOL, coordinationTypeURI });
-
-			throw new InvalidCreateParametersException(
-					wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.ContextFactoryImple_3")
-							+ " < "
-							+ AtomicTransactionConstants.WSAT_PROTOCOL
-							+ ", "
-							+ coordinationTypeURI + " >");
-		}
-
-		return null;
-	}
-
-	/**
-	 * Called when a context factory is removed from a context factory mapper.
-	 * This method will be called multiple times if the context factory is
-	 * removed from multiple context factory mappers or from the same context
-	 * factory mapper with different coordination type uris.
-	 * 
-	 * @param coordinationTypeURI
-	 *            the coordination type uri
-	 */
-
-	public void uninstall (final String coordinationTypeURI)
-	{
-		// we don't use this as one implementation is registered per type
-	}
-
-	public final Object createSubordinate () throws NoActivityException, InvalidProtocolException, SystemException
-	{
-		try
-		{
-			CoordinatorServiceImple coordManager = (CoordinatorServiceImple) _coordManager;
-			CoordinatorControl theControl = coordManager.coordinatorControl();
-			ACCoordinator subordinateTransaction = theControl.createSubordinate();
-			
-			/*
-			 * Now add the registrar for this specific coordinator to the
-			 * mapper.
-			 */
-
-			subordinateTransaction.enlistSynchronization(new CleanupSynchronization(subordinateTransaction.get_uid().stringForm(), _theRegistrar));
-
-			_theRegistrar.associate(subordinateTransaction);
-			
-			return subordinateTransaction;
-		}
-		catch (Exception ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-	}
-	
-	public final RegistrarImple registrar ()
-	{
-		return _theRegistrar;
-	}
-
-	private CoordinatorManager _coordManager;
-	private RegistrarImple _theRegistrar;
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,75 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: ContextImple.java,v 1.13.4.1 2005/11/22 10:36:21 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at;
-
-import com.arjuna.mw.wsc.context.Context;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-public class ContextImple implements Context
-{
-
-	public ContextImple (final CoordinationContextType ctx)
-	{
-		_coordContext = ctx;
-	}
-
-	public boolean equals (Object obj)
-	{
-		if (obj instanceof ContextImple)
-		{
-			ContextImple ci = (ContextImple) obj;
-
-			return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
-		}
-		else
-			return false;
-	}
-
-	public CoordinationContextType getCoordinationContext ()
-	{
-		return _coordContext;
-	}
-
-	public void setCoordinationContext (CoordinationContextType cc)
-	{
-		_coordContext = cc;
-	}
-
-	public String toString ()
-	{
-		// return DomUtil.nodeAsString(toXML());
-
-		return "AtomicTransactionIdentifier: " + _coordContext.getIdentifier().getValue();
-	}
-
-	private CoordinationContextType _coordContext;
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,349 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: RegistrarImple.java,v 1.20.4.1 2005/11/22 10:36:21 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at;
-
-import java.util.HashMap;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-import com.arjuna.mw.wscf.model.twophase.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
-import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateCoordinator;
-import com.arjuna.mwlabs.wst.at.participants.CompletionCoordinatorImple;
-import com.arjuna.mwlabs.wst.at.participants.DurableTwoPhaseCommitParticipant;
-import com.arjuna.mwlabs.wst.at.participants.VolatileTwoPhaseCommitParticipant;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
-import com.arjuna.wsc.AlreadyRegisteredException;
-import com.arjuna.wsc.InvalidProtocolException;
-import com.arjuna.wsc.InvalidStateException;
-import com.arjuna.wsc.NoActivityException;
-import com.arjuna.wsc.Registrar;
-import com.arjuna.wsc.RegistrarMapper;
-import com.arjuna.wst.CompletionCoordinatorParticipant;
-import com.arjuna.wst.stub.Durable2PCStub;
-import com.arjuna.wst.stub.Volatile2PCStub;
-
-/*
- * TODO
- * 
- * This entire architecture needs reworking. The WSAS and WSCF modules are based
- * on the original pre-WS-CAF work and now out-of-date. They are more generic
- * than required and pass through so many different levels of indirection that
- * it confuses the code path and makes it difficult to see what is going on.
- * 
- * The notion of an activity is fine in the general context of WS-CAF and
- * WS-C/Tx, but within the implementation, it causes us to do too much
- * thread-to-activity related work. It would be like having to go through the JTA
- * UT and TM interfaces in order to do anywork on the transaction!
- */
-
-public class RegistrarImple implements Registrar
-{
-	public RegistrarImple ()
-        throws ProtocolNotRegisteredException, SystemException
-	{
-		_coordManager = CoordinatorManagerFactory.coordinatorManager();
-
-		// register with mapper using tx id as protocol identifier.
-        final RegistrarMapper mapper = RegistrarMapper.getFactory() ;
-
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC, this);
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC, this);
-		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION, this);
-	}
-
-	/**
-	 * Called when a registrar is added to a register mapper. This method will
-	 * be called multiple times if the registrar is added to multiple register
-	 * mappers or to the same register mapper with different protocol
-	 * identifiers.
-	 * 
-	 * @param serviceAddress
-	 *            the address of the service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 */
-
-	public void install (final String protocolIdentifier)
-	{
-	}
-
-	/**
-	 * Registers the interest of participant in a particular protocol.
-	 * 
-	 * @param participantProtocolServiceAddress
-	 *            the address of the participant protocol service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 * 
-	 * @return the PortReference of the coordinator protocol service
-	 * 
-	 * @throws AlreadyRegisteredException
-	 *             if the participant is already registered for this
-	 *             coordination protocol under this activity identifier
-	 * @throws InvalidProtocolException
-	 *             if the coordination protocol is not supported
-	 * @throws InvalidStateException
-	 *             if the state of the coordinator no longer allows registration
-	 *             for this coordination protocol
-	 * @throws NoActivityException
-	 *             if the activity does not exist.
-	 * 
-	 * @message com.arjuna.mwlabs.wst.at.RegistrarImple_1
-	 *          [com.arjuna.mwlabs.wst.at.Registrar_1] - Invalid type URI: < {0} ,
-	 *          {1} >
-	 */
-
-	/*
-	 * TODO
-	 * 
-	 * See comment at head of class definition. We shouldn't have to rely on
-	 * thread-to-activity association to register a participant. We currently do
-	 * because the code is based on old WS-CAF models that are no longer
-	 * applicable. This needs updating!
-	 */
-	public EndpointReferenceType register(final EndpointReferenceType participantProtocolService,
-        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
-			throws AlreadyRegisteredException, InvalidProtocolException,
-			InvalidStateException, NoActivityException
-	{
-		Object tx = _hierarchies.get(instanceIdentifier.getInstanceIdentifier());
-		
-		if (tx instanceof SubordinateCoordinator)
-			return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier);
-
-		ActivityHierarchy hier = (ActivityHierarchy) tx;
-
-		if (hier == null)
-			throw new NoActivityException();
-
-		try
-		{
-			_coordManager.resume(hier);
-		}
-		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-		{
-			throw new NoActivityException();
-		}
-		catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-		{
-			throw new InvalidProtocolException();
-		}
-
-		// TODO check for AlreadyRegisteredException
-
-		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
-		{
-			// enlist participant that wraps the requester URI.
-			final String participantId = "D" + new Uid().stringForm();
-
-			try
-			{
-                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
-				_coordManager.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
-
-				_coordManager.suspend();
-
-				return getCoordinator(participantId) ;
-			}
-			catch (Exception ex)
-			{
-				throw new InvalidStateException();
-			}
-		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
-		{
-			// enlist participant that wraps the requester URI.
-			final String participantId = "V" + new Uid().stringForm();
-
-			try
-			{
-                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
-				_coordManager.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
-
-				_coordManager.suspend();
-
-				return getCoordinator(participantId) ;
-			}
-			catch (Exception ex)
-			{
-				throw new InvalidStateException();
-			}
-		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
-		{
-			try
-			{
-                final CompletionCoordinatorParticipant participant = new CompletionCoordinatorImple(_coordManager, hier, true) ;
-                CompletionCoordinatorProcessor.getProcessor().activateParticipant(participant, instanceIdentifier.getInstanceIdentifier()) ;
-
-				_coordManager.suspend();
-
-				return getCompletionCoordinator(instanceIdentifier) ;
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-
-				throw new InvalidStateException(ex.toString());
-			}
-		}
-		else
-		{
-			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
-			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
-
-			throw new InvalidProtocolException();
-		}
-	}
-
-    /**
-	 * Called when a registrar is removed from a register mapper. This method
-	 * will be called multiple times if the registrar is removed from multiple
-	 * register mappers or from the same register mapper with different protocol
-	 * identifiers.
-	 * 
-	 * @param serviceAddress
-	 *            the address of the service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 */
-	public void uninstall(final String protocolIdentifier)
-	{
-	}
-
-	public final void associate () throws Exception
-	{
-		// TODO colocation won't do suspend
-
-		String txIdentifier = _coordManager.identifier().toString();
-		ActivityHierarchy hier = _coordManager.suspend();
-
-		_hierarchies.put(txIdentifier, hier);
-	}
-
-	public final void associate (ACCoordinator transaction) throws Exception
-	{
-		String txIdentifier = transaction.get_uid().stringForm();
-		
-		_hierarchies.put(txIdentifier, transaction);
-	}
-
-	public final void disassociate (String txIdentifier) throws Exception
-	{
-		_hierarchies.remove(txIdentifier);
-	}
-
-	private final EndpointReferenceType registerWithSubordinate(final SubordinateCoordinator theTx,
-        final EndpointReferenceType participantProtocolService, final String protocolIdentifier)
-			throws AlreadyRegisteredException, InvalidProtocolException,
-			InvalidStateException, NoActivityException
-    {
-		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
-		{
-			// enlist participant that wraps the requester URI.
-            final String participantId = "D" + new Uid().stringForm();
-
-            try
-            {
-                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
-                theTx.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
-
-                return getCoordinator(participantId) ;
-            }
-            catch (Exception ex)
-            {
-                throw new InvalidStateException();
-            }
-		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
-		{
-			// enlist participant that wraps the requester URI.
-            final String participantId = "V" + new Uid().stringForm();
-
-            try
-            {
-                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
-                theTx.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
-
-                return getCoordinator(participantId) ;
-            }
-            catch (Exception ex)
-            {
-                throw new InvalidStateException();
-            }
-		}
-		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
-		{
-			// not allowed for subordinate transactions!
-			
-			throw new InvalidStateException();
-		}
-		else
-		{
-			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
-			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
-
-			throw new InvalidProtocolException();
-		}
-	}
-
-    private EndpointReferenceType getCompletionCoordinator(final InstanceIdentifier instanceIdentifier)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String completionCoordinatorURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COMPLETION_COORDINATOR) ;
-        final EndpointReferenceType completionCoordinator = new EndpointReferenceType(new AttributedURIType(completionCoordinatorURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(completionCoordinator, instanceIdentifier) ;
-        return completionCoordinator ;
-    }
-
-    private EndpointReferenceType getCoordinator(final String participantId)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String coordinatorURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COORDINATOR) ;
-        final EndpointReferenceType coordinator = new EndpointReferenceType(new AttributedURIType(coordinatorURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(coordinator, participantId) ;
-        return coordinator ;
-    }
-
-	private CoordinatorManager _coordManager = null;
-	private HashMap _hierarchies = new HashMap();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,78 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wst.at.participants;
-
-import com.arjuna.mwlabs.wst.at.RegistrarImple;
-
-import com.arjuna.mw.wscf.model.twophase.participants.*;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
- * @since 1.0.
- */
-
-public class CleanupSynchronization implements Synchronization
-{
-
-	public CleanupSynchronization (String cleanupId, RegistrarImple theRegistrar)
-	{
-		_cleanupId = cleanupId;
-		_theRegistrar = theRegistrar;
-	}
-
-	public void beforeCompletion () throws SystemException
-	{
-		// do nothing
-	}
-
-	public void afterCompletion (int status) throws SystemException
-	{
-		try
-		{
-			_theRegistrar.disassociate(_cleanupId);
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-
-			throw new SystemException(ex.toString());
-		}
-	}
-
-	private String _cleanupId;
-
-	private RegistrarImple _theRegistrar;
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,171 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: CompletionCoordinatorImple.java,v 1.6.24.1 2005/11/22 10:36:22 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at.participants;
-
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
-import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-
-/**
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: CompletionCoordinatorImple.java,v 1.6.24.1 2005/11/22 10:36:22 kconner Exp $
- * @since 1.0.
- */
-
-public class CompletionCoordinatorImple implements com.arjuna.wst.CompletionCoordinatorParticipant
-{
-
-    public CompletionCoordinatorImple (CoordinatorManager cm, ActivityHierarchy hier, final boolean deactivate)
-    {
-	_cm = cm;
-	_hier = hier;
-    this.deactivate = deactivate ;
-    }
-    
-    public void commit () throws TransactionRolledBackException, UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier != null)
-		_cm.resume(_hier);
-
-	    _cm.confirm();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
-	{
-	    //	    throw new HeuristicHazardException();
-	    
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorCancelledException ex)
-	{
-	    throw new TransactionRolledBackException();
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
-	{
-	    //	    throw new HeuristicMixedException();
-
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
-	{
-	    //	    throw new HeuristicHazardException();
-
-	    throw new SystemException(ex.toString());
-
-	}
-	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	finally
-	{
-	    if (deactivate)
-	        CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
-	}
-    }
-    
-    public void rollback () throws UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier != null)
-		_cm.resume(_hier);
-	    
-	    _cm.cancel();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
-	{
-	    throw new SystemException();
-	}
-	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorConfirmedException ex)
-	{
-	    throw new SystemException();
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	finally
-	{
-        if (deactivate)
-            CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
-	}
-    }
-
-    private CoordinatorManager   _cm;
-    private ActivityHierarchy    _hier;
-    private final boolean deactivate ;
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,249 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TransactionManagerImple.java,v 1.19.4.1 2005/11/22 10:36:09 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at.remote;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.at.context.TxContextImple;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.AlreadyRegisteredException;
-import com.arjuna.wsc.InvalidProtocolException;
-import com.arjuna.wsc.InvalidStateException;
-import com.arjuna.wsc.NoActivityException;
-import com.arjuna.wsc.RegistrationCoordinator;
-import com.arjuna.wst.Durable2PCParticipant;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.Volatile2PCParticipant;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.ParticipantEngine;
-
-/**
- * This is the interface that the core exposes in order to allow different types
- * of participants to be enrolled. The messaging layer continues to work in
- * terms of the registrar, but internally we map to one of these methods.
- */
-
-public class TransactionManagerImple extends TransactionManager
-{
-	public TransactionManagerImple ()
-	{
-	}
-
-	public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id)
-			throws WrongStateException, UnknownTransactionException,
-			AlreadyRegisteredException, SystemException
-	{
-		try
-		{
-			final EndpointReferenceType coordinator = registerParticipant(getParticipant(id) , AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
-
-			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
-		}
-		catch (com.arjuna.wsc.InvalidProtocolException ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-		catch (com.arjuna.wsc.InvalidStateException ex)
-		{
-			throw new WrongStateException();
-		}
-		catch (com.arjuna.wsc.NoActivityException ex)
-		{
-			throw new UnknownTransactionException();
-		}
-	}
-
-	public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id)
-			throws WrongStateException, UnknownTransactionException,
-			AlreadyRegisteredException, SystemException
-	{
-		try
-		{
-			final EndpointReferenceType coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
-
-			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
-		}
-		catch (com.arjuna.wsc.InvalidProtocolException ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-		catch (com.arjuna.wsc.InvalidStateException ex)
-		{
-			throw new WrongStateException();
-		}
-		catch (com.arjuna.wsc.NoActivityException ex)
-		{
-			ex.printStackTrace();
-
-			throw new UnknownTransactionException();
-		}
-	}
-
-	/*
-	 * TODO
-	 * 
-	 * Have participant interfaces in WSTX have url method and services use
-	 * those. The ones in WS-T are message oriented and we translate to/from.
-	 *  
-	 */
-
-	/**
-	 * @message com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1
-	 *          [com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1] -
-	 *          Not implemented!
-	 */
-
-	public int replay () throws SystemException
-	{
-		throw new SystemException(
-				wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1"));
-	}
-
-	public TxContext suspend () throws SystemException
-	{
-		return _ctxManager.suspend();
-	}
-
-	// resume overwrites. Should we check first a la JTA?
-
-	public void resume (TxContext tx) throws UnknownTransactionException,
-			SystemException
-	{
-		_ctxManager.resume(tx);
-	}
-
-	public TxContext currentTransaction () throws SystemException
-	{
-		return _ctxManager.currentTransaction();
-	}
-
-	protected EndpointReferenceType enlistForCompletion (final EndpointReferenceType participantEndpoint)
-			throws WrongStateException, UnknownTransactionException,
-			AlreadyRegisteredException, SystemException
-	{
-		try
-		{
-			TxContextImple currentTx = (TxContextImple) _ctxManager.currentTransaction();
-
-			if (currentTx == null)
-				throw new com.arjuna.wsc.NoActivityException();
-
-			return registerParticipant(participantEndpoint, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION);
-		}
-		catch (com.arjuna.wsc.InvalidProtocolException ex)
-		{
-			ex.printStackTrace();
-
-			throw new SystemException(ex.toString());
-		}
-		catch (com.arjuna.wsc.InvalidStateException ex)
-		{
-			throw new WrongStateException();
-		}
-		catch (com.arjuna.wsc.NoActivityException ex)
-		{
-			throw new UnknownTransactionException();
-		}
-	}
-    
-    private EndpointReferenceType getParticipant(final String id)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String serviceURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_PARTICIPANT) ;
-        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
-        return participant ;
-    }
-
-	private final EndpointReferenceType registerParticipant (final EndpointReferenceType participant, final String protocol)
-			throws InvalidProtocolException, InvalidStateException, NoActivityException, SystemException
-	{
-		TxContextImple currentTx = null;
-
-		try
-		{
-			currentTx = (TxContextImple) _ctxManager.suspend();
-
-			if (currentTx == null)
-				throw new com.arjuna.wsc.NoActivityException();
-
-            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
-            final String messageId = new Uid().stringForm() ;
-            return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
-		}
-		catch (final SoapFault sf)
-		{
-			throw new SystemException(sf.getMessage());
-		}
-		catch (final NoActivityException nae)
-		{
-			throw nae ;
-		}
-        catch (final InvalidStateException ise)
-        {
-            throw ise ;
-        }
-        catch (final InvalidProtocolException ipe)
-        {
-            throw ipe ;
-        }
-		catch (final Exception ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-		finally
-		{
-			try
-			{
-				if (currentTx != null)
-					_ctxManager.resume(currentTx);
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-
-	private ContextManager _ctxManager = new ContextManager();
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,403 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTransactionImple.java,v 1.21.4.1 2005/11/22 10:36:09 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.at.remote;
-
-import java.util.Hashtable;
-import java.io.InputStream;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.common.Environment;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.at.ContextImple;
-import com.arjuna.mwlabs.wst.at.context.TxContextImple;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.stub.CompletionStub;
-
-/**
- * @message com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2
- *          [com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2] - Received
- *          context is null!
- */
-public class UserTransactionImple extends UserTransaction
-{
-
-	public UserTransactionImple ()
-	{
-		try
-		{
-            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
-
-			/*
-			 * If the coordinator URL hasn't been specified via the
-			 * configuration file then assume we are using a locally registered
-			 * implementation.
-			 */
-
-			if (_activationCoordinatorService == null)
-			{
-                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-                _activationCoordinatorService = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
-			}
-		}
-		catch (Exception ex)
-		{
-			// TODO
-
-			ex.printStackTrace();
-		}
-	}
-
-	public void begin () throws WrongStateException, SystemException
-	{
-		begin(0);
-	}
-
-	public void begin (int timeout) throws WrongStateException, SystemException
-	{
-		try
-		{
-			if (_ctxManager.currentTransaction() != null)
-				throw new WrongStateException();
-
-			com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout);
-
-			_ctxManager.resume(new TxContextImple(ctx));
-
-			enlistCompletionParticipants();
-		}
-		catch (com.arjuna.wsc.InvalidCreateParametersException ex)
-		{
-			tidyup();
-
-			throw new SystemException(ex.toString());
-		}
-		catch (com.arjuna.wst.UnknownTransactionException ex)
-		{
-			tidyup();
-
-			throw new SystemException(ex.toString());
-		}
-		catch (SystemException ex)
-		{
-			tidyup();
-
-			throw ex;
-		}
-	}
-
-	public void commit () throws TransactionRolledBackException,
-			UnknownTransactionException, SecurityException, SystemException
-	{
-		try
-		{
-			commitWithoutAck();
-		}
-		catch (SystemException ex)
-		{
-			throw ex;
-		}
-		finally
-		{
-			tidyup();
-		}
-	}
-
-	public void rollback () throws UnknownTransactionException, SecurityException, SystemException
-	{
-		try
-		{
-			abortWithoutAck();
-		}
-		catch (SystemException ex)
-		{
-			throw ex;
-		}
-		finally
-		{
-			tidyup();
-		}
-	}
-
-	public String transactionIdentifier ()
-	{
-		try
-		{
-			return _ctxManager.currentTransaction().toString();
-		}
-		catch (com.arjuna.wst.SystemException ex)
-		{
-			return "Unknown";
-		}
-		catch (NullPointerException ex)
-		{
-			return "Unknown";
-		}
-	}
-
-	public String toString ()
-	{
-		return transactionIdentifier();
-	}
-
-	/*
-	 * Not sure if this is right as it doesn't map to registering a participant
-	 * with the coordinator.
-	 */
-
-	private final void enlistCompletionParticipants ()
-			throws WrongStateException, UnknownTransactionException,
-			SystemException
-	{
-		try
-		{
-			TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager();
-
-			final String id = ((TxContextImple) tm.currentTransaction()).identifier();
-			final EndpointReferenceType completionCoordinator = tm.enlistForCompletion(getCompletionParticipant(id));
-
-			_completionCoordinators.put(id, completionCoordinator);
-		}
-		catch (com.arjuna.wsc.AlreadyRegisteredException ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-	}
-
-    private final com.arjuna.mw.wsc.context.Context startTransaction(int timeout)
-			throws com.arjuna.wsc.InvalidCreateParametersException,
-			SystemException
-	{
-		try
-		{
-            // TODO: tricks for per app _activationCoordinatorService config, perhaps:
-            //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
-
-            
-            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
-            final String messageId = new Uid().stringForm() ;
-            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
-                    _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, null) ;
-            if (coordinationContext == null)
-            {
-                throw new SystemException(
-                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2"));
-            }
-            return new ContextImple(coordinationContext) ;
-		}
-        catch (final InvalidCreateParametersException icpe)
-        {
-            throw icpe ;
-        }
-		catch (final SoapFault sf)
-		{
-			throw new SystemException(sf.getMessage()) ;
-		}
-		catch (final Exception ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-	}
-
-	private final void commitWithoutAck ()
-			throws TransactionRolledBackException, UnknownTransactionException,
-			SecurityException, SystemException
-	{
-		TxContextImple ctx = null;
-		String id = null;
-
-		try
-		{
-			ctx = (TxContextImple) _ctxManager.suspend();
-            if (ctx == null) {
-                throw new UnknownTransactionException();
-            }
-            id = ctx.identifier();
-
-			/*
-			 * By default the completionParticipantURL won't be set for an interposed (imported)
-			 * bridged transaction. This is fine, because you shouldn't be able to commit that
-			 * transaction from a node in the tree, only from the root. So, we can prevent commit
-			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
-			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
-			 * for how to do this).
-			 */
-
-			final EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
-
-			if (completionCoordinator == null)
-				throw new SecurityException();
-
-			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
-
-			completionStub.commit();
-		}
-		catch (SystemException ex)
-		{
-			throw ex;
-		}
-		catch (TransactionRolledBackException ex)
-		{
-			throw ex;
-		}
-		catch (UnknownTransactionException ex)
-		{
-			throw ex;
-		}
-		catch (SecurityException ex)
-		{
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-
-			throw new SystemException(ex.toString());
-		}
-		finally
-		{
-			try
-			{
-				if (ctx != null)
-					_ctxManager.resume(ctx);
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-
-			if (id != null)
-				_completionCoordinators.remove(id);
-		}
-	}
-
-	private final void abortWithoutAck () throws UnknownTransactionException, SecurityException,
-			SystemException
-	{
-		TxContextImple ctx = null;
-		String id = null;
-
-		try
-		{
-			ctx = (TxContextImple) _ctxManager.suspend();
-			id = ctx.identifier();
-
-			/*
-			 * By default the completionParticipantURL won't be set for an interposed (imported)
-			 * bridged transaction. This is fine, because you shouldn't be able to commit that
-			 * transaction from a node in the tree, only from the root. So, we can prevent commit
-			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
-			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
-			 * for how to do this).
-			 */
-
-			EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
-
-			if (completionCoordinator == null)
-				throw new SecurityException();
-
-			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
-
-			completionStub.rollback();
-		}
-		catch (SystemException ex)
-		{
-			throw ex;
-		}
-		catch (UnknownTransactionException ex)
-		{
-			throw ex;
-		}
-		catch (SecurityException ex)
-		{
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-			throw new SystemException(ex.toString());
-		}
-		finally
-		{
-			try
-			{
-				if (ctx != null)
-					_ctxManager.resume(ctx);
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-
-			if (id != null)
-				_completionCoordinators.remove(id);
-		}
-	}
-
-    private EndpointReferenceType getCompletionParticipant(final String id)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String serviceURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR) ;
-        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
-        return participant ;
-    }
-
-	private final void tidyup ()
-	{
-		try
-		{
-			_ctxManager.suspend();
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-		}
-	}
-
-	private ContextManager _ctxManager = new ContextManager();
-	private String _activationCoordinatorService;
-	private Hashtable _completionCoordinators = new Hashtable();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,211 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BusinessActivityTerminatorImple.java,v 1.3.18.1 2005/11/22 10:36:14 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba;
-
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
-import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
-import com.arjuna.wst.BusinessActivityTerminator;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-
-public class BusinessActivityTerminatorImple implements BusinessActivityTerminator
-{
-    public BusinessActivityTerminatorImple ()
-        throws SystemException
-    {
-        try
-        {
-            _coordManager = CoordinatorManagerFactory.coordinatorManager();
-            _hier = _coordManager.currentActivity();
-        }
-        catch (ProtocolNotRegisteredException pnre)
-        {
-            throw new SystemException(pnre.toString());
-        }
-        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-    }
-    
-    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
-    {
-        try
-        {
-            if (_hier == null)
-            throw new UnknownTransactionException();
-
-            _coordManager.resume(_hier);
-        
-            _coordManager.close();
-        }
-        catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-        {
-            throw new UnknownTransactionException();
-        }
-        catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-        catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException ex)
-        {
-            throw new TransactionRolledBackException();
-        }
-        catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
-        {
-            throw new UnknownTransactionException();
-        }
-        catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-        catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-        catch (UnknownTransactionException ex)
-        {
-            throw ex;
-        }
-        finally
-        {
-            TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
-        }
-    }
-
-    public void cancel () throws UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier == null)
-		throw new UnknownTransactionException();
-
-	    _coordManager.resume(_hier);
-	
-	    _coordManager.cancel();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorConfirmedException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException();
-	}
-	catch (UnknownTransactionException ex)
-	{
-	    throw ex;
-	}
-	finally
-	{
-        TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
-	}
-    }
-
-    /**
-     * Complete doesn't mean go away, it just means that all work you need to
-     * accomplish the commit/rollback has been received.
-     */
-
-    public void complete () throws UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier == null)
-		throw new UnknownTransactionException();
-
-	    _coordManager.resume(_hier);
-	
-	    _coordManager.complete();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException();
-	}
-	catch (UnknownTransactionException ex)
-	{
-	    throw ex;
-	}
-    }
-
-    private CoordinatorManager                   _coordManager = null;
-    private ActivityHierarchy                    _hier = null;
-    
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,208 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: ContextFactoryImple.java,v 1.4.4.1 2005/11/22 10:36:14 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba;
-
-import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.ba.context.ArjunaContextImple;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.stax.URI;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ContextFactory;
-import com.arjuna.wsc.InvalidCreateParametersException;
-
-public class ContextFactoryImple implements ContextFactory
-{
-
-    public ContextFactoryImple ()
-    {
-        try
-        {
-            _coordManager = CoordinatorManagerFactory.coordinatorManager();
-
-            _theRegistrar = new RegistrarImple();
-        }
-        catch (Exception ex)
-        {
-            ex.printStackTrace();
-        }
-    }
-
-    /**
-     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
-     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
-     * protocol identifiers.
-     *
-     * @param coordinationTypeURI the coordination type uri
-     */
-
-    public void install (final String coordinationTypeURI)
-    {
-    }
-
-    // TODO interposition
-
-    /*
-     * If there is a context passed through to create then this newly created
-     * coordinator should be interposed.
-     */
-
-    /**
-     * Creates a coordination context.
-     *
-     * @param coordinationTypeURI the coordination type uri
-     * @param expires the expire date/time for the returned context, can be null
-     * @param currentContext the current context, can be null
-     *
-     * @return the created coordination context
-     *
-     * @throws InvalidCreateParametersException if a parameter passed is invalid
-     *         this activity identifier.
-     *
-     * @message com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1 [com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1] - Invalid type URI: < {0} , {1} >
-     * @message com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3 [com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3] - Invalid type URI: 
-     */
-
-    public CoordinationContextType create (final String coordinationTypeURI,
-            final Long expires, final CoordinationContextType currentContext)
-        throws InvalidCreateParametersException
-    {
-        if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationTypeURI))
-    	{
-    	    try
-    	    {
-    		// make sure no transaction is currently associated
-    
-    		_coordManager.suspend();
-    		
-    		final int timeout ;
-            if (expires == null)
-            {
-                timeout = 0 ;
-            }
-            else
-            {
-                final long longTimeout = expires.longValue() ;
-                timeout = (longTimeout > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)longTimeout) ;
-            }
-    		
-    		_coordManager.begin(timeout);
-    
-            final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
-            final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-            final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
-            
-            final CoordinationContextType coordinationContext = new CoordinationContextType() ;
-            coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
-            coordinationContext.setIdentifier(new AttributedURIType("urn:"+arjunaContext.getTransactionIdentifier())) ;
-            final int transactionExpires = arjunaContext.getTransactionExpires() ;
-            if (transactionExpires > 0)
-            {
-                coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
-            }
-            final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
-            InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, arjunaContext.getTransactionIdentifier()) ;
-            coordinationContext.setRegistrationService(registrationCoordinator) ;
-            
-            TerminationCoordinatorProcessor.getProcessor().activateParticipant(new BusinessActivityTerminatorImple(), arjunaContext.getTransactionIdentifier()) ;
-    
-    		_theRegistrar.associate();
-    
-    		return coordinationContext;
-	    }
-	    catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
-	    {
-		// TODO handle properly
-
-		ex.printStackTrace();
-	    }
-	    catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	    {
-		// TODO handle properly
-
-		ex.printStackTrace();
-	    }
-	    catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	    {
-		// TODO handle properly
-
-		ex.printStackTrace();
-	    }
-	    catch (Exception ex)
-	    {
-		// TODO handle properly
-
-		ex.printStackTrace();
-	    }
-	}
-	else
-	{
-	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1",
-					  new Object[]{BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, coordinationTypeURI});
-
-	    throw new InvalidCreateParametersException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3")+" < "+BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME+", "+coordinationTypeURI+" >");
-	}
-
-	return null;
-    }
-
-    /**
-     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
-     * times if the context factory is removed from multiple context factory mappers or from the same context factory
-     * mapper with different coordination type uris.
-     *
-     * @param serviceAddress the address of the service
-     * @param coordinationTypeURI the coordination type uri
-     */
-
-    public void uninstall (String coordinationTypeURI)
-    {
-	// we don't use this as one implementation is registered per type
-    }
-
-    public final RegistrarImple registrar ()
-    {
-	return _theRegistrar;
-    }
-
-    private CoordinatorManager                   _coordManager;
-    private RegistrarImple                       _theRegistrar;
-    
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,71 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: ContextImple.java,v 1.3.6.1 2005/11/22 10:36:14 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba;
-
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-public class ContextImple implements com.arjuna.mw.wsc.context.Context
-{
-    public ContextImple (CoordinationContextType ctx)
-    {
-        _coordContext = ctx;
-    }
-
-    public boolean equals (Object obj)
-    {
-        if (obj instanceof ContextImple)
-        {
-    	    ContextImple ci = (ContextImple) obj;
-    	    
-            return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
-        }
-        else
-            return false;
-    }
-
-    public CoordinationContextType getCoordinationContext ()
-    {
-    	return _coordContext;
-    }
-    
-    public void setCoordinationContext (CoordinationContextType cc)
-    {
-    	_coordContext = cc;
-    }
-
-    public String toString ()
-    {
-    	return "BusinessActivityIdentifier: "+_coordContext.getIdentifier().getValue();
-    }
-
-    private CoordinationContextType _coordContext;
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,272 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002, 2003, 2004,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: RegistrarImple.java,v 1.7.4.1 2005/11/22 10:36:14 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba;
-
-import java.util.HashMap;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithCoordinatorCompletionImple;
-import com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithParticipantCompletionImple;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.wsc.AlreadyRegisteredException;
-import com.arjuna.wsc.InvalidProtocolException;
-import com.arjuna.wsc.InvalidStateException;
-import com.arjuna.wsc.NoActivityException;
-import com.arjuna.wsc.Registrar;
-import com.arjuna.wsc.RegistrarMapper;
-import com.arjuna.wst.messaging.engines.CoordinatorCompletionCoordinatorEngine;
-import com.arjuna.wst.messaging.engines.ParticipantCompletionCoordinatorEngine;
-import com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub;
-import com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub;
-
-public class RegistrarImple implements Registrar
-{
-
-	public RegistrarImple () throws ProtocolNotRegisteredException,
-			SystemException
-	{
-		_coordManager = CoordinatorManagerFactory.coordinatorManager();
-
-		// register with mapper using tx id as protocol identifier.
-		final RegistrarMapper mapper = RegistrarMapper.getFactory();
-
-		mapper.addRegistrar(
-			BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION, this);
-		mapper.addRegistrar(
-			BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION, this);
-		mapper.addRegistrar(ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION, this);
-	}
-
-	/**
-	 * Called when a registrar is added to a register mapper. This method will
-	 * be called multiple times if the registrar is added to multiple register
-	 * mappers or to the same register mapper with different protocol
-	 * identifiers.
-	 * 
-	 * @param serviceAddress
-	 *            the address of the service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 */
-
-	public void install (String protocolIdentifier)
-	{
-	}
-
-	/**
-	 * Registers the interest of participant in a particular protocol.
-	 * 
-	 * @param participantProtocolServiceAddress
-	 *            the address of the participant protocol service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 * 
-	 * @return the PortReference of the coordinator protocol service
-	 * 
-	 * @throws AlreadyRegisteredException
-	 *             if the participant is already registered for this
-	 *             coordination protocol under this activity identifier
-	 * @throws InvalidProtocolException
-	 *             if the coordination protocol is not supported
-	 * @throws InvalidStateException
-	 *             if the state of the coordinator no longer allows registration
-	 *             for this coordination protocol
-	 * @throws NoActivityException
-	 *             if the activity does not exist.
-	 * 
-	 * @message com.arjuna.mwlabs.wst.ba.RegistrarImple_1
-	 *          [com.arjuna.mwlabs.wst.ba.RegistrarImple_1] - Invalid type URI: <
-	 *          {0} , {1} >
-	 */
-
-	public EndpointReferenceType register (
-			final EndpointReferenceType participantProtocolService,
-			final String protocolIdentifier,
-			final InstanceIdentifier instanceIdentifier)
-			throws AlreadyRegisteredException, InvalidProtocolException,
-			InvalidStateException, NoActivityException
-	{
-		ActivityHierarchy hier = (ActivityHierarchy) _hierarchies
-				.get(instanceIdentifier.getInstanceIdentifier());
-
-		if (hier == null) throw new NoActivityException();
-
-		try
-		{
-			_coordManager.resume(hier);
-		}
-		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-		{
-			throw new NoActivityException();
-		}
-		catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-		{
-			throw new InvalidProtocolException();
-		}
-
-		// TODO check for AlreadyRegisteredException
-
-		if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
-				.equals(protocolIdentifier))
-		{
-			// enlist participant that wraps the requester URI.
-			final String id = new Uid().stringForm();
-
-			try
-			{
-                final ParticipantCompletionCoordinatorEngine engine = new ParticipantCompletionCoordinatorEngine(id, participantProtocolService) ;
-				BusinessAgreementWithParticipantCompletionImple participant = new BusinessAgreementWithParticipantCompletionImple(
-						new BusinessAgreementWithParticipantCompletionStub(engine), id);
-                engine.setCoordinator(participant.participantManager()) ;
-
-				_coordManager.enlistParticipant(participant);
-
-				_coordManager.suspend();
-
-				return getParticipantManager(
-						BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
-						id);
-			}
-			catch (Exception ex)
-			{
-				throw new InvalidStateException();
-			}
-		}
-		else
-			if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
-					.equals(protocolIdentifier))
-			{
-				final String id = new Uid().stringForm();
-				try
-				{
-                    final CoordinatorCompletionCoordinatorEngine engine = new CoordinatorCompletionCoordinatorEngine(id, participantProtocolService) ;
-					BusinessAgreementWithCoordinatorCompletionImple participant = new BusinessAgreementWithCoordinatorCompletionImple(
-							new BusinessAgreementWithCoordinatorCompletionStub(engine), id);
-                    engine.setCoordinator(participant.participantManager()) ;
-
-					_coordManager.enlistParticipant(participant);
-
-					_coordManager.suspend();
-
-					return getParticipantManager(
-							BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
-							id);
-				}
-				catch (Exception ex)
-				{
-					throw new InvalidStateException();
-				}
-			}
-			else
-				if (ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
-				{
-					try
-					{
-						return getParticipantManager(
-								ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
-								instanceIdentifier.getInstanceIdentifier());
-					}
-					catch (Exception ex)
-					{
-						throw new InvalidStateException();
-					}
-				}
-				else
-				{
-					wstxLogger.arjLoggerI18N
-							.warn(
-									"com.arjuna.mwlabs.wst.ba.RegistrarImple_1",
-									new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
-
-					throw new InvalidProtocolException();
-				}
-	}
-
-	/**
-	 * Called when a registrar is removed from a register mapper. This method
-	 * will be called multiple times if the registrar is removed from multiple
-	 * register mappers or from the same register mapper with different protocol
-	 * identifiers.
-	 * 
-	 * @param serviceAddress
-	 *            the address of the service
-	 * @param protocolIdentifier
-	 *            the protocol identifier
-	 */
-
-	public void uninstall (String protocolIdentifier)
-	{
-	}
-
-	public final void associate () throws Exception
-	{
-		// TODO colocation won't do suspend
-
-		String txIdentifier = _coordManager.identifier().toString();
-		ActivityHierarchy hier = _coordManager.suspend();
-
-		_hierarchies.put(txIdentifier, hier);
-	}
-
-	public final void disassociate (String txIdentifier) throws Exception
-	{
-		_hierarchies.remove(txIdentifier);
-	}
-
-	private EndpointReferenceType getParticipantManager (final String service,
-			final String id)
-	{
-		final SoapRegistry soapRegistry = SoapRegistry.getRegistry();
-		final String participantManagerParticipantURI = soapRegistry
-				.getServiceURI(service);
-		final EndpointReferenceType participantManagerParticipant = new EndpointReferenceType(
-				new AttributedURIType(participantManagerParticipantURI));
-		InstanceIdentifier.setEndpointInstanceIdentifier(
-				participantManagerParticipant, id);
-		return participantManagerParticipant;
-	}
-
-	private CoordinatorManager _coordManager = null;
-
-	private HashMap _hierarchies = new HashMap();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,199 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BAParticipantManagerImple.java,v 1.5.6.1 2005/11/22 10:36:08 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba.remote;
-
-import com.arjuna.mw.wsas.activity.ActivityHierarchy;
-import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
-import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
-import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that the core exposes in order to allow different
- * types of participants to be enrolled. The messaging layer continues to
- * work in terms of the registrar, but internally we map to one of these
- * methods.
- *
- * This could also be the interface that high-level users see (e.g., at the
- * application Web Service).
- */
-
-public class BAParticipantManagerImple implements com.arjuna.wst.BAParticipantManager
-{
-
-    public BAParticipantManagerImple (String participantId)
-    {
-	try
-	{
-	    _coordManager = CoordinatorManagerFactory.coordinatorManager();
-	    _hier = _coordManager.currentActivity();
-	    _participantId = participantId;
-	}
-	catch (Exception ex)
-	{
-	    ex.printStackTrace();
-	}	
-    }
-	
-    public void exit () throws WrongStateException, UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier == null)
-		throw new UnknownTransactionException();
-	    
-	    _coordManager.resume(_hier);
-	    
-	    _coordManager.delistParticipant(_participantId);
-
-	    _coordManager.suspend();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
-	{
-	    throw new SystemException("UnknownParticipantException");
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new WrongStateException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    public void completed () throws WrongStateException, UnknownTransactionException, SystemException
-    {
-	try
-	{
-	    if (_hier == null)
-		throw new UnknownTransactionException();
-	    
-	    _coordManager.resume(_hier);
-
-	    _coordManager.participantCompleted(_participantId);
-
-	    _coordManager.suspend();
-	}
-    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
-	{
-	    throw new SystemException("UnknownParticipantException");
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new WrongStateException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
-	{
-	    throw new UnknownTransactionException();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    public void fault () throws SystemException
-    {
-	try
-	{
-        if (_hier == null)
-            throw new UnknownTransactionException();
-            
-            _coordManager.resume(_hier);
-
-            _coordManager.participantFaulted(_participantId);
-
-            _coordManager.suspend();
-	}
-    catch (final InvalidActivityException iae)
-    {
-        throw new SystemException("UnknownTransactionException");
-    }
-    catch (final UnknownTransactionException ute)
-    {
-        throw new SystemException("UnknownTransactionException");
-    }
-	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
-	{
-	    throw new SystemException("UnknownParticipantException");
-	}
-    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
-	{
-	    throw new SystemException("UnknownTransactionException");
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    public void unknown () throws SystemException
-    {
-	// ??
-    }
-    
-    public void error () throws SystemException
-    {
-	try
-	{
-	    _coordManager.setCancelOnly();
-	}
-	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
-	{
-	    throw new SystemException(ex.toString());
-	}
-    }
-
-    private CoordinatorManager _coordManager = null;
-    private ActivityHierarchy  _hier = null;
-    private String             _participantId = null;
-
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,209 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: BusinessActivityManagerImple.java,v 1.7.4.1 2005/11/22 10:36:08 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba.remote;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.mwlabs.wst.ba.context.TxContextImple;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessor;
-import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessor;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.AlreadyRegisteredException;
-import com.arjuna.wsc.RegistrationCoordinator;
-import com.arjuna.wst.BAParticipantManager;
-import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
-import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipantEngine;
-import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
-import com.arjuna.wst.stub.BACoordinatorCompletionParticipantManagerStub;
-import com.arjuna.wst.stub.BAParticipantCompletionParticipantManagerStub;
-
-/**
- * This is the interface that the core exposes in order to allow different
- * types of participants to be enrolled. The messaging layer continues to
- * work in terms of the registrar, but internally we map to one of these
- * methods.
- */
-
-public class BusinessActivityManagerImple extends BusinessActivityManager
-{
-    public BusinessActivityManagerImple ()
-    {
-    }
-	
-    public BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion (BusinessAgreementWithParticipantCompletionParticipant bap, String id)
-        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
-    {
-        final EndpointReferenceType participant = getParticipant(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT, id) ;
-    	try
-    	{
-            EndpointReferenceType baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
-            final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap) ;
-            ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
-    
-            return new BAParticipantCompletionParticipantManagerStub(engine);
-    	}
-    	catch (com.arjuna.wsc.InvalidProtocolException ex)
-    	{
-    	    throw new SystemException(ex.toString());
-    	}
-    	catch (com.arjuna.wsc.InvalidStateException ex)
-    	{
-    	    throw new WrongStateException();
-    	}
-    	catch (com.arjuna.wsc.NoActivityException ex)
-    	{
-    	    throw new UnknownTransactionException();
-    	}
-    	catch (Throwable ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new SystemException(ex.toString());
-    	}
-    }
-
-    public BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion (BusinessAgreementWithCoordinatorCompletionParticipant bawcp, String id) throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
-    {
-        final EndpointReferenceType participant = getParticipant(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT, id) ;
-    	try
-    	{
-    	    EndpointReferenceType baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
-            final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, baPMEndpoint, bawcp) ;
-            CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
-        
-            return new BACoordinatorCompletionParticipantManagerStub(engine);
-    	}
-    	catch (com.arjuna.wsc.InvalidProtocolException ex)
-    	{
-    	    throw new SystemException(ex.toString());
-    	}
-    	catch (com.arjuna.wsc.InvalidStateException ex)
-    	{
-    	    throw new WrongStateException();
-    	}
-    	catch (com.arjuna.wsc.NoActivityException ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new UnknownTransactionException();
-    	}
-    	catch (Throwable ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new SystemException(ex.toString());
-    	}
-    }
-
-    public TxContext suspend () throws SystemException
-    {
-        return _ctxManager.suspend();
-    }
-
-    // resume overwrites. Should we check first a la JTA?
-
-    public void resume (TxContext tx) throws UnknownTransactionException, SystemException
-    {
-        _ctxManager.resume(tx);
-    }
-
-    public TxContext currentTransaction () throws SystemException
-    {
-        return _ctxManager.currentTransaction();
-    }
-	
-    private final EndpointReferenceType registerParticipant(final EndpointReferenceType participant, final String protocol)
-        throws com.arjuna.wsc.InvalidProtocolException, com.arjuna.wsc.InvalidStateException, com.arjuna.wsc.NoActivityException, SystemException
-    {
-    	TxContextImple currentTx = null;
-    
-    	try
-    	{
-    	    currentTx = (TxContextImple) _ctxManager.currentTransaction();
-    	    
-    	    if (currentTx == null)
-        		throw new com.arjuna.wsc.NoActivityException();
-
-            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
-            final String messageId = new Uid().stringForm() ;
-            return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
-    	}
-        catch (final SoapFault sf)
-        {
-            throw new SystemException(sf.getMessage());
-        }
-    	catch (com.arjuna.wsc.NoActivityException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (Exception ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new SystemException(ex.toString());
-    	}
-    	finally
-    	{
-    	    try
-    	    {
-        		if (currentTx != null)
-        		    _ctxManager.resume(currentTx);
-    	    }
-    	    catch (Exception ex)
-    	    {
-        		ex.printStackTrace();
-    	    }
-    	}
-    }
-
-    private EndpointReferenceType getParticipant(final String participantService, final String id)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String participantServiceURI = soapRegistry.getServiceURI(participantService) ;
-        final EndpointReferenceType endpoint = new EndpointReferenceType(new AttributedURIType(participantServiceURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(endpoint, id) ;
-        return endpoint ;
-    }
-    
-    private ContextManager _ctxManager = new ContextManager();
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,321 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2003,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserBusinessActivityImple.java,v 1.10.4.1 2005/11/22 10:36:07 kconner Exp $
- */
-
-package com.arjuna.mwlabs.wst.ba.remote;
-
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.UserBusinessActivity;
-import com.arjuna.mw.wst.common.Environment;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mwlabs.wst.ba.ContextImple;
-import com.arjuna.mwlabs.wst.ba.context.TxContextImple;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.wsaddr.AttributedURIType;
-import com.arjuna.webservices.wsaddr.EndpointReferenceType;
-import com.arjuna.webservices.wsarj.InstanceIdentifier;
-import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc.RegistrationCoordinator;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.wst.stub.BusinessActivityTerminatorStub;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- *
- * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_1 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_1] - Invalid address.
- * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2] - Received context is null!
- * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3] - No termination context!
- */
-
-public class UserBusinessActivityImple extends UserBusinessActivity
-{
-    public UserBusinessActivityImple ()
-    {
-        try
-        {
-            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
-
-            /*
-             * If the coordinator URL hasn't been specified via the
-             * configuration file then assume we are using a locally registered
-             * implementation.
-             */
-
-            if (_activationCoordinatorService == null)
-            {
-                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-                _activationCoordinatorService = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
-            }
-        }
-        catch (Exception ex)
-        {
-            // TODO
-
-            ex.printStackTrace();
-        }
-    }
-    
-    public void begin () throws WrongStateException, SystemException
-    {
-    	begin(0);
-    }
-    
-    public void begin (int timeout) throws WrongStateException, SystemException
-    {
-    	try
-    	{
-    	    if (_ctxManager.currentTransaction() != null)
-        		throw new WrongStateException();
-    
-    	    com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout);
-    
-    	    _ctxManager.resume(new TxContextImple(ctx));
-    	}
-    	catch (com.arjuna.wsc.InvalidCreateParametersException ex)
-    	{
-    	    tidyup();
-    
-    	    throw new SystemException(ex.toString());
-    	}
-    	catch (com.arjuna.wst.UnknownTransactionException ex)
-    	{
-    	    tidyup();
-    
-    	    throw new SystemException(ex.toString());
-    	}
-    	catch (SystemException ex)
-    	{
-    	    tidyup();
-    
-    	    throw ex;
-    	}
-    }
-
-    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
-    {
-    	TxContextImple ctx = null;
-    
-    	try
-    	{
-    	    ctx = (TxContextImple) _ctxManager.suspend();
-            
-            final String id = ctx.identifier() ;
-            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
-            
-    	    BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
-    	    
-    	    terminatorStub.close();
-    	}
-    	catch (SystemException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (TransactionRolledBackException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (UnknownTransactionException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (Exception ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new SystemException(ex.toString());
-    	}
-    	finally
-    	{
-    	    tidyup();
-    	}
-    }
-
-    public void cancel () throws UnknownTransactionException, SystemException
-    {
-    	TxContextImple ctx = null;
-    
-    	try
-    	{
-            ctx = (TxContextImple) _ctxManager.suspend();
-            
-            final String id = ctx.identifier() ;
-            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
-            
-            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
-    	    
-    	    terminatorStub.cancel();
-    	}
-    	catch (SystemException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (UnknownTransactionException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (Exception ex)
-    	{
-    	    ex.printStackTrace();
-    	    
-    	    throw new SystemException(ex.toString());
-    	}
-    	finally
-    	{
-    	    tidyup();
-    	}
-    }
-
-    public void complete () throws UnknownTransactionException, SystemException
-    {
-    	try
-    	{
-            final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction()) ;
-            final String id = ctx.identifier() ;
-            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
-            
-            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
-            
-    	    terminatorStub.complete();
-    	}
-    	catch (SystemException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (UnknownTransactionException ex)
-    	{
-    	    throw ex;
-    	}
-    	catch (Exception ex)
-    	{
-    	    throw new SystemException(ex.toString());
-    	}
-    }
-
-    public String transactionIdentifier ()
-    {
-    	try
-    	{
-    	    return _ctxManager.currentTransaction().toString();
-    	}
-    	catch (com.arjuna.wst.SystemException ex)
-    	{
-    	    return "Unknown";
-    	}
-    	catch (NullPointerException ex)
-    	{
-    	    return "Unknown";
-    	}
-    }
-
-    public String toString ()
-    {
-    	return transactionIdentifier();
-    }
-
-    private final com.arjuna.mw.wsc.context.Context startTransaction (int timeout) throws com.arjuna.wsc.InvalidCreateParametersException, SystemException
-    {
-        try
-        {
-            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
-            final String messageId = new Uid().stringForm() ;
-            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
-                    _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, null) ;
-            if (coordinationContext == null)
-            {
-                throw new SystemException(
-                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2"));
-            }
-            return new ContextImple(coordinationContext) ;
-        }
-        catch (final InvalidCreateParametersException icpe)
-        {
-            throw icpe ;
-        }
-        catch (final SoapFault sf)
-        {
-            throw new SystemException(sf.getMessage()) ;
-        }
-        catch (final Exception ex)
-        {
-            throw new SystemException(ex.toString());
-        }
-	}
-    
-    private EndpointReferenceType getTerminationCoordinator(final TxContextImple ctx)
-        throws SystemException
-    {
-        final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext() ;
-        final String messageId = new Uid().stringForm() ;
-        try
-        {
-            return RegistrationCoordinator.register(coordinationContext, messageId,
-                getParticipantProtocolService(ctx.identifier()), ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
-        }
-        catch (final Throwable th)
-        {
-            throw new SystemException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3"));
-        }
-    }
-    
-    private EndpointReferenceType getParticipantProtocolService(final String id)
-    {
-        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
-        final String serviceURI = soapRegistry.getServiceURI(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT) ;
-        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
-        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
-        return participant ;
-    }
-
-    private final void tidyup ()
-    {
-    	try
-    	{
-    	    _ctxManager.suspend();
-    	}
-    	catch (Exception ex)
-    	{
-    	    ex.printStackTrace();
-    	}
-    }
-    
-    private ContextManager _ctxManager = new ContextManager();
-    private String _activationCoordinatorService;
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,223 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wstx.model.as.twophase;
-
-import com.arjuna.mw.wscf.model.as.CoordinatorManager;
-import com.arjuna.mw.wscf.model.as.CoordinatorManagerFactory;
-
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.common.*;
-
-import com.arjuna.mw.wstx.resource.Participant;
-import com.arjuna.mw.wstx.resource.Synchronization;
-
-import com.arjuna.mw.wstx.TransactionManager;
-
-import com.arjuna.mwlabs.wstx.model.as.twophase.resource.ParticipantAction;
-import com.arjuna.mwlabs.wstx.model.as.twophase.resource.SynchronizationAction;
-
-import com.arjuna.mw.wstx.exceptions.DuplicateParticipantException;
-import com.arjuna.mw.wstx.exceptions.NoTransactionException;
-import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
-import com.arjuna.mw.wstx.exceptions.InvalidParticipantException;
-import com.arjuna.mw.wstx.exceptions.DuplicateSynchronizationException;
-import com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
-import com.arjuna.mw.wsas.exceptions.ActiveChildException;
-
-/**
- * This is the service side component of the user interface. Since services
- * or some entity acting on their behalf (e.g., an interceptor) must enlist
- * participants with the transaction (atom or cohesion), this interface
- * primarily concentrates on those methods. However, a service may well
- * not be the final destination for a transaction, i.e., in order to perform
- * its work, the service may have to make other remote invocations on other
- * services and propagate the context, suspend it, etc. As such, all of the
- * UserTransaction methods are also available to the service.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
- * @since 1.0.
- */
-
-public class TwoPhaseTxManager implements TransactionManager
-{
-
-    public TwoPhaseTxManager ()
-    {
-	try
-	{
-	    _coordinatorManager = CoordinatorManagerFactory.coordinatorManager();
-	}
-	catch (Exception ex)
-	{
-	    // TODO
-
-	    ex.printStackTrace();
-	    
-	    _coordinatorManager = null;
-	}
-    }
-    
-    /**
-     * Enrol the specified participant in the current transaction.
-     * It is illegal to call this method when no transaction is associated
-     * with the thread.
-     *
-     * @param Participant participant The participant to enrol.
-     * @exception WrongStateException Thrown if the transaction is not in a state
-     * whereby participants can be enrolled.
-     * @exception DuplicateParticipantException Thrown if the participant identifier
-     * has already been associated with a participant.
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the invoking thread.
-     * @exception InvalidTransactionException Thrown if the transaction associated with
-     * the thread is invalid.
-     * @exception InvalidParticipantException Thrown if the participant reference
-     * is invalid.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void enlist (Participant participant) throws WrongStateException, DuplicateParticipantException, NoTransactionException, InvalidTransactionException, InvalidParticipantException, SystemException
-    {
-	try
-	{
-	    _coordinatorManager.addParticipant(new ParticipantAction(participant), Priorities.PARTICIPANT, null);
-	}
-	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
-	{
-	    throw new DuplicateParticipantException();
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
-	{
-	    throw new InvalidParticipantException();
-	}
-    }
-    
-    /**
-     * Cause the specified participant to resign from the transaction.
-     * CAUTION: use with *extreme* care since if invoked at the wrong time
-     * it could lead to data corruption or state modifications that are
-     * no longer under the control of the transaction. You *must* ensure
-     * that no state changes have been made that should be controlled by
-     * the specified participant.
-     *
-     * @param Participant participant The participant to resign.
-     * @exception InvalidTransactionException Thrown if the transaction associated with
-     * the thread is invalid.
-     * @exception NoTransactionException Thrown if no transaction is associated
-     * with the invoking thread.
-     * @exception InvalidParticipantException Thrown if the transaction does not know
-     * about the specified participant or the parameter is invalid.
-     * @exception WrongStateException Thrown if the transaction is not in a state
-     * that allows participants to resign.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void delist (Participant participant) throws InvalidTransactionException, NoTransactionException, InvalidParticipantException, WrongStateException, SystemException
-    {
-	// TODO: support it!
-
-	throw new WrongStateException();
-    }
-
-    /**
-     * Enlist a synchronization with the current transaction. Synchronizations
-     * do not receive the two-phase commit messages but instead are invoked
-     * prior to its start and after it has completed.
-     *
-     * @param Synchronization participant The synchronization to enroll.
-     *
-     * @exception WrongStateException Thrown if the transaction state is such
-     * that synchronizations cannot be enrolled.
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the invoking thread.
-     * @exception InvalidTransactionException Thrown if the transaction is not
-     * top-level.
-     * @exception InvalidSynchronizationException Thrown if the synchronization
-     * reference is invalid.
-     * @exception DuplicateSynchronizationException Thrown if the synchronization
-     * has already been registered with the transaction.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void addSynchronization (Synchronization participant) throws WrongStateException, NoTransactionException, InvalidTransactionException, InvalidSynchronizationException, DuplicateSynchronizationException, SystemException
-    {
-	try
-	{
-	    _coordinatorManager.addParticipant(new SynchronizationAction(participant), Priorities.SYNCHRONIZATION, null);
-	}
-	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
-	{
-	    throw new DuplicateSynchronizationException();
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
-	{
-	    throw new InvalidSynchronizationException();
-	}
-    }
-
-    /**
-     * Remove the specified synchronization participant from the transaction.
-     *
-     * @param Synchronization participant The participant to remove.
-     *
-     * @exception InvalidTransactionException Thrown if the transaction is not
-     * top-level.
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the current thread.
-     * @exception InvalidSynchronizationException Thrown if the transaction
-     * does not know about the specified synchronization.
-     * @exception WrongStateException Thrown if the state of the transaction is
-     * such that the synchronization cannot be removed.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void removeSynchronization (Synchronization participant) throws SystemException, InvalidTransactionException, NoTransactionException, InvalidSynchronizationException, WrongStateException
-    {
-	throw new WrongStateException();
-    }
-
-    private CoordinatorManager _coordinatorManager;
-    
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,563 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
- */
-
-package com.arjuna.mwlabs.wstx.model.as.twophase;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-
-import com.arjuna.mw.wstx.UserTransaction;
-
-import com.arjuna.mw.wstx.transaction.*;
-import com.arjuna.mw.wstx.status.*;
-
-import com.arjuna.mw.wstx.common.TxId;
-
-import com.arjuna.mwlabs.wstx.transaction.*;
-
-import com.arjuna.mwlabs.wstx.common.arjunacore.TxIdImple;
-
-import com.arjuna.mw.wsas.status.*;
-
-import com.arjuna.mw.wsas.activity.*;
-
-import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
-import com.arjuna.mw.wsas.completionstatus.Success;
-import com.arjuna.mw.wsas.completionstatus.Failure;
-import com.arjuna.mw.wsas.completionstatus.FailureOnly;
-
-import com.arjuna.mw.wscf.UserCoordinator;
-import com.arjuna.mw.wscf.UserCoordinatorFactory;
-
-import com.arjuna.mw.wscf.common.Qualifier;
-import com.arjuna.mw.wscf.common.CoordinatorId;
-
-import com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.CoordinatorIdImple;
-
-import com.arjuna.mw.wscf.model.twophase.common.TwoPhaseResult;
-import com.arjuna.mw.wscf.model.twophase.status.*;
-import com.arjuna.mw.wscf.model.twophase.outcomes.*;
-
-import com.arjuna.mw.wscf.model.as.coordinator.twophase.outcomes.*;
-
-import com.arjuna.mw.wsas.exceptions.SystemException;
-import com.arjuna.mw.wsas.exceptions.WrongStateException;
-import com.arjuna.mw.wsas.exceptions.InvalidTimeoutException;
-import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
-import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
-import com.arjuna.mw.wsas.exceptions.NoActivityException;
-import com.arjuna.mw.wsas.exceptions.NoPermissionException;
-import com.arjuna.mw.wsas.exceptions.ActiveChildException;
-
-import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
-
-import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
-import com.arjuna.mw.wstx.exceptions.NoTransactionException;
-import com.arjuna.mw.wstx.exceptions.HeuristicHazardException;
-import com.arjuna.mw.wstx.exceptions.HeuristicMixedException;
-import com.arjuna.mw.wstx.exceptions.HeuristicCommitException;
-import com.arjuna.mw.wstx.exceptions.HeuristicRollbackException;
-import com.arjuna.mw.wstx.exceptions.TransactionRolledBackException;
-import com.arjuna.mw.wstx.exceptions.TransactionCommittedException;
-
-/**
- * The user portion of the transaction API.
- *
- * @author Mark Little (mark.little at arjuna.com)
- * @version $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
- * @since 1.0.
- *
- * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2] - Transaction has active children.
- * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3] - Unknown end result!
- */
-
-public class UserTwoPhaseTx implements UserTransaction
-{
-
-    public UserTwoPhaseTx ()
-    {
-	try
-	{
-	    /*
-	     * TODO: currently relies on the fact that the default
-	     * coordination protocol is two-phase. Needs to be explicit.
-	     */
-
-	    _theCoordinator = UserCoordinatorFactory.userCoordinator();
-	}
-	catch (SystemException ex)
-	{
-	    // TODO
-
-	    ex.printStackTrace();
-	    
-	    _theCoordinator = null;
-	}
-	catch (ProtocolNotRegisteredException ex)
-	{
-	    ex.printStackTrace();
-	    
-	    _theCoordinator = null;
-	}
-    }
-    
-    /**
-     * Start a new transaction. If there is already a transaction associated
-     * with the thread then it will be interposed (nesting is to come!)
-     *
-     * @exception WrongStateException Thrown if the any currently associated
-     * transaction is in a state that does not allow a new transaction to be
-     * enlisted.
-     * @exception SystemException Thrown in any other situation.
-     */
-
-    public void begin () throws WrongStateException, SystemException
-    {
-	_theCoordinator.start();
-    }
-
-    /**
-     * Commit the transaction. All participants that are still enlisted
-     * with the transaction are committed.
-     *
-     * @exception InvalidTransactionException Thrown if the current transaction is not
-     * known about by the transaction system.
-     * @exception WrongStateException Thrown if the current transaction is not in a
-     * state that allows commit to be called.
-     * @exception HeuristicHazardException Thrown if the participants generated a hazard
-     * heuristic.
-     * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the invoking thread.
-     * @exception SystemException Thrown if some other error occurred.
-     */
-
-    public void commit () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionRolledBackException, SystemException
-    {
-	try
-	{
-	    Outcome result = _theCoordinator.end(Success.instance());
-	 
-	    parseOutcome(result, true);
-	}
-	catch (ActiveChildException ex)
-	{
-	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2"));
-	}
-	catch (TransactionCommittedException ex)
-	{
-	}
-	catch (InvalidActivityException ex)
-	{
-	    throw new InvalidTransactionException();
-	}
-	catch (WrongStateException ex)
-	{
-	    throw ex;
-	}
-	catch (ProtocolViolationException ex)
-	{
-	    throw new HeuristicHazardException(ex.toString());
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-	catch (NoPermissionException ex)
-	{
-	    throw new InvalidTransactionException(ex.toString());
-	}
-	catch (HeuristicHazardException ex)
-	{
-	    throw ex;
-	}
-    }
-
-    /**
-     * Abort the transaction. All participants that are still enlisted
-     * with the transaction are rolled back.
-     *
-     * @exception InvalidTransactionException Thrown if the current transaction is not
-     * known about by the transaction system.
-     * @exception WrongStateException Thrown if the current transaction is not in a
-     * state that allows cancel to be called.
-     * @exception HeuristicHazardException Thrown if the participants generated a hazard
-     * heuristic.
-     * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the invoking thread.
-     * @exception SystemException Thrown if some other error occurred.
-     */
-
-    public void rollback () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionCommittedException, SystemException
-    {
-	try
-	{
-	    Outcome result = _theCoordinator.end(Failure.instance());
-
-	    parseOutcome(result, false);
-	}
-	catch (ActiveChildException ex)
-	{
-	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2"));
-	}
-	catch (TransactionRolledBackException ex)
-	{
-	}
-	catch (InvalidActivityException ex)
-	{
-	    throw new InvalidTransactionException();
-	}
-	catch (WrongStateException ex)
-	{
-	    throw ex;
-	}
-	catch (ProtocolViolationException ex)
-	{
-	    throw new HeuristicHazardException(ex.toString());
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-	catch (NoPermissionException ex)
-	{
-	    throw new InvalidTransactionException(ex.toString());
-	}
-	catch (HeuristicHazardException ex)
-	{
-	    throw ex;
-	}
-    }
-
-    /**
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the status of the current transaction. If there is no
-     * transaction associated with the thread then NO_TRANSACTION
-     * will be returned.
-     */
-
-    public Status status () throws SystemException
-    {
-	Status s = _theCoordinator.status();
-	
-	if (s instanceof Cancelling)
-	    s = RollingBack.instance();
-	else
-	{
-	    if (s instanceof CancelOnly)
-		s = RollbackOnly.instance();
-	    else
-	    {
-		if (s instanceof Confirming)
-		    s = Committing.instance();
-		else
-		{
-		    if (s instanceof Confirmed)
-			s = Committed.instance();
-		    else
-		    {
-			if (s instanceof Cancelled)
-			    s = RolledBack.instance();
-			else
-			{
-			    if (s instanceof NoActivity)
-				s = NoTransaction.instance();
-			}
-		    }
-		}
-	    }
-	}
-
-	return s;
-    }
-
-    /**
-     * What is the name of the current transaction? Use only for
-     * debugging purposes.
-     *
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the invoking thread.
-     *
-     * @return the name of the transaction.
-     */
-
-    public String transactionName () throws NoTransactionException, SystemException
-    {
-	try
-	{
-	    return _theCoordinator.activityName();
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-    }
-    
-    /**
-     * Suspend all transactions associated with this thread. The thread then
-     * becomes associated with no transaction (atom or cohesion).
-     *
-     * @exception SystemException if any error occurs.
-     *
-     * @return a representation of the context associated with the thread,
-     * or null if there is no context.
-     */
-
-    public TransactionHierarchy suspend () throws SystemException
-    {
-	ActivityHierarchy hier = _theCoordinator.suspend();
-	
-	if (hier != null)
-	    return new TransactionHierarchyImple(hier);
-	else
-	    return null;
-    }
-    
-    /**
-     * Associate this thread with the specified context. Any current
-     * associations are lost.
-     *
-     * @param TransactionHierarchy tx The context representation to associate (may be
-     * null).
-     *
-     * @exception InvalidTransactionException Thrown if the context is invalid.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void resume (TransactionHierarchy tx) throws InvalidTransactionException, SystemException
-    {
-	ActivityHierarchy hier;
-
-	if (tx == null)
-	    hier = null;
-	else
-	{
-	    if (tx instanceof TransactionHierarchyImple)
-	    {
-		hier = ((TransactionHierarchyImple) tx).activityHierarchy();
-	    }
-	    else
-		throw new InvalidTransactionException();
-	}
-
-	try
-	{
-	    _theCoordinator.resume(hier);
-	}
-	catch (InvalidActivityException ex)
-	{
-	    throw new InvalidTransactionException();
-	}
-    }
-
-    /**
-     * @return a representation of the context currently associated with
-     * the invoking thread, or null if there is none.
-     */
-
-    public TransactionHierarchy currentTransaction () throws SystemException
-    {
-	ActivityHierarchy hier = _theCoordinator.currentActivity();
-	
-	if (hier != null)
-	    return new TransactionHierarchyImple(hier);
-	else
-	    return null;
-    }
-
-    /**
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the current thread.
-     * @exception SystemException Thrown if any other error occurs.
-     *
-     * @return the qualifiers that are currently associated with the
-     * transaction, or null if there are none.
-     */
-
-    public Qualifier[] qualifiers () throws NoTransactionException, SystemException
-    {
-	try
-	{
-	    return _theCoordinator.qualifiers();
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-    }
-
-    /**
-     * Set the state of the transaction such that the only possible outcome is
-     * for it to rollback.
-     *
-     * @exception NoTransactionException Thrown if there is no transaction
-     * associated with the current thread.
-     * @exception WrongStateException Thrown if the state of the transaction is
-     * such that it is not possible to put it into a rollback-only state, e.g.,
-     * it is committing.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void setRollbackOnly () throws NoTransactionException, WrongStateException, SystemException
-    {
-	try
-	{
-	    _theCoordinator.setCompletionStatus(FailureOnly.instance());
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-    }
-
-    /**
-     * Get the timeout value currently associated with transactions.
-     *
-     * @exception SystemException Thrown if any error occurs.
-     *
-     * @return the timeout value in seconds, or 0 if no application specified
-     * timeout has been provided.
-     */
-
-    public int getTimeout () throws SystemException
-    {
-	// TODO
-
-	return 0;
-    }
-
-    /**
-     * Set the timeout to be associated with all subsequently created
-     * activities. A default value of 0 is automatically associated with
-     * each thread and this means that no application specified timeout is
-     * set for activities.
-     *
-     * @param int timeout The timeout (in seconds) to associate with all
-     * subsequently created activities. This value must be 0 or greater.
-     *
-     * @exception InvalidTimeoutException Thrown if the timeout value provided
-     * is negative, too large, or if timeouts are simply not supported by
-     * the activity implementation.
-     * @exception SystemException Thrown if any other error occurs.
-     */
-
-    public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException
-    {
-	// TODO
-    }
-
-    /**
-     * @exception NoTransactionException Thrown if there is no activity
-     * associated with the invoking thread.
-     * @exception SystemException Thrown if some other error occurred.
-     *
-     * @return the unique transaction id for the current transaction. This
-     * may or may not be the same as the activity id.
-     *
-     * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1] - Unknown coordinator identifier type {0}
-     */
-
-    public TxId identifier () throws NoTransactionException, SystemException
-    {
-	try
-	{
-	    CoordinatorId coordId = _theCoordinator.identifier();
-
-	    if (coordId instanceof CoordinatorIdImple)
-		return new TxIdImple((CoordinatorIdImple) coordId);
-	    else
-	    {
-		wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1",
-					      new Object[]{coordId});
-	    
-		return null;
-	    }
-	}
-	catch (NoActivityException ex)
-	{
-	    throw new NoTransactionException();
-	}
-    }
-    
-    private final void parseOutcome (Outcome out, boolean commit) throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, TransactionRolledBackException, TransactionCommittedException
-    {
-	try
-	{
-	    if ((out.completedStatus().equals(Failure.instance()) ||
-		 out.completedStatus().equals(FailureOnly.instance())) && commit)
-	    {
-		throw new TransactionRolledBackException();
-	    }
-	}
-	catch (SystemException ex)
-	{
-	    throw new HeuristicHazardException();
-	}
-	
-	if (out instanceof CoordinationOutcome)
-	{
-	    int res = ((CoordinationOutcome) out).result();
-
-	    switch (res)
-	    {
-	    case TwoPhaseResult.CANCELLED:
-	    case TwoPhaseResult.HEURISTIC_CANCEL:
-		{
-		    if (commit)
-			throw new TransactionRolledBackException();
-		}
-		break;
-	    case TwoPhaseResult.CONFIRMED:
-	    case TwoPhaseResult.HEURISTIC_CONFIRM:
-		{
-		    if (!commit)
-			throw new TransactionCommittedException();
-		}
-		break;
-	    case TwoPhaseResult.HEURISTIC_MIXED:
-		throw new HeuristicMixedException();
-	    case TwoPhaseResult.HEURISTIC_HAZARD:
-		throw new HeuristicHazardException();
-	    case TwoPhaseResult.FINISH_OK:
-		break;
-	    case TwoPhaseResult.FINISH_ERROR:
-	    default:
-		throw new HeuristicHazardException();
-	    }
-	}
-	else
-	    throw new HeuristicHazardException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3"));
-    }
-    
-    private UserCoordinator _theCoordinator;
-    
-}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManager.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManager.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,133 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * As with UserTransaction a TransactionManager does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread transaction context.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class BusinessActivityManager
+{
+    /**
+     * The manager.
+     */
+    private static BusinessActivityManager MANAGER ;
+    
+    /**
+     * Get the business activity manager.
+     * @return The business activity manager.
+     */
+    public static synchronized BusinessActivityManager getBusinessActivityManager()
+    {
+        return MANAGER ;
+    }
+    
+    /**
+     * Set the business activity manager.
+     * @param manager The business activity manager.
+     */
+    public static synchronized void setBusinessActivityManager(final BusinessActivityManager manager)
+    {
+        MANAGER = manager ;
+    }
+
+    /**
+     * Enlist a participant for the BusinessAgreement protocol.
+     *
+     * @return the BAParticipantManager for this transaction.
+     */
+    public abstract BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion(
+        final BusinessAgreementWithParticipantCompletionParticipant bap, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * Enlist a participant for the BusinessAgreementWithCoordinatorCompletion protocol.
+     *
+     * @return the BAParticipantManager for this transaction.
+     */
+    public abstract BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion(
+        final BusinessAgreementWithCoordinatorCompletionParticipant bawcp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * The resume method can be used to (re-)associate a thread with a 
+     * transaction(s) via its TxContext. Prior to association, the thread is
+     * disassociated with any transaction(s) with which it may be currently
+     * associated. If the TxContext is null, then the thread is associated with
+     * no transaction. The UnknownTransactionException exception is thrown if
+     * the transaction that the TxContext refers to is invalid in the scope of
+     * the invoking thread.
+     */
+    public abstract void resume(final TxContext txContext)
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * A thread of control may require periods of non-transactionality so that
+     * it may perform work that is not associated with a specific transaction.
+     * In order to do this it is necessary to disassociate the thread from any
+     * transactions. The suspend method accomplishes this, returning a
+     * TxContext instance, which is a handle on the transaction. The thread is
+     * then no longer associated with any transaction.
+     */
+    public abstract TxContext suspend()
+        throws SystemException;
+    
+    /**
+     * The currentTransaction method returns the TxContext for the current
+     * transaction, or null if there is none. Unlike suspend, this method does
+     * not disassociate the current thread from the transaction(s). This can
+     * be used to enable multiple threads to execute within the scope of the
+     * same transaction.
+     */
+    public abstract TxContext currentTransaction()
+        throws SystemException;
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/BusinessActivityManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/BusinessActivityManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManagerFactory.java,v 1.4.8.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+
+public class BusinessActivityManagerFactory
+{
+    public static BusinessActivityManager businessActivityManager ()
+    {
+        return BusinessActivityManager.getBusinessActivityManager() ;
+	}
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManager.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManager.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,141 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+import com.arjuna.wst.*;
+
+import com.arjuna.wsc.AlreadyRegisteredException;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * This could also be the interface that high-level users see (e.g., at the
+ * application Web Service).
+ *
+ * As with UserTransaction a TransactionManager does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread transaction context.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class TransactionManager
+{
+    /**
+     * The manager.
+     */
+    private static TransactionManager TRANSACTION_MANAGER ;
+    
+    /**
+     * Get the transaction manager.
+     * @return The transaction manager.
+     */
+    public static synchronized TransactionManager getTransactionManager()
+    {
+        return TRANSACTION_MANAGER ;
+    }
+    
+    /**
+     * Set the transaction manager.
+     * @param manager The transaction manager.
+     */
+    public static synchronized void setTransactionManager(final TransactionManager manager)
+    {
+        TRANSACTION_MANAGER = manager ;
+    }
+
+    /**
+     * Enlist the specified participant with current transaction such that it
+     * will participate in the Volatile 2PC protocol; a unique identifier for
+     * the participant is also required. If there is no transaction associated
+     * with the invoking thread then the UnknownTransactionException exception
+     * is thrown. If the coordinator already has a participant enrolled with
+     * the same identifier, then AlreadyRegisteredException will be thrown. If
+     * the transaction is not in a state where participants can be enrolled
+     * (e.g., it is terminating) then WrongStateException will be thrown.
+     */
+    public abstract void enlistForVolatileTwoPhase(final Volatile2PCParticipant pzp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * Enlist the specified participant with current transaction such that it
+     * will participate in the 2PC protocol; a unique identifier for the
+     * participant is also required. If there is no transaction associated with
+     * the invoking thread then the UnknownTransactionException exception is
+     * thrown. If the coordinator already has a participant enrolled with the 
+     * same identifier, then AlreadyRegisteredException will be thrown. If the
+     * transaction is not in a state where participants can be enrolled (e.g.,
+     * it is terminating) then WrongStateException will be thrown.
+     */
+    public abstract void enlistForDurableTwoPhase(final Durable2PCParticipant tpp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    public abstract int replay () throws SystemException;
+
+    /**
+     * The resume method can be used to (re-)associate a thread with a 
+     * transaction(s) via its TxContext. Prior to association, the thread is
+     * disassociated with any transaction(s) with which it may be currently
+     * associated. If the TxContext is null, then the thread is associated with
+     * no transaction. The UnknownTransactionException exception is thrown if
+     * the transaction that the TxContext refers to is invalid in the scope of
+     * the invoking thread.
+     */
+    public abstract void resume(final TxContext txContext)
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * A thread of control may require periods of non-transactionality so that
+     * it may perform work that is not associated with a specific transaction.
+     * In order to do this it is necessary to disassociate the thread from any
+     * transactions. The suspend method accomplishes this, returning a
+     * TxContext instance, which is a handle on the transaction. The thread is
+     * then no longer associated with any transaction.
+     */
+    public abstract TxContext suspend()
+        throws SystemException;
+    
+    /**
+     * The currentTransaction method returns the TxContext for the current
+     * transaction, or null if there is none. Unlike suspend, this method does
+     * not disassociate the current thread from the transaction(s). This can
+     * be used to enable multiple threads to execute within the scope of the
+     * same transaction.
+     */
+    public abstract TxContext currentTransaction()
+        throws SystemException;
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/TransactionManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerFactory.java,v 1.8.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+
+public class TransactionManagerFactory
+{
+    public static TransactionManager transactionManager ()
+    {
+    	return TransactionManager.getTransactionManager() ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivity.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivity.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivity.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivity.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,126 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that allows BAs to be started and terminated.
+ * The messaging layer converts the messages into calls on this.
+ *
+ * Importantly, a UserBusinessActivity does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread  transaction context; it is similar to the UserTransaction in
+ * the JTA specification. Therefore, all of the UserTransaction methods
+ * implicitly act on the current thread of control.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class UserBusinessActivity
+{
+    /**
+     * The user business activity.
+     */
+    private static UserBusinessActivity USER_BUSINESS_ACTIVITY ;
+    
+    /**
+     * Get the user business activity.
+     * @return The user business activity.
+     */
+    public static synchronized UserBusinessActivity getUserBusinessActivity()
+    {
+        return USER_BUSINESS_ACTIVITY ;
+    }
+    
+    /**
+     * Set the user business activity.
+     * @param userBusinessActivity The user business activity.
+     */
+    public static synchronized void setUserBusinessActivity(final UserBusinessActivity userBusinessActivity)
+    {
+        USER_BUSINESS_ACTIVITY = userBusinessActivity ;
+    }
+
+    public static final int ATOMIC_OUTCOME = 0;
+    public static final int MIXED_OUTCOME = 1;
+    
+    /**
+     * Start a new business activity with atomic outcome.
+     * If one is already associated with this thread
+     * then the WrongStateException will be thrown. Upon success, this
+     * operation associates the newly created transaction with the current
+     * thread.
+     */
+    public abstract void begin()
+        throws WrongStateException, SystemException;
+
+    /**
+     * Start a new BA with atomic outcome and the specified timeout as
+     * its lifetime.
+     * If one is already associated with this thread then the
+     * WrongStateException will be thrown.
+     */
+    public abstract void begin(final int timeout)
+        throws WrongStateException, SystemException;
+
+    /**
+     * The BA is normally terminated by the close method. This signals to
+     * all registered participants that the BA has ended and no compensation
+     * is required.
+     */
+    public abstract void close()
+        throws TransactionRolledBackException, UnknownTransactionException, SystemException;
+
+    /**
+     * If the BA must undo its work then the cancel method is used. Any
+     * participants that can compensate are forced to do so.
+     */
+    public abstract void cancel()
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * If participants have registered for the BusinessAgreementWithComplete
+     * protocol then they will be expecting the application to inform them
+     * when all work intended for them has been sent (and responded to). The
+     * complete method is used for this purpose.
+     */
+    public abstract void complete()
+        throws UnknownTransactionException, SystemException;
+
+    public abstract String transactionIdentifier();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivityFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserBusinessActivityFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivityFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserBusinessActivityFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivityFactory.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+import com.arjuna.mw.wst.UserBusinessActivity;
+
+public class UserBusinessActivityFactory
+{
+    public static UserBusinessActivity userBusinessActivity ()
+    {
+        return UserBusinessActivity.getUserBusinessActivity() ;
+	}
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransaction.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,118 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ * Importantly, a UserTransaction does not represent a specific transaction,
+ * but rather is responsible for providing access to an implicit per-thread 
+ * transaction context; it is similar to the UserTransaction in the JTA
+ * specification. Therefore, all of the UserTransaction methods implicitly act
+ * on the current thread of control.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class UserTransaction
+{
+    /**
+     * The transaction.
+     */
+    private static UserTransaction USER_TRANSACTION ;
+    
+    /**
+     * Get the user transaction.
+     * @return the user transaction.
+     */
+    public static synchronized UserTransaction getUserTransaction()
+    {
+        return USER_TRANSACTION ;
+    }
+    
+    /**
+     * Set the user transaction.
+     * @param userTransaction The user transaction.
+     */
+    public static synchronized void setUserTransaction(final UserTransaction userTransaction)
+    {
+        USER_TRANSACTION = userTransaction ;
+    }
+    
+    /**
+     * Start a new transaction. If one is already associated with this thread
+     * then the WrongStateException will be thrown. Upon success, this
+     * operation associates the newly created transaction with the current
+     * thread.
+     */
+    public abstract void begin()
+        throws WrongStateException, SystemException;
+
+    /**
+     * Start a new transaction with the specified timeout as its lifetime.
+     * If one is already associated with this thread then the
+     * WrongStateException will be thrown.
+     */
+    public abstract void begin(final int timeout)
+        throws WrongStateException, SystemException;
+    
+    /**
+     * The transaction is committed by the commit method. This will execute
+     * the PhaseZero, 2PC and OutcomeNotification protocols prior to returning.
+     * If there is no transaction associated with the invoking thread then
+     * UnknownTransactionException is thrown. If the transaction ultimately
+     * rolls back then the TransactionRolledBackException is thrown. When
+     * complete, this operation disassociates the transaction from the current
+     * thread such that it becomes associated with no transaction.
+     */
+    public abstract void commit()
+        throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException;
+
+    /**
+     * The rollback operation will terminate the transaction and return
+     * normally if it succeeded, while throwing an appropriate exception if it
+     * didn't. If there is no transaction associated with the invoking thread
+     * then UnknownTransactionException is thrown.
+     */
+    public abstract void rollback()
+        throws UnknownTransactionException, SecurityException, SystemException;
+
+    public abstract String transactionIdentifier ();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/UserTransactionFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionFactory.java,v 1.9.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst;
+
+
+public class UserTransactionFactory
+{
+    public static UserTransaction userTransaction ()
+    {
+        return UserTransaction.getUserTransaction() ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/client)

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueIncomingContextInterceptor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/client/GlueIncomingContextInterceptor.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueIncomingContextInterceptor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,113 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2005,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id$
- */
-
-/**
- * @author Malik SAHEB 
- */
-
-package com.arjuna.mw.wst.client;
-
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.mw.wst.common.CoordinationContextHelper;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-import electric.soap.ISOAPInterceptor;
-import electric.xml.Element;
-
-/**
- * The class is used to perform WS-Transaction context insertion
- * and extraction for application level SOAP messages within WebMethods Glue.
- */
-public class GlueIncomingContextInterceptor implements ISOAPInterceptor
-{
-    public void intercept( electric.soap.SOAPMessage message, electric.util.Context messageContext )
-    {
-        resumeTransaction(message) ;
-        return ;
-    }    
-
-    /**
-     * Resume the current transaction.
-     *
-     * @message com.arjuna.mw.wst.client.GlueICI_1 [com.arjuna.mw.wst.client.GlueICI_1] - Error in: 
-     * @message com.arjuna.mw.wst.client.GlueICI_2 [com.arjuna.mw.wst.client.GlueICI_2] - Unknown context type: 
-     * @message com.arjuna.mw.wst.client.GlueICI_3 [com.arjuna.mw.wst.client.GlueICI_3] - Stack trace: 
-     */
-
-    private void resumeTransaction(final electric.soap.SOAPMessage soapMessage)
-    {
-    	if (soapMessage != null)
-    	{
-            try
-            {
-                final Element soapHeaderElement = soapMessage.getHeaderElement(CoordinationConstants.WSCOOR_NAMESPACE,
-                        CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;
-                if (soapHeaderElement != null)
-                {
-                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;
-                    final String coordinationType = cc.getCoordinationType().getValue() ;
-                    if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
-                    {
-                        final TxContext txContext = new com.arjuna.mwlabs.wst.at.context.TxContextImple(cc) ;
-                        TransactionManagerFactory.transactionManager().resume(txContext) ;
-                    }
-                    else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationType))
-                    {
-                        final TxContext txContext = new com.arjuna.mwlabs.wst.ba.context.TxContextImple(cc);
-                        BusinessActivityManagerFactory.businessActivityManager().resume(txContext) ;
-                    }
-                    else
-                    {
-        			    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueICI_1",
-    			            new Object[]{"com.arjuna.mw.wst.client.GlueIncomingContextInterceptor.resumeTransaction()"});
-
-            		    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueICI_2",
-        		            new Object[]{coordinationType});
-                    }
-                }
-            }
-            catch (final Throwable th) 
-    	    {
-        		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueICI_1",
-				    new Object[]{"com.arjuna.mw.wst.client.GlueIncomingContextInterceptor.resumeTransaction()"});
-
-            	wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueICI_3",
-                    new Object[]{th});
-            }
-        }
-    }
-}

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueOutgoingContextInterceptor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/client/GlueOutgoingContextInterceptor.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/client/GlueOutgoingContextInterceptor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,134 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2005,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id$
- */
-
-/**
- * @author Malik SAHEB 
- */
-
-package com.arjuna.mw.wst.client;
-
-import com.arjuna.mw.wsc.context.Context;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.common.CoordinationContextHelper;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-import electric.soap.ISOAPInterceptor;
-import electric.xml.Element;
-
-/**
- * The class is used to perform WS-Transaction context insertion
- * and extraction for application level SOAP messages within WebMethods Glue.
- */
-public class GlueOutgoingContextInterceptor implements ISOAPInterceptor
-{
-    /**
-     * @message com.arjuna.mw.wst.client.GlueOCI_1 [com.arjuna.mw.wst.client.GlueOCI_1] - Error in: 
-     * @message com.arjuna.mw.wst.client.GlueOCI_2 [com.arjuna.mw.wst.client.GlueOCI_2] - Stack trace: 
-     */
-
-    public void intercept( electric.soap.SOAPMessage soapMessage, electric.util.Context messageContext )
-    {
-    	if (soapMessage == null)
-    	{
-    	    return;
-    	}
-    	try
-        {
-            /*
-             * There should either be an Atomic Transaction *or* a Business Activity
-             * associated with the thread.
-             */
-            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
-            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
-
-            final Context atContext ;
-            if (transactionManager != null)
-            {
-                final com.arjuna.mwlabs.wst.at.context.TxContextImple txContext =
-                    (com.arjuna.mwlabs.wst.at.context.TxContextImple)transactionManager.currentTransaction() ;
-                atContext = (txContext == null ? null : txContext.context()) ;
-            }
-            else
-            {
-                atContext = null ;
-            }
-            
-            final Context baContext ;
-            if (businessActivityManager != null)
-            {
-                final com.arjuna.mwlabs.wst.ba.context.TxContextImple txContext =
-                    (com.arjuna.mwlabs.wst.ba.context.TxContextImple)businessActivityManager.currentTransaction() ;
-                baContext = (txContext == null ? null : txContext.context()) ;
-            }
-            else
-            {
-                baContext = null ;
-            }
-            
-            final CoordinationContextType coordinationContext ;
-            if (atContext != null)
-            {
-                coordinationContext = atContext.getCoordinationContext() ;
-            }
-            else if (baContext != null)
-            {
-                coordinationContext = baContext.getCoordinationContext() ;
-            }
-            else
-            {
-                coordinationContext = null ;
-            }
-            
-            if (coordinationContext != null)
-            {
-        		Element headElement = new Element(CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT, CoordinationConstants.WSCOOR_NAMESPACE);
-        		headElement.setNamespace(CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE);
-                soapMessage.addHeaderElement(headElement) ;
-        		CoordinationContextHelper.serialise(headElement, coordinationContext) ;
-            }
-        }
-        catch (final Throwable th) 
-        {
-            wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueOCI_1",
-                new Object[]{"com.arjuna.mw.wst.client.GlueOutgoingContextInterceptor.intercept()"});
-
-    	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.client.GlueOCI_2",
-                new Object[]{th});
-        }
-
-        return;
-    }    
-}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/CoordinationContextHelper.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/CoordinationContextHelper.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/CoordinationContextHelper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/CoordinationContextHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,96 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst.common;
+
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Element;
+
+import com.arjuna.webservices.adapters.DOMXMLStreamReader;
+import com.arjuna.webservices.adapters.DOMXMLStreamWriter;
+import com.arjuna.webservices.adapters.SAAJXMLStreamReader;
+import com.arjuna.webservices.adapters.SAAJXMLStreamWriter;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+/**
+ * Helper class for serialising Coordination Contexts into SOAP headers.
+ * @author kevin
+ */
+public class CoordinationContextHelper
+{
+    /**
+     * Serialise a coordination context to a SAAJ SOAP Header Element.
+     * @param env The SOAP envelope.
+     * @param headerElement The SOAP header element to populate.
+     * @param coordinationContext The coordination context.
+     * @throws XMLStreamException for errors during parsing.
+     */
+    public static void serialise(final SOAPEnvelope env, final SOAPHeaderElement headerElement, final CoordinationContextType coordinationContext)
+        throws XMLStreamException
+    {
+        final XMLStreamWriter out = new SAAJXMLStreamWriter(env, headerElement) ;
+        coordinationContext.writeContent(out) ;
+    }
+
+    /**
+     * Deserialise a coordination context from a SAAJ SOAP Header Element.
+     * @param env The SOAP envelope.
+     * @param headerElement The SOAP header element to deserialise.
+     * @return The coordination context.
+     * @throws XMLStreamException for errors during parsing.
+     */
+    public static CoordinationContextType deserialise(final SOAPEnvelope env, final SOAPHeaderElement headerElement)
+        throws XMLStreamException
+    {
+        final XMLStreamReader in = new SAAJXMLStreamReader(headerElement) ;
+        return new CoordinationContextType(in) ;
+    }
+
+    /**
+     * Serialise a coordination context to a DOM SOAP Header Element.
+     * @param headerElement The SOAP header element to populate.
+     * @param coordinationContext The coordination context.
+     * @throws XMLStreamException for errors during parsing.
+     */
+    public static void serialise(final Element headerElement, final CoordinationContextType coordinationContext)
+        throws XMLStreamException
+    {
+        final XMLStreamWriter out = new DOMXMLStreamWriter(headerElement) ;
+        coordinationContext.writeContent(out) ;
+    }
+
+    /**
+     * Deserialise a coordination context from a DOM SOAP Header Element.
+     * @param headerElement The SOAP header element to deserialise.
+     * @return The coordination context.
+     * @throws XMLStreamException for errors during parsing.
+     */
+    public static CoordinationContextType deserialise(final Element headerElement)
+        throws XMLStreamException
+    {
+        final XMLStreamReader in = new DOMXMLStreamReader(headerElement) ;
+        return new CoordinationContextType(in) ;
+    }
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/common/Environment.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/09/09 08:48:48 kconner Exp $
+ */
+
+package com.arjuna.mw.wst.common;
+
+/**
+ */
+
+public interface Environment
+{
+
+    public static final String COORDINATOR_URL = "com.arjuna.mw.wst.coordinatorURL";
+
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/deploy)

Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/deploy/WSTXInitialisation.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -41,6 +41,7 @@
 import com.arjuna.mw.wst.UserTransaction;
 import com.arjuna.mw.wstx.logging.wstxLogger;
 import com.arjuna.webservices.util.ClassLoaderHelper;
+import com.arjuna.services.framework.startup.Sequencer;
 
 /**
  * Initialise WSTX.
@@ -61,22 +62,30 @@
      */
     public void contextInitialized(final ServletContextEvent servletContextEvent)
     {
-        try
-        {
-            Configuration.initialise("/wstx.xml");
+        final WSTXInitialisation listener = this;
 
-            configure();
-            // Start recovery
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSTX10) {
+           public void run() {
+               try
+               {
+                   Configuration.initialise("/wstx.xml");
+
+                   listener.configure();
+                   // Start recovery
 //            RecoveryManager.manager() ;
-        }
-        catch (Exception exception)
-        {
-            wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_1", exception);
-        }
-        catch (Error error)
-        {
-            wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_21", error);
-        }
+               }
+               catch (Exception exception)
+               {
+                   wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_1", exception);
+               }
+               catch (Error error)
+               {
+                   wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst.deploy.WSTXI_21", error);
+               }
+           }
+        };
+        // this is the last WST callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR10, Sequencer.WEBAPP_WSTX10);
     }
     
     /**

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/service)

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueIncomingContextInterceptor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/service/GlueIncomingContextInterceptor.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueIncomingContextInterceptor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,133 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2005,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id$
- *
- * @author Malik SAHEB 
- */
-
-package com.arjuna.mw.wst.service;
-
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.mw.wst.common.CoordinationContextHelper;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-
-import electric.soap.ISOAPInterceptor;
-import electric.xml.Element;
-
-/**
- * The class is used to perform WS-Transaction context insertion
- * and extraction for application level SOAP messages within WebMethods Glue.
- *
- * @message com.arjuna.mw.wst.service.GlueICI_1 [com.arjuna.mw.wst.service.GlueICI_1] - Error in: 
- * @message com.arjuna.mw.wst.service.GlueICI_2 [com.arjuna.mw.wst.service.GlueICI_2] - Stack trace: 
- * @message com.arjuna.mw.wst.service.GlueICI_3 [com.arjuna.mw.wst.service.GlueICI_3] - Unknown context type: 
- */
-
-public class GlueIncomingContextInterceptor implements ISOAPInterceptor
-{
-    public void intercept( electric.soap.SOAPMessage soapMessage, electric.util.Context messageContext )
-    {
-        if (soapMessage != null)
-        {
-            try
-            {
-                final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
-                final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
-
-                if (transactionManager != null)
-                {
-                    final com.arjuna.mwlabs.wst.at.context.TxContextImple txContext =
-                        (com.arjuna.mwlabs.wst.at.context.TxContextImple)transactionManager.suspend() ;
-
-                    if (txContext != null)
-                    {
-                        messageContext.setProperty(AtomicTransactionConstants.WSAT_PROTOCOL, txContext) ;
-                    }
-                }
-
-                if (businessActivityManager != null)
-                {
-                    final com.arjuna.mwlabs.wst.ba.context.TxContextImple txContext =
-                        (com.arjuna.mwlabs.wst.ba.context.TxContextImple)businessActivityManager.suspend() ;
-
-                    if (txContext != null)
-                    {
-                        messageContext.setProperty(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, txContext) ;
-                    }
-                }
-
-                final Element soapHeaderElement = soapMessage.getHeaderElement(CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;
-
-                if (soapHeaderElement != null)
-                {
-                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;
-
-                    final String coordinationType = cc.getCoordinationType().getValue() ;
-
-                    if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
-                    {
-                        final TxContext txContext = new com.arjuna.mwlabs.wst.at.context.TxContextImple(cc) ;
-                        transactionManager.resume(txContext) ;
-                    }
-                    else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationType))
-                    {
-                        final TxContext txContext = new com.arjuna.mwlabs.wst.ba.context.TxContextImple(cc);
-                        businessActivityManager.resume(txContext) ;
-                    }
-                    else
-                    {
-            		    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueICI_1",
-                            new Object[]{"com.arjuna.mw.wst.service.GlueOutgoingContextInterceptor.intercept()"});
-
-            		    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueICI_3",
-                            new Object[]{coordinationType});
-                    }
-                }
-            }
-            catch (final Throwable th) 
-            {
-        		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueICI_1",
-                    new Object[]{"com.arjuna.mw.wst.service.GlueIncomingContextInterceptor.intercept()"});
-
-        		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueICI_2",
-                    new Object[]{th});
-            }
-        }
-    }    
-}
-
-

Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueOutgoingContextInterceptor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wst/service/GlueOutgoingContextInterceptor.java	2008-04-08 14:59:58 UTC (rev 19476)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/service/GlueOutgoingContextInterceptor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,96 +0,0 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2005,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id$
- */
-
-package com.arjuna.mw.wst.service;
-
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-
-import electric.soap.ISOAPInterceptor;
-
-/**
- * The class is used to perform WS-Transaction context insertion
- * and extraction for application level SOAP messages within WebMethods Glue.
- *
- * @message com.arjuna.mw.wst.service.GlueOCI_1 [com.arjuna.mw.wst.service.GlueOCI_1] - Error in: 
- * @message com.arjuna.mw.wst.service.GlueOCI_2 [com.arjuna.mw.wst.service.GlueOCI_2] - Stack trace: 
- */
-
-public class GlueOutgoingContextInterceptor implements ISOAPInterceptor
-{
-
-    public void intercept( electric.soap.SOAPMessage soapMessage, electric.util.Context messageContext )
-    {
-        try
-        {
-            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
-            final com.arjuna.mwlabs.wst.at.context.TxContextImple atTXContext =
-                (com.arjuna.mwlabs.wst.at.context.TxContextImple)messageContext.getProperty(AtomicTransactionConstants.WSAT_PROTOCOL) ;
-
-            if (atTXContext != null)
-            {
-                transactionManager.resume(atTXContext) ;
-            }
-            else
-            {
-                transactionManager.suspend() ;
-            }
-
-            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
-            final com.arjuna.mwlabs.wst.ba.context.TxContextImple baTXContext =
-                (com.arjuna.mwlabs.wst.ba.context.TxContextImple)messageContext.getProperty(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME) ;
-
-            if (baTXContext != null)
-            {
-                businessActivityManager.resume(baTXContext) ;
-            }
-            else
-            {
-                businessActivityManager.suspend() ;
-            }
-        }
-        catch (final Throwable th) 
-        {
-    	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueOCI_1",
-                new Object[]{"com.arjuna.mw.wst.service.GlueOutgoingContextInterceptor.intercept()"});
-
-    	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst.service.GlueOCI_2",
-                new Object[]{th});
-        }
-    }    
-}
-
-

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/TransactionManagerFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/TransactionManagerFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/TransactionManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,165 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ */
+
+package com.arjuna.mw.wstx;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.common.TransactionXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+/**
+ * This class is used to obtain the TransactionManager implementation to
+ * use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class TransactionManagerFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wstx.TransactionManagerFactory_1 [com.arjuna.mw.wstx.TransactionManagerFactory_1] - Failed to create document: 
+     */
+
+    public static TransactionManager transactionManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx.TransactionManagerFactory_1",
+					      new Object[]{com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class.getName()});
+	    }
+	    else
+	    {
+		if (!_protocolManager.present(doc))
+		    _protocolManager.addProtocol(doc, com.arjuna.mwlabs.wstx.model.as.twophase.TwoPhaseTxManager.class.getName());
+		
+		return transactionManager(doc);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static TransactionManager transactionManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
+		String protocolType = child.getNodeValue();
+		TransactionManager tx = (TransactionManager) _implementations.get(protocolType);
+	
+		if (tx == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+	
+		    if (implementation instanceof String)
+		    {
+			Class txImpl = Class.forName((String) implementation);
+
+			tx = (TransactionManager) txImpl.newInstance();
+		    }
+		    else
+			tx = (TransactionManager) implementation;
+
+		    _implementations.put(protocolType, tx);
+		}
+
+		return tx;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	    
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+    
+}
+

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/UserTransactionFactory.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/UserTransactionFactory.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/UserTransactionFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wstx/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,164 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ */
+
+package com.arjuna.mw.wstx;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.common.TransactionXSD;
+
+import com.arjuna.mw.wscf.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+/**
+ * Return the UserTransaction implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserTransactionFactory
+{
+
+    /**
+     * @exception ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wstx.UserTransactionFactory_1 [com.arjuna.mw.wstx.UserTransactionFactory_1] - Failed to create document: 
+     */
+
+    public static UserTransaction userTransaction () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+	    
+	    if (doc == null)
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx.UserTransactionFactory_1",
+					      new Object[]{com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class.getName()});
+	    }
+	    else
+	    {
+		if (!_protocolManager.present(doc))
+		    _protocolManager.addProtocol(doc, com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx.class.getName());
+		
+		return userTransaction(doc);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+    
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserTransaction userTransaction (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
+		String protocolType = child.getNodeValue();
+		UserTransaction tx = (UserTransaction) _implementations.get(protocolType);
+	
+		if (tx == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+	
+		    if (implementation instanceof String)
+		    {
+			Class txImpl = Class.forName((String) implementation);
+			
+			tx = (UserTransaction) txImpl.newInstance();
+		    }
+		    else
+			tx = (UserTransaction) implementation;
+
+		    _implementations.put(protocolType, tx);
+		}
+
+		return tx;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	    
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+    
+}
+

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,264 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextFactoryImple.java,v 1.16.4.1 2005/11/22 10:36:21 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at;
+
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.model.twophase.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.coordinator.LocalFactory;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorControl;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorServiceImple;
+import com.arjuna.mwlabs.wst.at.context.ArjunaContextImple;
+import com.arjuna.mwlabs.wst.at.participants.CleanupSynchronization;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.stax.URI;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.ContextFactory;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc.InvalidProtocolException;
+
+public class ContextFactoryImple implements ContextFactory, LocalFactory
+{
+	public ContextFactoryImple ()
+	{
+		try
+		{
+			_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+            _theRegistrar = new RegistrarImple();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	/**
+	 * Called when a context factory is added to a context factory mapper. This
+	 * method will be called multiple times if the context factory is added to
+	 * multiple context factory mappers or to the same context mapper with
+	 * different protocol identifiers.
+	 * 
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 */
+	public void install(final String coordinationTypeURI)
+	{
+	}
+
+	// TODO interposition
+
+	/*
+	 * If there is a context passed through to create then this newly created
+	 * coordinator should be interposed.
+	 */
+
+	/**
+	 * Creates a coordination context.
+	 * 
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 * @param expires
+	 *            the expire date/time for the returned context, can be null
+	 * @param currentContext
+	 *            the current context, can be null
+	 * 
+	 * @return the created coordination context
+	 * 
+	 * @throws InvalidCreateParametersException
+	 *             if a parameter passed is invalid this activity identifier.
+	 * 
+	 * @message com.arjuna.mwlabs.wst.at.ContextFactoryImple_1
+	 *          [com.arjuna.mwlabs.wst.at.ContextFactoryImple_1] - Invalid type
+	 *          URI: < {0} , {1} >
+	 * @message com.arjuna.mwlabs.wst.at.ContextFactoryImple_3
+	 *          [com.arjuna.mwlabs.wst.at.ContextFactoryImple_3] - Invalid type
+	 *          URI:
+	 */
+
+	public CoordinationContextType create (final String coordinationTypeURI, final Long expires,
+            final CoordinationContextType currentContext)
+			throws InvalidCreateParametersException
+	{
+		if (coordinationTypeURI.equals(AtomicTransactionConstants.WSAT_PROTOCOL))
+		{
+			try
+			{
+				// make sure no transaction is currently associated
+
+				_coordManager.suspend();
+
+				final int timeout ;
+                if (expires == null)
+                {
+                    timeout = 0 ;
+                }
+                else
+                {
+                    final long timeoutVal = expires.longValue() ;
+                    timeout = (timeoutVal > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeoutVal) ;
+                }
+
+				_coordManager.begin(timeout);
+				
+                final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
+                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+                final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
+                
+                final CoordinationContextType coordinationContext = new CoordinationContextType() ;
+                coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
+                coordinationContext.setIdentifier(new AttributedURIType("urn:"+arjunaContext.getTransactionIdentifier())) ;
+                final int transactionExpires = arjunaContext.getTransactionExpires() ;
+                if (transactionExpires > 0)
+                {
+                    coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
+                }
+                final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
+                InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, arjunaContext.getTransactionIdentifier()) ;
+                coordinationContext.setRegistrationService(registrationCoordinator) ;
+
+				/*
+				 * Now add the registrar for this specific coordinator to the
+				 * mapper.
+				 */
+
+				_coordManager.enlistSynchronization(new CleanupSynchronization(_coordManager.identifier().toString(), _theRegistrar));
+
+				/*
+				 * TODO Uughh! This does a suspend for us! Left over from original
+				 * WS-AS stuff.
+				 * 
+				 * TODO
+				 * REFACTOR, REFACTOR, REFACTOR.
+				 */
+				
+				_theRegistrar.associate();
+
+				return coordinationContext;
+			}
+			catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+			{
+				ex.printStackTrace();
+				
+				throw new InvalidCreateParametersException();
+			}
+			catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+			{
+				ex.printStackTrace();
+			}
+			catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+			{
+				ex.printStackTrace();
+				
+				throw new InvalidCreateParametersException();
+			}
+			catch (Exception ex)
+			{
+				// TODO handle properly
+
+				ex.printStackTrace();
+			}
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.ContextFactoryImple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, coordinationTypeURI });
+
+			throw new InvalidCreateParametersException(
+					wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.ContextFactoryImple_3")
+							+ " < "
+							+ AtomicTransactionConstants.WSAT_PROTOCOL
+							+ ", "
+							+ coordinationTypeURI + " >");
+		}
+
+		return null;
+	}
+
+	/**
+	 * Called when a context factory is removed from a context factory mapper.
+	 * This method will be called multiple times if the context factory is
+	 * removed from multiple context factory mappers or from the same context
+	 * factory mapper with different coordination type uris.
+	 * 
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 */
+
+	public void uninstall (final String coordinationTypeURI)
+	{
+		// we don't use this as one implementation is registered per type
+	}
+
+	public final Object createSubordinate () throws NoActivityException, InvalidProtocolException, SystemException
+	{
+		try
+		{
+			CoordinatorServiceImple coordManager = (CoordinatorServiceImple) _coordManager;
+			CoordinatorControl theControl = coordManager.coordinatorControl();
+			ACCoordinator subordinateTransaction = theControl.createSubordinate();
+			
+			/*
+			 * Now add the registrar for this specific coordinator to the
+			 * mapper.
+			 */
+
+			subordinateTransaction.enlistSynchronization(new CleanupSynchronization(subordinateTransaction.get_uid().stringForm(), _theRegistrar));
+
+			_theRegistrar.associate(subordinateTransaction);
+			
+			return subordinateTransaction;
+		}
+		catch (Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+	
+	public final RegistrarImple registrar ()
+	{
+		return _theRegistrar;
+	}
+
+	private CoordinatorManager _coordManager;
+	private RegistrarImple _theRegistrar;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/ContextImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,75 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextImple.java,v 1.13.4.1 2005/11/22 10:36:21 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at;
+
+import com.arjuna.mw.wsc.context.Context;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+public class ContextImple implements Context
+{
+
+	public ContextImple (final CoordinationContextType ctx)
+	{
+		_coordContext = ctx;
+	}
+
+	public boolean equals (Object obj)
+	{
+		if (obj instanceof ContextImple)
+		{
+			ContextImple ci = (ContextImple) obj;
+
+			return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
+		}
+		else
+			return false;
+	}
+
+	public CoordinationContextType getCoordinationContext ()
+	{
+		return _coordContext;
+	}
+
+	public void setCoordinationContext (CoordinationContextType cc)
+	{
+		_coordContext = cc;
+	}
+
+	public String toString ()
+	{
+		// return DomUtil.nodeAsString(toXML());
+
+		return "AtomicTransactionIdentifier: " + _coordContext.getIdentifier().getValue();
+	}
+
+	private CoordinationContextType _coordContext;
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/RegistrarImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/RegistrarImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/RegistrarImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,349 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: RegistrarImple.java,v 1.20.4.1 2005/11/22 10:36:21 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at;
+
+import java.util.HashMap;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.model.twophase.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateCoordinator;
+import com.arjuna.mwlabs.wst.at.participants.CompletionCoordinatorImple;
+import com.arjuna.mwlabs.wst.at.participants.DurableTwoPhaseCommitParticipant;
+import com.arjuna.mwlabs.wst.at.participants.VolatileTwoPhaseCommitParticipant;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.InvalidProtocolException;
+import com.arjuna.wsc.InvalidStateException;
+import com.arjuna.wsc.NoActivityException;
+import com.arjuna.wsc.Registrar;
+import com.arjuna.wsc.RegistrarMapper;
+import com.arjuna.wst.CompletionCoordinatorParticipant;
+import com.arjuna.wst.stub.Durable2PCStub;
+import com.arjuna.wst.stub.Volatile2PCStub;
+
+/*
+ * TODO
+ * 
+ * This entire architecture needs reworking. The WSAS and WSCF modules are based
+ * on the original pre-WS-CAF work and now out-of-date. They are more generic
+ * than required and pass through so many different levels of indirection that
+ * it confuses the code path and makes it difficult to see what is going on.
+ * 
+ * The notion of an activity is fine in the general context of WS-CAF and
+ * WS-C/Tx, but within the implementation, it causes us to do too much
+ * thread-to-activity related work. It would be like having to go through the JTA
+ * UT and TM interfaces in order to do anywork on the transaction!
+ */
+
+public class RegistrarImple implements Registrar
+{
+	public RegistrarImple ()
+        throws ProtocolNotRegisteredException, SystemException
+	{
+		_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+		// register with mapper using tx id as protocol identifier.
+        final RegistrarMapper mapper = RegistrarMapper.getFactory() ;
+
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION, this);
+	}
+
+	/**
+	 * Called when a registrar is added to a register mapper. This method will
+	 * be called multiple times if the registrar is added to multiple register
+	 * mappers or to the same register mapper with different protocol
+	 * identifiers.
+	 * 
+	 * @param serviceAddress
+	 *            the address of the service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void install (final String protocolIdentifier)
+	{
+	}
+
+	/**
+	 * Registers the interest of participant in a particular protocol.
+	 * 
+	 * @param participantProtocolServiceAddress
+	 *            the address of the participant protocol service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 * 
+	 * @return the PortReference of the coordinator protocol service
+	 * 
+	 * @throws AlreadyRegisteredException
+	 *             if the participant is already registered for this
+	 *             coordination protocol under this activity identifier
+	 * @throws InvalidProtocolException
+	 *             if the coordination protocol is not supported
+	 * @throws InvalidStateException
+	 *             if the state of the coordinator no longer allows registration
+	 *             for this coordination protocol
+	 * @throws NoActivityException
+	 *             if the activity does not exist.
+	 * 
+	 * @message com.arjuna.mwlabs.wst.at.RegistrarImple_1
+	 *          [com.arjuna.mwlabs.wst.at.Registrar_1] - Invalid type URI: < {0} ,
+	 *          {1} >
+	 */
+
+	/*
+	 * TODO
+	 * 
+	 * See comment at head of class definition. We shouldn't have to rely on
+	 * thread-to-activity association to register a participant. We currently do
+	 * because the code is based on old WS-CAF models that are no longer
+	 * applicable. This needs updating!
+	 */
+	public EndpointReferenceType register(final EndpointReferenceType participantProtocolService,
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+			InvalidStateException, NoActivityException
+	{
+		Object tx = _hierarchies.get(instanceIdentifier.getInstanceIdentifier());
+		
+		if (tx instanceof SubordinateCoordinator)
+			return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier);
+
+		ActivityHierarchy hier = (ActivityHierarchy) tx;
+
+		if (hier == null)
+			throw new NoActivityException();
+
+		try
+		{
+			_coordManager.resume(hier);
+		}
+		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+		{
+			throw new NoActivityException();
+		}
+		catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+		{
+			throw new InvalidProtocolException();
+		}
+
+		// TODO check for AlreadyRegisteredException
+
+		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String participantId = "D" + new Uid().stringForm();
+
+			try
+			{
+                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
+				_coordManager.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
+
+				_coordManager.suspend();
+
+				return getCoordinator(participantId) ;
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String participantId = "V" + new Uid().stringForm();
+
+			try
+			{
+                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
+				_coordManager.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
+
+				_coordManager.suspend();
+
+				return getCoordinator(participantId) ;
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		{
+			try
+			{
+                final CompletionCoordinatorParticipant participant = new CompletionCoordinatorImple(_coordManager, hier, true) ;
+                CompletionCoordinatorProcessor.getProcessor().activateParticipant(participant, instanceIdentifier.getInstanceIdentifier()) ;
+
+				_coordManager.suspend();
+
+				return getCompletionCoordinator(instanceIdentifier) ;
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+
+				throw new InvalidStateException(ex.toString());
+			}
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
+
+			throw new InvalidProtocolException();
+		}
+	}
+
+    /**
+	 * Called when a registrar is removed from a register mapper. This method
+	 * will be called multiple times if the registrar is removed from multiple
+	 * register mappers or from the same register mapper with different protocol
+	 * identifiers.
+	 * 
+	 * @param serviceAddress
+	 *            the address of the service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+	public void uninstall(final String protocolIdentifier)
+	{
+	}
+
+	public final void associate () throws Exception
+	{
+		// TODO colocation won't do suspend
+
+		String txIdentifier = _coordManager.identifier().toString();
+		ActivityHierarchy hier = _coordManager.suspend();
+
+		_hierarchies.put(txIdentifier, hier);
+	}
+
+	public final void associate (ACCoordinator transaction) throws Exception
+	{
+		String txIdentifier = transaction.get_uid().stringForm();
+		
+		_hierarchies.put(txIdentifier, transaction);
+	}
+
+	public final void disassociate (String txIdentifier) throws Exception
+	{
+		_hierarchies.remove(txIdentifier);
+	}
+
+	private final EndpointReferenceType registerWithSubordinate(final SubordinateCoordinator theTx,
+        final EndpointReferenceType participantProtocolService, final String protocolIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+			InvalidStateException, NoActivityException
+    {
+		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+            final String participantId = "D" + new Uid().stringForm();
+
+            try
+            {
+                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
+                theTx.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
+
+                return getCoordinator(participantId) ;
+            }
+            catch (Exception ex)
+            {
+                throw new InvalidStateException();
+            }
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+            final String participantId = "V" + new Uid().stringForm();
+
+            try
+            {
+                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
+                theTx.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
+
+                return getCoordinator(participantId) ;
+            }
+            catch (Exception ex)
+            {
+                throw new InvalidStateException();
+            }
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		{
+			// not allowed for subordinate transactions!
+			
+			throw new InvalidStateException();
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
+
+			throw new InvalidProtocolException();
+		}
+	}
+
+    private EndpointReferenceType getCompletionCoordinator(final InstanceIdentifier instanceIdentifier)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String completionCoordinatorURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COMPLETION_COORDINATOR) ;
+        final EndpointReferenceType completionCoordinator = new EndpointReferenceType(new AttributedURIType(completionCoordinatorURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(completionCoordinator, instanceIdentifier) ;
+        return completionCoordinator ;
+    }
+
+    private EndpointReferenceType getCoordinator(final String participantId)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String coordinatorURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COORDINATOR) ;
+        final EndpointReferenceType coordinator = new EndpointReferenceType(new AttributedURIType(coordinatorURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(coordinator, participantId) ;
+        return coordinator ;
+    }
+
+	private CoordinatorManager _coordManager = null;
+	private HashMap _hierarchies = new HashMap();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/context (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/context)

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/local (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/local)

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CleanupSynchronization.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,78 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at.participants;
+
+import com.arjuna.mwlabs.wst.at.RegistrarImple;
+
+import com.arjuna.mw.wscf.model.twophase.participants.*;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CleanupSynchronization implements Synchronization
+{
+
+	public CleanupSynchronization (String cleanupId, RegistrarImple theRegistrar)
+	{
+		_cleanupId = cleanupId;
+		_theRegistrar = theRegistrar;
+	}
+
+	public void beforeCompletion () throws SystemException
+	{
+		// do nothing
+	}
+
+	public void afterCompletion (int status) throws SystemException
+	{
+		try
+		{
+			_theRegistrar.disassociate(_cleanupId);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	private String _cleanupId;
+
+	private RegistrarImple _theRegistrar;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/participants/CompletionCoordinatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,171 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CompletionCoordinatorImple.java,v 1.6.24.1 2005/11/22 10:36:22 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at.participants;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CompletionCoordinatorImple.java,v 1.6.24.1 2005/11/22 10:36:22 kconner Exp $
+ * @since 1.0.
+ */
+
+public class CompletionCoordinatorImple implements com.arjuna.wst.CompletionCoordinatorParticipant
+{
+
+    public CompletionCoordinatorImple (CoordinatorManager cm, ActivityHierarchy hier, final boolean deactivate)
+    {
+	_cm = cm;
+	_hier = hier;
+    this.deactivate = deactivate ;
+    }
+    
+    public void commit () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier != null)
+		_cm.resume(_hier);
+
+	    _cm.confirm();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    //	    throw new HeuristicHazardException();
+	    
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorCancelledException ex)
+	{
+	    throw new TransactionRolledBackException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
+	{
+	    //	    throw new HeuristicMixedException();
+
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
+	{
+	    //	    throw new HeuristicHazardException();
+
+	    throw new SystemException(ex.toString());
+
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	finally
+	{
+	    if (deactivate)
+	        CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
+	}
+    }
+    
+    public void rollback () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier != null)
+		_cm.resume(_hier);
+	    
+	    _cm.cancel();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorConfirmedException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	finally
+	{
+        if (deactivate)
+            CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
+	}
+    }
+
+    private CoordinatorManager   _cm;
+    private ActivityHierarchy    _hier;
+    private final boolean deactivate ;
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/TransactionManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,249 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerImple.java,v 1.19.4.1 2005/11/22 10:36:09 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at.remote;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst.at.context.TxContextImple;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.InvalidProtocolException;
+import com.arjuna.wsc.InvalidStateException;
+import com.arjuna.wsc.NoActivityException;
+import com.arjuna.wsc.RegistrationCoordinator;
+import com.arjuna.wst.Durable2PCParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.Volatile2PCParticipant;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.ParticipantEngine;
+
+/**
+ * This is the interface that the core exposes in order to allow different types
+ * of participants to be enrolled. The messaging layer continues to work in
+ * terms of the registrar, but internally we map to one of these methods.
+ */
+
+public class TransactionManagerImple extends TransactionManager
+{
+	public TransactionManagerImple ()
+	{
+	}
+
+	public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id)
+			throws WrongStateException, UnknownTransactionException,
+			AlreadyRegisteredException, SystemException
+	{
+		try
+		{
+			final EndpointReferenceType coordinator = registerParticipant(getParticipant(id) , AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
+
+			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			throw new UnknownTransactionException();
+		}
+	}
+
+	public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id)
+			throws WrongStateException, UnknownTransactionException,
+			AlreadyRegisteredException, SystemException
+	{
+		try
+		{
+			final EndpointReferenceType coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
+
+			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			ex.printStackTrace();
+
+			throw new UnknownTransactionException();
+		}
+	}
+
+	/*
+	 * TODO
+	 * 
+	 * Have participant interfaces in WSTX have url method and services use
+	 * those. The ones in WS-T are message oriented and we translate to/from.
+	 *  
+	 */
+
+	/**
+	 * @message com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1
+	 *          [com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1] -
+	 *          Not implemented!
+	 */
+
+	public int replay () throws SystemException
+	{
+		throw new SystemException(
+				wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.TransactionManagerImple_1"));
+	}
+
+	public TxContext suspend () throws SystemException
+	{
+		return _ctxManager.suspend();
+	}
+
+	// resume overwrites. Should we check first a la JTA?
+
+	public void resume (TxContext tx) throws UnknownTransactionException,
+			SystemException
+	{
+		_ctxManager.resume(tx);
+	}
+
+	public TxContext currentTransaction () throws SystemException
+	{
+		return _ctxManager.currentTransaction();
+	}
+
+	protected EndpointReferenceType enlistForCompletion (final EndpointReferenceType participantEndpoint)
+			throws WrongStateException, UnknownTransactionException,
+			AlreadyRegisteredException, SystemException
+	{
+		try
+		{
+			TxContextImple currentTx = (TxContextImple) _ctxManager.currentTransaction();
+
+			if (currentTx == null)
+				throw new com.arjuna.wsc.NoActivityException();
+
+			return registerParticipant(participantEndpoint, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION);
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			throw new UnknownTransactionException();
+		}
+	}
+    
+    private EndpointReferenceType getParticipant(final String id)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String serviceURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_PARTICIPANT) ;
+        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+        return participant ;
+    }
+
+	private final EndpointReferenceType registerParticipant (final EndpointReferenceType participant, final String protocol)
+			throws InvalidProtocolException, InvalidStateException, NoActivityException, SystemException
+	{
+		TxContextImple currentTx = null;
+
+		try
+		{
+			currentTx = (TxContextImple) _ctxManager.suspend();
+
+			if (currentTx == null)
+				throw new com.arjuna.wsc.NoActivityException();
+
+            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
+            final String messageId = new Uid().stringForm() ;
+            return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
+		}
+		catch (final SoapFault sf)
+		{
+			throw new SystemException(sf.getMessage());
+		}
+		catch (final NoActivityException nae)
+		{
+			throw nae ;
+		}
+        catch (final InvalidStateException ise)
+        {
+            throw ise ;
+        }
+        catch (final InvalidProtocolException ipe)
+        {
+            throw ipe ;
+        }
+		catch (final Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (currentTx != null)
+					_ctxManager.resume(currentTx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+
+	private ContextManager _ctxManager = new ContextManager();
+
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserTransactionImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,403 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionImple.java,v 1.21.4.1 2005/11/22 10:36:09 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.at.remote;
+
+import java.util.Hashtable;
+import java.io.InputStream;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.common.Environment;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst.at.ContextImple;
+import com.arjuna.mwlabs.wst.at.context.TxContextImple;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.stub.CompletionStub;
+
+/**
+ * @message com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2
+ *          [com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2] - Received
+ *          context is null!
+ */
+public class UserTransactionImple extends UserTransaction
+{
+
+	public UserTransactionImple ()
+	{
+		try
+		{
+            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
+
+			/*
+			 * If the coordinator URL hasn't been specified via the
+			 * configuration file then assume we are using a locally registered
+			 * implementation.
+			 */
+
+			if (_activationCoordinatorService == null)
+			{
+                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+                _activationCoordinatorService = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+			}
+		}
+		catch (Exception ex)
+		{
+			// TODO
+
+			ex.printStackTrace();
+		}
+	}
+
+	public void begin () throws WrongStateException, SystemException
+	{
+		begin(0);
+	}
+
+	public void begin (int timeout) throws WrongStateException, SystemException
+	{
+		try
+		{
+			if (_ctxManager.currentTransaction() != null)
+				throw new WrongStateException();
+
+			com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout);
+
+			_ctxManager.resume(new TxContextImple(ctx));
+
+			enlistCompletionParticipants();
+		}
+		catch (com.arjuna.wsc.InvalidCreateParametersException ex)
+		{
+			tidyup();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wst.UnknownTransactionException ex)
+		{
+			tidyup();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (SystemException ex)
+		{
+			tidyup();
+
+			throw ex;
+		}
+	}
+
+	public void commit () throws TransactionRolledBackException,
+			UnknownTransactionException, SecurityException, SystemException
+	{
+		try
+		{
+			commitWithoutAck();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		finally
+		{
+			tidyup();
+		}
+	}
+
+	public void rollback () throws UnknownTransactionException, SecurityException, SystemException
+	{
+		try
+		{
+			abortWithoutAck();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		finally
+		{
+			tidyup();
+		}
+	}
+
+	public String transactionIdentifier ()
+	{
+		try
+		{
+			return _ctxManager.currentTransaction().toString();
+		}
+		catch (com.arjuna.wst.SystemException ex)
+		{
+			return "Unknown";
+		}
+		catch (NullPointerException ex)
+		{
+			return "Unknown";
+		}
+	}
+
+	public String toString ()
+	{
+		return transactionIdentifier();
+	}
+
+	/*
+	 * Not sure if this is right as it doesn't map to registering a participant
+	 * with the coordinator.
+	 */
+
+	private final void enlistCompletionParticipants ()
+			throws WrongStateException, UnknownTransactionException,
+			SystemException
+	{
+		try
+		{
+			TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager();
+
+			final String id = ((TxContextImple) tm.currentTransaction()).identifier();
+			final EndpointReferenceType completionCoordinator = tm.enlistForCompletion(getCompletionParticipant(id));
+
+			_completionCoordinators.put(id, completionCoordinator);
+		}
+		catch (com.arjuna.wsc.AlreadyRegisteredException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+    private final com.arjuna.mw.wsc.context.Context startTransaction(int timeout)
+			throws com.arjuna.wsc.InvalidCreateParametersException,
+			SystemException
+	{
+		try
+		{
+            // TODO: tricks for per app _activationCoordinatorService config, perhaps:
+            //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
+
+            
+            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+            final String messageId = new Uid().stringForm() ;
+            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+                    _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, null) ;
+            if (coordinationContext == null)
+            {
+                throw new SystemException(
+                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserTransactionImple_2"));
+            }
+            return new ContextImple(coordinationContext) ;
+		}
+        catch (final InvalidCreateParametersException icpe)
+        {
+            throw icpe ;
+        }
+		catch (final SoapFault sf)
+		{
+			throw new SystemException(sf.getMessage()) ;
+		}
+		catch (final Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	private final void commitWithoutAck ()
+			throws TransactionRolledBackException, UnknownTransactionException,
+			SecurityException, SystemException
+	{
+		TxContextImple ctx = null;
+		String id = null;
+
+		try
+		{
+			ctx = (TxContextImple) _ctxManager.suspend();
+            if (ctx == null) {
+                throw new UnknownTransactionException();
+            }
+            id = ctx.identifier();
+
+			/*
+			 * By default the completionParticipantURL won't be set for an interposed (imported)
+			 * bridged transaction. This is fine, because you shouldn't be able to commit that
+			 * transaction from a node in the tree, only from the root. So, we can prevent commit
+			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
+			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
+			 * for how to do this).
+			 */
+
+			final EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
+
+			if (completionCoordinator == null)
+				throw new SecurityException();
+
+			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
+
+			completionStub.commit();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		catch (TransactionRolledBackException ex)
+		{
+			throw ex;
+		}
+		catch (UnknownTransactionException ex)
+		{
+			throw ex;
+		}
+		catch (SecurityException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (ctx != null)
+					_ctxManager.resume(ctx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+
+			if (id != null)
+				_completionCoordinators.remove(id);
+		}
+	}
+
+	private final void abortWithoutAck () throws UnknownTransactionException, SecurityException,
+			SystemException
+	{
+		TxContextImple ctx = null;
+		String id = null;
+
+		try
+		{
+			ctx = (TxContextImple) _ctxManager.suspend();
+			id = ctx.identifier();
+
+			/*
+			 * By default the completionParticipantURL won't be set for an interposed (imported)
+			 * bridged transaction. This is fine, because you shouldn't be able to commit that
+			 * transaction from a node in the tree, only from the root. So, we can prevent commit
+			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
+			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
+			 * for how to do this).
+			 */
+
+			EndpointReferenceType completionCoordinator = (EndpointReferenceType) _completionCoordinators.get(id);
+
+			if (completionCoordinator == null)
+				throw new SecurityException();
+
+			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
+
+			completionStub.rollback();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		catch (UnknownTransactionException ex)
+		{
+			throw ex;
+		}
+		catch (SecurityException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (ctx != null)
+					_ctxManager.resume(ctx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+
+			if (id != null)
+				_completionCoordinators.remove(id);
+		}
+	}
+
+    private EndpointReferenceType getCompletionParticipant(final String id)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String serviceURI = soapRegistry.getServiceURI(AtomicTransactionConstants.SERVICE_COMPLETION_INITIATOR) ;
+        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+        return participant ;
+    }
+
+	private final void tidyup ()
+	{
+		try
+		{
+			_ctxManager.suspend();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	private ContextManager _ctxManager = new ContextManager();
+	private String _activationCoordinatorService;
+	private Hashtable _completionCoordinators = new Hashtable();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/BusinessActivityTerminatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,211 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityTerminatorImple.java,v 1.3.18.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.wst.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+public class BusinessActivityTerminatorImple implements BusinessActivityTerminator
+{
+    public BusinessActivityTerminatorImple ()
+        throws SystemException
+    {
+        try
+        {
+            _coordManager = CoordinatorManagerFactory.coordinatorManager();
+            _hier = _coordManager.currentActivity();
+        }
+        catch (ProtocolNotRegisteredException pnre)
+        {
+            throw new SystemException(pnre.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+    }
+    
+    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+        try
+        {
+            if (_hier == null)
+            throw new UnknownTransactionException();
+
+            _coordManager.resume(_hier);
+        
+            _coordManager.close();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+        {
+            throw new UnknownTransactionException();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException ex)
+        {
+            throw new TransactionRolledBackException();
+        }
+        catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+        {
+            throw new UnknownTransactionException();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (UnknownTransactionException ex)
+        {
+            throw ex;
+        }
+        finally
+        {
+            TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
+        }
+    }
+
+    public void cancel () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+	
+	    _coordManager.cancel();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorConfirmedException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (UnknownTransactionException ex)
+	{
+	    throw ex;
+	}
+	finally
+	{
+        TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
+	}
+    }
+
+    /**
+     * Complete doesn't mean go away, it just means that all work you need to
+     * accomplish the commit/rollback has been received.
+     */
+
+    public void complete () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+	
+	    _coordManager.complete();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (UnknownTransactionException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    private CoordinatorManager                   _coordManager = null;
+    private ActivityHierarchy                    _hier = null;
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,208 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextFactoryImple.java,v 1.4.4.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba;
+
+import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst.ba.context.ArjunaContextImple;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.stax.URI;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wscoor.AttributedUnsignedIntType;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.ContextFactory;
+import com.arjuna.wsc.InvalidCreateParametersException;
+
+public class ContextFactoryImple implements ContextFactory
+{
+
+    public ContextFactoryImple ()
+    {
+        try
+        {
+            _coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+            _theRegistrar = new RegistrarImple();
+        }
+        catch (Exception ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+
+    /**
+     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
+     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
+     * protocol identifiers.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+
+    public void install (final String coordinationTypeURI)
+    {
+    }
+
+    // TODO interposition
+
+    /*
+     * If there is a context passed through to create then this newly created
+     * coordinator should be interposed.
+     */
+
+    /**
+     * Creates a coordination context.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     * @param expires the expire date/time for the returned context, can be null
+     * @param currentContext the current context, can be null
+     *
+     * @return the created coordination context
+     *
+     * @throws InvalidCreateParametersException if a parameter passed is invalid
+     *         this activity identifier.
+     *
+     * @message com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1 [com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1] - Invalid type URI: < {0} , {1} >
+     * @message com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3 [com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3] - Invalid type URI: 
+     */
+
+    public CoordinationContextType create (final String coordinationTypeURI,
+            final Long expires, final CoordinationContextType currentContext)
+        throws InvalidCreateParametersException
+    {
+        if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationTypeURI))
+    	{
+    	    try
+    	    {
+    		// make sure no transaction is currently associated
+    
+    		_coordManager.suspend();
+    		
+    		final int timeout ;
+            if (expires == null)
+            {
+                timeout = 0 ;
+            }
+            else
+            {
+                final long longTimeout = expires.longValue() ;
+                timeout = (longTimeout > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)longTimeout) ;
+            }
+    		
+    		_coordManager.begin(timeout);
+    
+            final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
+            final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+            final String registrationCoordinatorURI = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_REGISTRATION_COORDINATOR) ;
+            
+            final CoordinationContextType coordinationContext = new CoordinationContextType() ;
+            coordinationContext.setCoordinationType(new URI(coordinationTypeURI)) ;
+            coordinationContext.setIdentifier(new AttributedURIType("urn:"+arjunaContext.getTransactionIdentifier())) ;
+            final int transactionExpires = arjunaContext.getTransactionExpires() ;
+            if (transactionExpires > 0)
+            {
+                coordinationContext.setExpires(new AttributedUnsignedIntType(transactionExpires)) ;
+            }
+            final EndpointReferenceType registrationCoordinator = new EndpointReferenceType(new AttributedURIType(registrationCoordinatorURI)) ;
+            InstanceIdentifier.setEndpointInstanceIdentifier(registrationCoordinator, arjunaContext.getTransactionIdentifier()) ;
+            coordinationContext.setRegistrationService(registrationCoordinator) ;
+            
+            TerminationCoordinatorProcessor.getProcessor().activateParticipant(new BusinessActivityTerminatorImple(), arjunaContext.getTransactionIdentifier()) ;
+    
+    		_theRegistrar.associate();
+    
+    		return coordinationContext;
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	    catch (Exception ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	}
+	else
+	{
+	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.ContextFactoryImple_1",
+					  new Object[]{BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, coordinationTypeURI});
+
+	    throw new InvalidCreateParametersException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.ContextFactoryImple_3")+" < "+BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME+", "+coordinationTypeURI+" >");
+	}
+
+	return null;
+    }
+
+    /**
+     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
+     * times if the context factory is removed from multiple context factory mappers or from the same context factory
+     * mapper with different coordination type uris.
+     *
+     * @param serviceAddress the address of the service
+     * @param coordinationTypeURI the coordination type uri
+     */
+
+    public void uninstall (String coordinationTypeURI)
+    {
+	// we don't use this as one implementation is registered per type
+    }
+
+    public final RegistrarImple registrar ()
+    {
+	return _theRegistrar;
+    }
+
+    private CoordinatorManager                   _coordManager;
+    private RegistrarImple                       _theRegistrar;
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/ContextImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,71 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextImple.java,v 1.3.6.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba;
+
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+
+public class ContextImple implements com.arjuna.mw.wsc.context.Context
+{
+    public ContextImple (CoordinationContextType ctx)
+    {
+        _coordContext = ctx;
+    }
+
+    public boolean equals (Object obj)
+    {
+        if (obj instanceof ContextImple)
+        {
+    	    ContextImple ci = (ContextImple) obj;
+    	    
+            return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
+        }
+        else
+            return false;
+    }
+
+    public CoordinationContextType getCoordinationContext ()
+    {
+    	return _coordContext;
+    }
+    
+    public void setCoordinationContext (CoordinationContextType cc)
+    {
+    	_coordContext = cc;
+    }
+
+    public String toString ()
+    {
+    	return "BusinessActivityIdentifier: "+_coordContext.getIdentifier().getValue();
+    }
+
+    private CoordinationContextType _coordContext;
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/RegistrarImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/RegistrarImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/RegistrarImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,272 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002, 2003, 2004,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: RegistrarImple.java,v 1.7.4.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba;
+
+import java.util.HashMap;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithCoordinatorCompletionImple;
+import com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithParticipantCompletionImple;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.InvalidProtocolException;
+import com.arjuna.wsc.InvalidStateException;
+import com.arjuna.wsc.NoActivityException;
+import com.arjuna.wsc.Registrar;
+import com.arjuna.wsc.RegistrarMapper;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionCoordinatorEngine;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionCoordinatorEngine;
+import com.arjuna.wst.stub.BusinessAgreementWithCoordinatorCompletionStub;
+import com.arjuna.wst.stub.BusinessAgreementWithParticipantCompletionStub;
+
+public class RegistrarImple implements Registrar
+{
+
+	public RegistrarImple () throws ProtocolNotRegisteredException,
+			SystemException
+	{
+		_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+		// register with mapper using tx id as protocol identifier.
+		final RegistrarMapper mapper = RegistrarMapper.getFactory();
+
+		mapper.addRegistrar(
+			BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION, this);
+		mapper.addRegistrar(
+			BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION, this);
+		mapper.addRegistrar(ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION, this);
+	}
+
+	/**
+	 * Called when a registrar is added to a register mapper. This method will
+	 * be called multiple times if the registrar is added to multiple register
+	 * mappers or to the same register mapper with different protocol
+	 * identifiers.
+	 * 
+	 * @param serviceAddress
+	 *            the address of the service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void install (String protocolIdentifier)
+	{
+	}
+
+	/**
+	 * Registers the interest of participant in a particular protocol.
+	 * 
+	 * @param participantProtocolServiceAddress
+	 *            the address of the participant protocol service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 * 
+	 * @return the PortReference of the coordinator protocol service
+	 * 
+	 * @throws AlreadyRegisteredException
+	 *             if the participant is already registered for this
+	 *             coordination protocol under this activity identifier
+	 * @throws InvalidProtocolException
+	 *             if the coordination protocol is not supported
+	 * @throws InvalidStateException
+	 *             if the state of the coordinator no longer allows registration
+	 *             for this coordination protocol
+	 * @throws NoActivityException
+	 *             if the activity does not exist.
+	 * 
+	 * @message com.arjuna.mwlabs.wst.ba.RegistrarImple_1
+	 *          [com.arjuna.mwlabs.wst.ba.RegistrarImple_1] - Invalid type URI: <
+	 *          {0} , {1} >
+	 */
+
+	public EndpointReferenceType register (
+			final EndpointReferenceType participantProtocolService,
+			final String protocolIdentifier,
+			final InstanceIdentifier instanceIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+			InvalidStateException, NoActivityException
+	{
+		ActivityHierarchy hier = (ActivityHierarchy) _hierarchies
+				.get(instanceIdentifier.getInstanceIdentifier());
+
+		if (hier == null) throw new NoActivityException();
+
+		try
+		{
+			_coordManager.resume(hier);
+		}
+		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+		{
+			throw new NoActivityException();
+		}
+		catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+		{
+			throw new InvalidProtocolException();
+		}
+
+		// TODO check for AlreadyRegisteredException
+
+		if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
+				.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String id = new Uid().stringForm();
+
+			try
+			{
+                final ParticipantCompletionCoordinatorEngine engine = new ParticipantCompletionCoordinatorEngine(id, participantProtocolService) ;
+				BusinessAgreementWithParticipantCompletionImple participant = new BusinessAgreementWithParticipantCompletionImple(
+						new BusinessAgreementWithParticipantCompletionStub(engine), id);
+                engine.setCoordinator(participant.participantManager()) ;
+
+				_coordManager.enlistParticipant(participant);
+
+				_coordManager.suspend();
+
+				return getParticipantManager(
+						BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
+						id);
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else
+			if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
+					.equals(protocolIdentifier))
+			{
+				final String id = new Uid().stringForm();
+				try
+				{
+                    final CoordinatorCompletionCoordinatorEngine engine = new CoordinatorCompletionCoordinatorEngine(id, participantProtocolService) ;
+					BusinessAgreementWithCoordinatorCompletionImple participant = new BusinessAgreementWithCoordinatorCompletionImple(
+							new BusinessAgreementWithCoordinatorCompletionStub(engine), id);
+                    engine.setCoordinator(participant.participantManager()) ;
+
+					_coordManager.enlistParticipant(participant);
+
+					_coordManager.suspend();
+
+					return getParticipantManager(
+							BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
+							id);
+				}
+				catch (Exception ex)
+				{
+					throw new InvalidStateException();
+				}
+			}
+			else
+				if (ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
+				{
+					try
+					{
+						return getParticipantManager(
+								ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
+								instanceIdentifier.getInstanceIdentifier());
+					}
+					catch (Exception ex)
+					{
+						throw new InvalidStateException();
+					}
+				}
+				else
+				{
+					wstxLogger.arjLoggerI18N
+							.warn(
+									"com.arjuna.mwlabs.wst.ba.RegistrarImple_1",
+									new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
+
+					throw new InvalidProtocolException();
+				}
+	}
+
+	/**
+	 * Called when a registrar is removed from a register mapper. This method
+	 * will be called multiple times if the registrar is removed from multiple
+	 * register mappers or from the same register mapper with different protocol
+	 * identifiers.
+	 * 
+	 * @param serviceAddress
+	 *            the address of the service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void uninstall (String protocolIdentifier)
+	{
+	}
+
+	public final void associate () throws Exception
+	{
+		// TODO colocation won't do suspend
+
+		String txIdentifier = _coordManager.identifier().toString();
+		ActivityHierarchy hier = _coordManager.suspend();
+
+		_hierarchies.put(txIdentifier, hier);
+	}
+
+	public final void disassociate (String txIdentifier) throws Exception
+	{
+		_hierarchies.remove(txIdentifier);
+	}
+
+	private EndpointReferenceType getParticipantManager (final String service,
+			final String id)
+	{
+		final SoapRegistry soapRegistry = SoapRegistry.getRegistry();
+		final String participantManagerParticipantURI = soapRegistry
+				.getServiceURI(service);
+		final EndpointReferenceType participantManagerParticipant = new EndpointReferenceType(
+				new AttributedURIType(participantManagerParticipantURI));
+		InstanceIdentifier.setEndpointInstanceIdentifier(
+				participantManagerParticipant, id);
+		return participantManagerParticipant;
+	}
+
+	private CoordinatorManager _coordManager = null;
+
+	private HashMap _hierarchies = new HashMap();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/context (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/context)

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/local (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/local)

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/participants (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/participants)

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BAParticipantManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,199 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BAParticipantManagerImple.java,v 1.5.6.1 2005/11/22 10:36:08 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba.remote;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
+import com.arjuna.mw.wscf.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * This could also be the interface that high-level users see (e.g., at the
+ * application Web Service).
+ */
+
+public class BAParticipantManagerImple implements com.arjuna.wst.BAParticipantManager
+{
+
+    public BAParticipantManagerImple (String participantId)
+    {
+	try
+	{
+	    _coordManager = CoordinatorManagerFactory.coordinatorManager();
+	    _hier = _coordManager.currentActivity();
+	    _participantId = participantId;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	}	
+    }
+	
+    public void exit () throws WrongStateException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+	    
+	    _coordManager.resume(_hier);
+	    
+	    _coordManager.delistParticipant(_participantId);
+
+	    _coordManager.suspend();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new WrongStateException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void completed () throws WrongStateException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+	    
+	    _coordManager.resume(_hier);
+
+	    _coordManager.participantCompleted(_participantId);
+
+	    _coordManager.suspend();
+	}
+    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new WrongStateException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void fault () throws SystemException
+    {
+	try
+	{
+        if (_hier == null)
+            throw new UnknownTransactionException();
+            
+            _coordManager.resume(_hier);
+
+            _coordManager.participantFaulted(_participantId);
+
+            _coordManager.suspend();
+	}
+    catch (final InvalidActivityException iae)
+    {
+        throw new SystemException("UnknownTransactionException");
+    }
+    catch (final UnknownTransactionException ute)
+    {
+        throw new SystemException("UnknownTransactionException");
+    }
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new SystemException("UnknownTransactionException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void unknown () throws SystemException
+    {
+	// ??
+    }
+    
+    public void error () throws SystemException
+    {
+	try
+	{
+	    _coordManager.setCancelOnly();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private CoordinatorManager _coordManager = null;
+    private ActivityHierarchy  _hier = null;
+    private String             _participantId = null;
+
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/BusinessActivityManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,209 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManagerImple.java,v 1.7.4.1 2005/11/22 10:36:08 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba.remote;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wst.BusinessActivityManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mwlabs.wst.ba.context.TxContextImple;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc.RegistrationCoordinator;
+import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.messaging.engines.CoordinatorCompletionParticipantEngine;
+import com.arjuna.wst.messaging.engines.ParticipantCompletionParticipantEngine;
+import com.arjuna.wst.stub.BACoordinatorCompletionParticipantManagerStub;
+import com.arjuna.wst.stub.BAParticipantCompletionParticipantManagerStub;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ */
+
+public class BusinessActivityManagerImple extends BusinessActivityManager
+{
+    public BusinessActivityManagerImple ()
+    {
+    }
+	
+    public BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion (BusinessAgreementWithParticipantCompletionParticipant bap, String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
+    {
+        final EndpointReferenceType participant = getParticipant(BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_PARTICIPANT, id) ;
+    	try
+    	{
+            EndpointReferenceType baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
+            final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap) ;
+            ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+    
+            return new BAParticipantCompletionParticipantManagerStub(engine);
+    	}
+    	catch (com.arjuna.wsc.InvalidProtocolException ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (com.arjuna.wsc.InvalidStateException ex)
+    	{
+    	    throw new WrongStateException();
+    	}
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    throw new UnknownTransactionException();
+    	}
+    	catch (Throwable ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion (BusinessAgreementWithCoordinatorCompletionParticipant bawcp, String id) throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
+    {
+        final EndpointReferenceType participant = getParticipant(BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_PARTICIPANT, id) ;
+    	try
+    	{
+    	    EndpointReferenceType baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
+            final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, baPMEndpoint, bawcp) ;
+            CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+        
+            return new BACoordinatorCompletionParticipantManagerStub(engine);
+    	}
+    	catch (com.arjuna.wsc.InvalidProtocolException ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (com.arjuna.wsc.InvalidStateException ex)
+    	{
+    	    throw new WrongStateException();
+    	}
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new UnknownTransactionException();
+    	}
+    	catch (Throwable ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public TxContext suspend () throws SystemException
+    {
+        return _ctxManager.suspend();
+    }
+
+    // resume overwrites. Should we check first a la JTA?
+
+    public void resume (TxContext tx) throws UnknownTransactionException, SystemException
+    {
+        _ctxManager.resume(tx);
+    }
+
+    public TxContext currentTransaction () throws SystemException
+    {
+        return _ctxManager.currentTransaction();
+    }
+	
+    private final EndpointReferenceType registerParticipant(final EndpointReferenceType participant, final String protocol)
+        throws com.arjuna.wsc.InvalidProtocolException, com.arjuna.wsc.InvalidStateException, com.arjuna.wsc.NoActivityException, SystemException
+    {
+    	TxContextImple currentTx = null;
+    
+    	try
+    	{
+    	    currentTx = (TxContextImple) _ctxManager.currentTransaction();
+    	    
+    	    if (currentTx == null)
+        		throw new com.arjuna.wsc.NoActivityException();
+
+            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
+            final String messageId = new Uid().stringForm() ;
+            return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
+    	}
+        catch (final SoapFault sf)
+        {
+            throw new SystemException(sf.getMessage());
+        }
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    try
+    	    {
+        		if (currentTx != null)
+        		    _ctxManager.resume(currentTx);
+    	    }
+    	    catch (Exception ex)
+    	    {
+        		ex.printStackTrace();
+    	    }
+    	}
+    }
+
+    private EndpointReferenceType getParticipant(final String participantService, final String id)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String participantServiceURI = soapRegistry.getServiceURI(participantService) ;
+        final EndpointReferenceType endpoint = new EndpointReferenceType(new AttributedURIType(participantServiceURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(endpoint, id) ;
+        return endpoint ;
+    }
+    
+    private ContextManager _ctxManager = new ContextManager();
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/ba/remote/UserBusinessActivityImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,321 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivityImple.java,v 1.10.4.1 2005/11/22 10:36:07 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst.ba.remote;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wst.UserBusinessActivity;
+import com.arjuna.mw.wst.common.Environment;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst.ba.ContextImple;
+import com.arjuna.mwlabs.wst.ba.context.TxContextImple;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.SoapRegistry;
+import com.arjuna.webservices.wsaddr.AttributedURIType;
+import com.arjuna.webservices.wsaddr.EndpointReferenceType;
+import com.arjuna.webservices.wsarj.InstanceIdentifier;
+import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+import com.arjuna.webservices.wsba.BusinessActivityConstants;
+import com.arjuna.webservices.wscoor.CoordinationConstants;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc.RegistrationCoordinator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst.stub.BusinessActivityTerminatorStub;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ *
+ * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_1 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_1] - Invalid address.
+ * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2] - Received context is null!
+ * @message com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3 [com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3] - No termination context!
+ */
+
+public class UserBusinessActivityImple extends UserBusinessActivity
+{
+    public UserBusinessActivityImple ()
+    {
+        try
+        {
+            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
+
+            /*
+             * If the coordinator URL hasn't been specified via the
+             * configuration file then assume we are using a locally registered
+             * implementation.
+             */
+
+            if (_activationCoordinatorService == null)
+            {
+                final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+                _activationCoordinatorService = soapRegistry.getServiceURI(CoordinationConstants.SERVICE_ACTIVATION_COORDINATOR) ;
+            }
+        }
+        catch (Exception ex)
+        {
+            // TODO
+
+            ex.printStackTrace();
+        }
+    }
+    
+    public void begin () throws WrongStateException, SystemException
+    {
+    	begin(0);
+    }
+    
+    public void begin (int timeout) throws WrongStateException, SystemException
+    {
+    	try
+    	{
+    	    if (_ctxManager.currentTransaction() != null)
+        		throw new WrongStateException();
+    
+    	    com.arjuna.mw.wsc.context.Context ctx = startTransaction(timeout);
+    
+    	    _ctxManager.resume(new TxContextImple(ctx));
+    	}
+    	catch (com.arjuna.wsc.InvalidCreateParametersException ex)
+    	{
+    	    tidyup();
+    
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (com.arjuna.wst.UnknownTransactionException ex)
+    	{
+    	    tidyup();
+    
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (SystemException ex)
+    	{
+    	    tidyup();
+    
+    	    throw ex;
+    	}
+    }
+
+    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+    	TxContextImple ctx = null;
+    
+    	try
+    	{
+    	    ctx = (TxContextImple) _ctxManager.suspend();
+            
+            final String id = ctx.identifier() ;
+            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
+            
+    	    BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+    	    
+    	    terminatorStub.close();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (TransactionRolledBackException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    tidyup();
+    	}
+    }
+
+    public void cancel () throws UnknownTransactionException, SystemException
+    {
+    	TxContextImple ctx = null;
+    
+    	try
+    	{
+            ctx = (TxContextImple) _ctxManager.suspend();
+            
+            final String id = ctx.identifier() ;
+            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
+            
+            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+    	    
+    	    terminatorStub.cancel();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+    	    
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    tidyup();
+    	}
+    }
+
+    public void complete () throws UnknownTransactionException, SystemException
+    {
+    	try
+    	{
+            final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction()) ;
+            final String id = ctx.identifier() ;
+            final EndpointReferenceType terminatorCoordinator = getTerminationCoordinator(ctx) ;
+            
+            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+            
+    	    terminatorStub.complete();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public String transactionIdentifier ()
+    {
+    	try
+    	{
+    	    return _ctxManager.currentTransaction().toString();
+    	}
+    	catch (com.arjuna.wst.SystemException ex)
+    	{
+    	    return "Unknown";
+    	}
+    	catch (NullPointerException ex)
+    	{
+    	    return "Unknown";
+    	}
+    }
+
+    public String toString ()
+    {
+    	return transactionIdentifier();
+    }
+
+    private final com.arjuna.mw.wsc.context.Context startTransaction (int timeout) throws com.arjuna.wsc.InvalidCreateParametersException, SystemException
+    {
+        try
+        {
+            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+            final String messageId = new Uid().stringForm() ;
+            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+                    _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, null) ;
+            if (coordinationContext == null)
+            {
+                throw new SystemException(
+                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_2"));
+            }
+            return new ContextImple(coordinationContext) ;
+        }
+        catch (final InvalidCreateParametersException icpe)
+        {
+            throw icpe ;
+        }
+        catch (final SoapFault sf)
+        {
+            throw new SystemException(sf.getMessage()) ;
+        }
+        catch (final Exception ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+	}
+    
+    private EndpointReferenceType getTerminationCoordinator(final TxContextImple ctx)
+        throws SystemException
+    {
+        final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext() ;
+        final String messageId = new Uid().stringForm() ;
+        try
+        {
+            return RegistrationCoordinator.register(coordinationContext, messageId,
+                getParticipantProtocolService(ctx.identifier()), ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.remote.UserBusinessActivityImple_3"));
+        }
+    }
+    
+    private EndpointReferenceType getParticipantProtocolService(final String id)
+    {
+        final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        final String serviceURI = soapRegistry.getServiceURI(ArjunaTXConstants.SERVICE_TERMINATION_PARTICIPANT) ;
+        final EndpointReferenceType participant = new EndpointReferenceType(new AttributedURIType(serviceURI)) ;
+        InstanceIdentifier.setEndpointInstanceIdentifier(participant, id) ;
+        return participant ;
+    }
+
+    private final void tidyup ()
+    {
+    	try
+    	{
+    	    _ctxManager.suspend();
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+    	}
+    }
+    
+    private ContextManager _ctxManager = new ContextManager();
+    private String _activationCoordinatorService;
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/TwoPhaseTxManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,223 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wstx.model.as.twophase;
+
+import com.arjuna.mw.wscf.model.as.CoordinatorManager;
+import com.arjuna.mw.wscf.model.as.CoordinatorManagerFactory;
+
+import com.arjuna.mw.wscf.model.as.coordinator.twophase.common.*;
+
+import com.arjuna.mw.wstx.resource.Participant;
+import com.arjuna.mw.wstx.resource.Synchronization;
+
+import com.arjuna.mw.wstx.TransactionManager;
+
+import com.arjuna.mwlabs.wstx.model.as.twophase.resource.ParticipantAction;
+import com.arjuna.mwlabs.wstx.model.as.twophase.resource.SynchronizationAction;
+
+import com.arjuna.mw.wstx.exceptions.DuplicateParticipantException;
+import com.arjuna.mw.wstx.exceptions.NoTransactionException;
+import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
+import com.arjuna.mw.wstx.exceptions.InvalidParticipantException;
+import com.arjuna.mw.wstx.exceptions.DuplicateSynchronizationException;
+import com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
+import com.arjuna.mw.wsas.exceptions.ActiveChildException;
+
+/**
+ * This is the service side component of the user interface. Since services
+ * or some entity acting on their behalf (e.g., an interceptor) must enlist
+ * participants with the transaction (atom or cohesion), this interface
+ * primarily concentrates on those methods. However, a service may well
+ * not be the final destination for a transaction, i.e., in order to perform
+ * its work, the service may have to make other remote invocations on other
+ * services and propagate the context, suspend it, etc. As such, all of the
+ * UserTransaction methods are also available to the service.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class TwoPhaseTxManager implements TransactionManager
+{
+
+    public TwoPhaseTxManager ()
+    {
+	try
+	{
+	    _coordinatorManager = CoordinatorManagerFactory.coordinatorManager();
+	}
+	catch (Exception ex)
+	{
+	    // TODO
+
+	    ex.printStackTrace();
+	    
+	    _coordinatorManager = null;
+	}
+    }
+    
+    /**
+     * Enrol the specified participant in the current transaction.
+     * It is illegal to call this method when no transaction is associated
+     * with the thread.
+     *
+     * @param Participant participant The participant to enrol.
+     * @exception WrongStateException Thrown if the transaction is not in a state
+     * whereby participants can be enrolled.
+     * @exception DuplicateParticipantException Thrown if the participant identifier
+     * has already been associated with a participant.
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception InvalidTransactionException Thrown if the transaction associated with
+     * the thread is invalid.
+     * @exception InvalidParticipantException Thrown if the participant reference
+     * is invalid.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void enlist (Participant participant) throws WrongStateException, DuplicateParticipantException, NoTransactionException, InvalidTransactionException, InvalidParticipantException, SystemException
+    {
+	try
+	{
+	    _coordinatorManager.addParticipant(new ParticipantAction(participant), Priorities.PARTICIPANT, null);
+	}
+	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
+	{
+	    throw new DuplicateParticipantException();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new InvalidParticipantException();
+	}
+    }
+    
+    /**
+     * Cause the specified participant to resign from the transaction.
+     * CAUTION: use with *extreme* care since if invoked at the wrong time
+     * it could lead to data corruption or state modifications that are
+     * no longer under the control of the transaction. You *must* ensure
+     * that no state changes have been made that should be controlled by
+     * the specified participant.
+     *
+     * @param Participant participant The participant to resign.
+     * @exception InvalidTransactionException Thrown if the transaction associated with
+     * the thread is invalid.
+     * @exception NoTransactionException Thrown if no transaction is associated
+     * with the invoking thread.
+     * @exception InvalidParticipantException Thrown if the transaction does not know
+     * about the specified participant or the parameter is invalid.
+     * @exception WrongStateException Thrown if the transaction is not in a state
+     * that allows participants to resign.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void delist (Participant participant) throws InvalidTransactionException, NoTransactionException, InvalidParticipantException, WrongStateException, SystemException
+    {
+	// TODO: support it!
+
+	throw new WrongStateException();
+    }
+
+    /**
+     * Enlist a synchronization with the current transaction. Synchronizations
+     * do not receive the two-phase commit messages but instead are invoked
+     * prior to its start and after it has completed.
+     *
+     * @param Synchronization participant The synchronization to enroll.
+     *
+     * @exception WrongStateException Thrown if the transaction state is such
+     * that synchronizations cannot be enrolled.
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception InvalidTransactionException Thrown if the transaction is not
+     * top-level.
+     * @exception InvalidSynchronizationException Thrown if the synchronization
+     * reference is invalid.
+     * @exception DuplicateSynchronizationException Thrown if the synchronization
+     * has already been registered with the transaction.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void addSynchronization (Synchronization participant) throws WrongStateException, NoTransactionException, InvalidTransactionException, InvalidSynchronizationException, DuplicateSynchronizationException, SystemException
+    {
+	try
+	{
+	    _coordinatorManager.addParticipant(new SynchronizationAction(participant), Priorities.SYNCHRONIZATION, null);
+	}
+	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
+	{
+	    throw new DuplicateSynchronizationException();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new InvalidSynchronizationException();
+	}
+    }
+
+    /**
+     * Remove the specified synchronization participant from the transaction.
+     *
+     * @param Synchronization participant The participant to remove.
+     *
+     * @exception InvalidTransactionException Thrown if the transaction is not
+     * top-level.
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception InvalidSynchronizationException Thrown if the transaction
+     * does not know about the specified synchronization.
+     * @exception WrongStateException Thrown if the state of the transaction is
+     * such that the synchronization cannot be removed.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void removeSynchronization (Synchronization participant) throws SystemException, InvalidTransactionException, NoTransactionException, InvalidSynchronizationException, WrongStateException
+    {
+	throw new WrongStateException();
+    }
+
+    private CoordinatorManager _coordinatorManager;
+    
+}

Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java (from rev 19476, labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wstx/model/as/twophase/UserTwoPhaseTx.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,563 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wstx.model.as.twophase;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.UserTransaction;
+
+import com.arjuna.mw.wstx.transaction.*;
+import com.arjuna.mw.wstx.status.*;
+
+import com.arjuna.mw.wstx.common.TxId;
+
+import com.arjuna.mwlabs.wstx.transaction.*;
+
+import com.arjuna.mwlabs.wstx.common.arjunacore.TxIdImple;
+
+import com.arjuna.mw.wsas.status.*;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.mw.wsas.completionstatus.CompletionStatus;
+import com.arjuna.mw.wsas.completionstatus.Success;
+import com.arjuna.mw.wsas.completionstatus.Failure;
+import com.arjuna.mw.wsas.completionstatus.FailureOnly;
+
+import com.arjuna.mw.wscf.UserCoordinator;
+import com.arjuna.mw.wscf.UserCoordinatorFactory;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.CoordinatorIdImple;
+
+import com.arjuna.mw.wscf.model.twophase.common.TwoPhaseResult;
+import com.arjuna.mw.wscf.model.twophase.status.*;
+import com.arjuna.mw.wscf.model.twophase.outcomes.*;
+
+import com.arjuna.mw.wscf.model.as.coordinator.twophase.outcomes.*;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.InvalidTimeoutException;
+import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.mw.wsas.exceptions.NoPermissionException;
+import com.arjuna.mw.wsas.exceptions.ActiveChildException;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
+import com.arjuna.mw.wstx.exceptions.NoTransactionException;
+import com.arjuna.mw.wstx.exceptions.HeuristicHazardException;
+import com.arjuna.mw.wstx.exceptions.HeuristicMixedException;
+import com.arjuna.mw.wstx.exceptions.HeuristicCommitException;
+import com.arjuna.mw.wstx.exceptions.HeuristicRollbackException;
+import com.arjuna.mw.wstx.exceptions.TransactionRolledBackException;
+import com.arjuna.mw.wstx.exceptions.TransactionCommittedException;
+
+/**
+ * The user portion of the transaction API.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
+ * @since 1.0.
+ *
+ * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2] - Transaction has active children.
+ * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3] - Unknown end result!
+ */
+
+public class UserTwoPhaseTx implements UserTransaction
+{
+
+    public UserTwoPhaseTx ()
+    {
+	try
+	{
+	    /*
+	     * TODO: currently relies on the fact that the default
+	     * coordination protocol is two-phase. Needs to be explicit.
+	     */
+
+	    _theCoordinator = UserCoordinatorFactory.userCoordinator();
+	}
+	catch (SystemException ex)
+	{
+	    // TODO
+
+	    ex.printStackTrace();
+	    
+	    _theCoordinator = null;
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    ex.printStackTrace();
+	    
+	    _theCoordinator = null;
+	}
+    }
+    
+    /**
+     * Start a new transaction. If there is already a transaction associated
+     * with the thread then it will be interposed (nesting is to come!)
+     *
+     * @exception WrongStateException Thrown if the any currently associated
+     * transaction is in a state that does not allow a new transaction to be
+     * enlisted.
+     * @exception SystemException Thrown in any other situation.
+     */
+
+    public void begin () throws WrongStateException, SystemException
+    {
+	_theCoordinator.start();
+    }
+
+    /**
+     * Commit the transaction. All participants that are still enlisted
+     * with the transaction are committed.
+     *
+     * @exception InvalidTransactionException Thrown if the current transaction is not
+     * known about by the transaction system.
+     * @exception WrongStateException Thrown if the current transaction is not in a
+     * state that allows commit to be called.
+     * @exception HeuristicHazardException Thrown if the participants generated a hazard
+     * heuristic.
+     * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception SystemException Thrown if some other error occurred.
+     */
+
+    public void commit () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionRolledBackException, SystemException
+    {
+	try
+	{
+	    Outcome result = _theCoordinator.end(Success.instance());
+	 
+	    parseOutcome(result, true);
+	}
+	catch (ActiveChildException ex)
+	{
+	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2"));
+	}
+	catch (TransactionCommittedException ex)
+	{
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+	catch (WrongStateException ex)
+	{
+	    throw ex;
+	}
+	catch (ProtocolViolationException ex)
+	{
+	    throw new HeuristicHazardException(ex.toString());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (NoPermissionException ex)
+	{
+	    throw new InvalidTransactionException(ex.toString());
+	}
+	catch (HeuristicHazardException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    /**
+     * Abort the transaction. All participants that are still enlisted
+     * with the transaction are rolled back.
+     *
+     * @exception InvalidTransactionException Thrown if the current transaction is not
+     * known about by the transaction system.
+     * @exception WrongStateException Thrown if the current transaction is not in a
+     * state that allows cancel to be called.
+     * @exception HeuristicHazardException Thrown if the participants generated a hazard
+     * heuristic.
+     * @exception HeuristicMixedException Thrown if the participants generated a mixed heuristic.
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception SystemException Thrown if some other error occurred.
+     */
+
+    public void rollback () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionCommittedException, SystemException
+    {
+	try
+	{
+	    Outcome result = _theCoordinator.end(Failure.instance());
+
+	    parseOutcome(result, false);
+	}
+	catch (ActiveChildException ex)
+	{
+	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_2"));
+	}
+	catch (TransactionRolledBackException ex)
+	{
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+	catch (WrongStateException ex)
+	{
+	    throw ex;
+	}
+	catch (ProtocolViolationException ex)
+	{
+	    throw new HeuristicHazardException(ex.toString());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (NoPermissionException ex)
+	{
+	    throw new InvalidTransactionException(ex.toString());
+	}
+	catch (HeuristicHazardException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    /**
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the status of the current transaction. If there is no
+     * transaction associated with the thread then NO_TRANSACTION
+     * will be returned.
+     */
+
+    public Status status () throws SystemException
+    {
+	Status s = _theCoordinator.status();
+	
+	if (s instanceof Cancelling)
+	    s = RollingBack.instance();
+	else
+	{
+	    if (s instanceof CancelOnly)
+		s = RollbackOnly.instance();
+	    else
+	    {
+		if (s instanceof Confirming)
+		    s = Committing.instance();
+		else
+		{
+		    if (s instanceof Confirmed)
+			s = Committed.instance();
+		    else
+		    {
+			if (s instanceof Cancelled)
+			    s = RolledBack.instance();
+			else
+			{
+			    if (s instanceof NoActivity)
+				s = NoTransaction.instance();
+			}
+		    }
+		}
+	    }
+	}
+
+	return s;
+    }
+
+    /**
+     * What is the name of the current transaction? Use only for
+     * debugging purposes.
+     *
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     *
+     * @return the name of the transaction.
+     */
+
+    public String transactionName () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    return _theCoordinator.activityName();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+    
+    /**
+     * Suspend all transactions associated with this thread. The thread then
+     * becomes associated with no transaction (atom or cohesion).
+     *
+     * @exception SystemException if any error occurs.
+     *
+     * @return a representation of the context associated with the thread,
+     * or null if there is no context.
+     */
+
+    public TransactionHierarchy suspend () throws SystemException
+    {
+	ActivityHierarchy hier = _theCoordinator.suspend();
+	
+	if (hier != null)
+	    return new TransactionHierarchyImple(hier);
+	else
+	    return null;
+    }
+    
+    /**
+     * Associate this thread with the specified context. Any current
+     * associations are lost.
+     *
+     * @param TransactionHierarchy tx The context representation to associate (may be
+     * null).
+     *
+     * @exception InvalidTransactionException Thrown if the context is invalid.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void resume (TransactionHierarchy tx) throws InvalidTransactionException, SystemException
+    {
+	ActivityHierarchy hier;
+
+	if (tx == null)
+	    hier = null;
+	else
+	{
+	    if (tx instanceof TransactionHierarchyImple)
+	    {
+		hier = ((TransactionHierarchyImple) tx).activityHierarchy();
+	    }
+	    else
+		throw new InvalidTransactionException();
+	}
+
+	try
+	{
+	    _theCoordinator.resume(hier);
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+    }
+
+    /**
+     * @return a representation of the context currently associated with
+     * the invoking thread, or null if there is none.
+     */
+
+    public TransactionHierarchy currentTransaction () throws SystemException
+    {
+	ActivityHierarchy hier = _theCoordinator.currentActivity();
+	
+	if (hier != null)
+	    return new TransactionHierarchyImple(hier);
+	else
+	    return null;
+    }
+
+    /**
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception SystemException Thrown if any other error occurs.
+     *
+     * @return the qualifiers that are currently associated with the
+     * transaction, or null if there are none.
+     */
+
+    public Qualifier[] qualifiers () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    return _theCoordinator.qualifiers();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    /**
+     * Set the state of the transaction such that the only possible outcome is
+     * for it to rollback.
+     *
+     * @exception NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception WrongStateException Thrown if the state of the transaction is
+     * such that it is not possible to put it into a rollback-only state, e.g.,
+     * it is committing.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void setRollbackOnly () throws NoTransactionException, WrongStateException, SystemException
+    {
+	try
+	{
+	    _theCoordinator.setCompletionStatus(FailureOnly.instance());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    /**
+     * Get the timeout value currently associated with transactions.
+     *
+     * @exception SystemException Thrown if any error occurs.
+     *
+     * @return the timeout value in seconds, or 0 if no application specified
+     * timeout has been provided.
+     */
+
+    public int getTimeout () throws SystemException
+    {
+	// TODO
+
+	return 0;
+    }
+
+    /**
+     * Set the timeout to be associated with all subsequently created
+     * activities. A default value of 0 is automatically associated with
+     * each thread and this means that no application specified timeout is
+     * set for activities.
+     *
+     * @param int timeout The timeout (in seconds) to associate with all
+     * subsequently created activities. This value must be 0 or greater.
+     *
+     * @exception InvalidTimeoutException Thrown if the timeout value provided
+     * is negative, too large, or if timeouts are simply not supported by
+     * the activity implementation.
+     * @exception SystemException Thrown if any other error occurs.
+     */
+
+    public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException
+    {
+	// TODO
+    }
+
+    /**
+     * @exception NoTransactionException Thrown if there is no activity
+     * associated with the invoking thread.
+     * @exception SystemException Thrown if some other error occurred.
+     *
+     * @return the unique transaction id for the current transaction. This
+     * may or may not be the same as the activity id.
+     *
+     * @message com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1 [com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1] - Unknown coordinator identifier type {0}
+     */
+
+    public TxId identifier () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    CoordinatorId coordId = _theCoordinator.identifier();
+
+	    if (coordId instanceof CoordinatorIdImple)
+		return new TxIdImple((CoordinatorIdImple) coordId);
+	    else
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_1",
+					      new Object[]{coordId});
+	    
+		return null;
+	    }
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+    
+    private final void parseOutcome (Outcome out, boolean commit) throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, TransactionRolledBackException, TransactionCommittedException
+    {
+	try
+	{
+	    if ((out.completedStatus().equals(Failure.instance()) ||
+		 out.completedStatus().equals(FailureOnly.instance())) && commit)
+	    {
+		throw new TransactionRolledBackException();
+	    }
+	}
+	catch (SystemException ex)
+	{
+	    throw new HeuristicHazardException();
+	}
+	
+	if (out instanceof CoordinationOutcome)
+	{
+	    int res = ((CoordinationOutcome) out).result();
+
+	    switch (res)
+	    {
+	    case TwoPhaseResult.CANCELLED:
+	    case TwoPhaseResult.HEURISTIC_CANCEL:
+		{
+		    if (commit)
+			throw new TransactionRolledBackException();
+		}
+		break;
+	    case TwoPhaseResult.CONFIRMED:
+	    case TwoPhaseResult.HEURISTIC_CONFIRM:
+		{
+		    if (!commit)
+			throw new TransactionCommittedException();
+		}
+		break;
+	    case TwoPhaseResult.HEURISTIC_MIXED:
+		throw new HeuristicMixedException();
+	    case TwoPhaseResult.HEURISTIC_HAZARD:
+		throw new HeuristicHazardException();
+	    case TwoPhaseResult.FINISH_OK:
+		break;
+	    case TwoPhaseResult.FINISH_ERROR:
+	    default:
+		throw new HeuristicHazardException();
+	    }
+	}
+	else
+	    throw new HeuristicHazardException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx.model.as.twophase.UserTwoPhaseTx_3"));
+    }
+    
+    private UserCoordinator _theCoordinator;
+    
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,130 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wst.*;
+import com.arjuna.wst11.BAParticipantManager;
+import com.arjuna.mw.wst.TxContext;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * As with UserTransaction a TransactionManager does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread transaction context.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BusinessActivityManager.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class BusinessActivityManager
+{
+    /**
+     * The manager.
+     */
+    private static BusinessActivityManager MANAGER ;
+    
+    /**
+     * Get the business activity manager.
+     * @return The business activity manager.
+     */
+    public static synchronized BusinessActivityManager getBusinessActivityManager()
+    {
+        return MANAGER ;
+    }
+    
+    /**
+     * Set the business activity manager.
+     * @param manager The business activity manager.
+     */
+    public static synchronized void setBusinessActivityManager(final BusinessActivityManager manager)
+    {
+        MANAGER = manager ;
+    }
+
+    /**
+     * Enlist a participant for the BusinessAgreement protocol.
+     *
+     * @return the BAParticipantManager for this transaction.
+     */
+    public abstract BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion(
+        final BusinessAgreementWithParticipantCompletionParticipant bap, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * Enlist a participant for the BusinessAgreementWithCoordinatorCompletion protocol.
+     *
+     * @return the BAParticipantManager for this transaction.
+     */
+    public abstract BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion(
+        final BusinessAgreementWithCoordinatorCompletionParticipant bawcp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * The resume method can be used to (re-)associate a thread with a 
+     * transaction(s) via its TxContext. Prior to association, the thread is
+     * disassociated with any transaction(s) with which it may be currently
+     * associated. If the TxContext is null, then the thread is associated with
+     * no transaction. The UnknownTransactionException exception is thrown if
+     * the transaction that the TxContext refers to is invalid in the scope of
+     * the invoking thread.
+     */
+    public abstract void resume(final TxContext txContext)
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * A thread of control may require periods of non-transactionality so that
+     * it may perform work that is not associated with a specific transaction.
+     * In order to do this it is necessary to disassociate the thread from any
+     * transactions. The suspend method accomplishes this, returning a
+     * TxContext instance, which is a handle on the transaction. The thread is
+     * then no longer associated with any transaction.
+     */
+    public abstract TxContext suspend()
+        throws SystemException;
+    
+    /**
+     * The currentTransaction method returns the TxContext for the current
+     * transaction, or null if there is none. Unlike suspend, this method does
+     * not disassociate the current thread from the transaction(s). This can
+     * be used to enable multiple threads to execute within the scope of the
+     * same transaction.
+     */
+    public abstract TxContext currentTransaction()
+        throws SystemException;
+    
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/BusinessActivityManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManagerFactory.java,v 1.4.8.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+
+public class BusinessActivityManagerFactory
+{
+    public static BusinessActivityManager businessActivityManager ()
+    {
+        return BusinessActivityManager.getBusinessActivityManager() ;
+	}
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,142 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+import com.arjuna.wst.*;
+
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.mw.wst.TxContext;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * This could also be the interface that high-level users see (e.g., at the
+ * application Web Service).
+ *
+ * As with UserTransaction a TransactionManager does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread transaction context.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TransactionManager.java,v 1.10.6.1 2005/11/22 10:36:06 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class TransactionManager
+{
+    /**
+     * The manager.
+     */
+    private static TransactionManager TRANSACTION_MANAGER ;
+
+    /**
+     * Get the transaction manager.
+     * @return The transaction manager.
+     */
+    public static synchronized TransactionManager getTransactionManager()
+    {
+        return TRANSACTION_MANAGER ;
+    }
+
+    /**
+     * Set the transaction manager.
+     * @param manager The transaction manager.
+     */
+    public static synchronized void setTransactionManager(final TransactionManager manager)
+    {
+        TRANSACTION_MANAGER = manager ;
+    }
+
+    /**
+     * Enlist the specified participant with current transaction such that it
+     * will participate in the Volatile 2PC protocol; a unique identifier for
+     * the participant is also required. If there is no transaction associated
+     * with the invoking thread then the UnknownTransactionException exception
+     * is thrown. If the coordinator already has a participant enrolled with
+     * the same identifier, then AlreadyRegisteredException will be thrown. If
+     * the transaction is not in a state where participants can be enrolled
+     * (e.g., it is terminating) then WrongStateException will be thrown.
+     */
+    public abstract void enlistForVolatileTwoPhase(final Volatile2PCParticipant pzp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    /**
+     * Enlist the specified participant with current transaction such that it
+     * will participate in the 2PC protocol; a unique identifier for the
+     * participant is also required. If there is no transaction associated with
+     * the invoking thread then the UnknownTransactionException exception is
+     * thrown. If the coordinator already has a participant enrolled with the
+     * same identifier, then AlreadyRegisteredException will be thrown. If the
+     * transaction is not in a state where participants can be enrolled (e.g.,
+     * it is terminating) then WrongStateException will be thrown.
+     */
+    public abstract void enlistForDurableTwoPhase(final Durable2PCParticipant tpp, final String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException;
+
+    public abstract int replay () throws SystemException;
+
+    /**
+     * The resume method can be used to (re-)associate a thread with a
+     * transaction(s) via its TxContext. Prior to association, the thread is
+     * disassociated with any transaction(s) with which it may be currently
+     * associated. If the TxContext is null, then the thread is associated with
+     * no transaction. The UnknownTransactionException exception is thrown if
+     * the transaction that the TxContext refers to is invalid in the scope of
+     * the invoking thread.
+     */
+    public abstract void resume(final TxContext txContext)
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * A thread of control may require periods of non-transactionality so that
+     * it may perform work that is not associated with a specific transaction.
+     * In order to do this it is necessary to disassociate the thread from any
+     * transactions. The suspend method accomplishes this, returning a
+     * TxContext instance, which is a handle on the transaction. The thread is
+     * then no longer associated with any transaction.
+     */
+    public abstract TxContext suspend()
+        throws SystemException;
+
+    /**
+     * The currentTransaction method returns the TxContext for the current
+     * transaction, or null if there is none. Unlike suspend, this method does
+     * not disassociate the current thread from the transaction(s). This can
+     * be used to enable multiple threads to execute within the scope of the
+     * same transaction.
+     */
+    public abstract TxContext currentTransaction()
+        throws SystemException;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerFactory.java,v 1.8.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+
+public class TransactionManagerFactory
+{
+    public static TransactionManager transactionManager ()
+    {
+    	return TransactionManager.getTransactionManager() ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivity.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivity.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivity.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,126 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that allows BAs to be started and terminated.
+ * The messaging layer converts the messages into calls on this.
+ *
+ * Importantly, a UserBusinessActivity does not represent a specific
+ * transaction, but rather is responsible for providing access to an implicit
+ * per-thread  transaction context; it is similar to the UserTransaction in
+ * the JTA specification. Therefore, all of the UserTransaction methods
+ * implicitly act on the current thread of control.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserBusinessActivity.java,v 1.4.6.1 2005/11/22 10:36:06 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class UserBusinessActivity
+{
+    /**
+     * The user business activity.
+     */
+    private static UserBusinessActivity USER_BUSINESS_ACTIVITY ;
+
+    /**
+     * Get the user business activity.
+     * @return The user business activity.
+     */
+    public static synchronized UserBusinessActivity getUserBusinessActivity()
+    {
+        return USER_BUSINESS_ACTIVITY ;
+    }
+
+    /**
+     * Set the user business activity.
+     * @param userBusinessActivity The user business activity.
+     */
+    public static synchronized void setUserBusinessActivity(final UserBusinessActivity userBusinessActivity)
+    {
+        USER_BUSINESS_ACTIVITY = userBusinessActivity ;
+    }
+
+    public static final int ATOMIC_OUTCOME = 0;
+    public static final int MIXED_OUTCOME = 1;
+
+    /**
+     * Start a new business activity with atomic outcome.
+     * If one is already associated with this thread
+     * then the WrongStateException will be thrown. Upon success, this
+     * operation associates the newly created transaction with the current
+     * thread.
+     */
+    public abstract void begin()
+        throws WrongStateException, SystemException;
+
+    /**
+     * Start a new BA with atomic outcome and the specified timeout as
+     * its lifetime.
+     * If one is already associated with this thread then the
+     * WrongStateException will be thrown.
+     */
+    public abstract void begin(final int timeout)
+        throws WrongStateException, SystemException;
+
+    /**
+     * The BA is normally terminated by the close method. This signals to
+     * all registered participants that the BA has ended and no compensation
+     * is required.
+     */
+    public abstract void close()
+        throws TransactionRolledBackException, UnknownTransactionException, SystemException;
+
+    /**
+     * If the BA must undo its work then the cancel method is used. Any
+     * participants that can compensate are forced to do so.
+     */
+    public abstract void cancel()
+        throws UnknownTransactionException, SystemException;
+
+    /**
+     * If participants have registered for the BusinessAgreementWithComplete
+     * protocol then they will be expecting the application to inform them
+     * when all work intended for them has been sent (and responded to). The
+     * complete method is used for this purpose.
+     */
+    public abstract void complete()
+        throws UnknownTransactionException, SystemException;
+
+    public abstract String transactionIdentifier();
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivityFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivityFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserBusinessActivityFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivityFactory.java,v 1.4.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+import com.arjuna.mw.wst11.UserBusinessActivity;
+
+public class UserBusinessActivityFactory
+{
+    public static UserBusinessActivity userBusinessActivity ()
+    {
+        return UserBusinessActivity.getUserBusinessActivity() ;
+	}
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransaction.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,118 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ * Importantly, a UserTransaction does not represent a specific transaction,
+ * but rather is responsible for providing access to an implicit per-thread
+ * transaction context; it is similar to the UserTransaction in the JTA
+ * specification. Therefore, all of the UserTransaction methods implicitly act
+ * on the current thread of control.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTransaction.java,v 1.8.4.1 2005/11/22 10:36:05 kconner Exp $
+ * @since XTS 1.0.
+ */
+
+public abstract class UserTransaction
+{
+    /**
+     * The transaction.
+     */
+    private static UserTransaction USER_TRANSACTION ;
+
+    /**
+     * Get the user transaction.
+     * @return the user transaction.
+     */
+    public static synchronized UserTransaction getUserTransaction()
+    {
+        return USER_TRANSACTION ;
+    }
+
+    /**
+     * Set the user transaction.
+     * @param userTransaction The user transaction.
+     */
+    public static synchronized void setUserTransaction(final UserTransaction userTransaction)
+    {
+        USER_TRANSACTION = userTransaction ;
+    }
+
+    /**
+     * Start a new transaction. If one is already associated with this thread
+     * then the WrongStateException will be thrown. Upon success, this
+     * operation associates the newly created transaction with the current
+     * thread.
+     */
+    public abstract void begin()
+        throws WrongStateException, SystemException;
+
+    /**
+     * Start a new transaction with the specified timeout as its lifetime.
+     * If one is already associated with this thread then the
+     * WrongStateException will be thrown.
+     */
+    public abstract void begin(final int timeout)
+        throws WrongStateException, SystemException;
+
+    /**
+     * The transaction is committed by the commit method. This will execute
+     * the PhaseZero, 2PC and OutcomeNotification protocols prior to returning.
+     * If there is no transaction associated with the invoking thread then
+     * UnknownTransactionException is thrown. If the transaction ultimately
+     * rolls back then the TransactionRolledBackException is thrown. When
+     * complete, this operation disassociates the transaction from the current
+     * thread such that it becomes associated with no transaction.
+     */
+    public abstract void commit()
+        throws TransactionRolledBackException, UnknownTransactionException, SecurityException, SystemException;
+
+    /**
+     * The rollback operation will terminate the transaction and return
+     * normally if it succeeded, while throwing an appropriate exception if it
+     * didn't. If there is no transaction associated with the invoking thread
+     * then UnknownTransactionException is thrown.
+     */
+    public abstract void rollback()
+        throws UnknownTransactionException, SecurityException, SystemException;
+
+    public abstract String transactionIdentifier ();
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,41 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionFactory.java,v 1.9.8.1 2005/11/22 10:36:05 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11;
+
+
+public class UserTransactionFactory
+{
+    public static UserTransaction userTransaction ()
+    {
+        return UserTransaction.getUserTransaction() ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxBaseHeaderContextProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxBaseHeaderContextProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxBaseHeaderContextProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.client;
+
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mw.wst.*;
+import com.arjuna.mw.wst.common.SOAPUtil;
+import com.arjuna.mw.wst11.common.CoordinationContextHelper;
+import com.arjuna.mw.wst11.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.TransactionManagerFactory;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.soap.*;
+import java.util.Iterator;
+
+/**
+ * Common base class for classes used to perform
+ * WS-Transaction context manipulation on SOAP messages.
+ *
+ * @message com.arjuna.mw.wst11.client.JaxHC11P_1 [com.arjuna.mw.wst11.client.JaxHC11P_1] - Error in:
+ * @message com.arjuna.mw.wst11.client.JaxHC11P_2 [com.arjuna.mw.wst11.client.JacHCP_2] - Stack trace:
+ */
+class JaxBaseHeaderContextProcessor
+{
+    /**
+     * Handle the request.
+     * @param soapMessage The current message context.
+     */
+
+    public boolean handleOutboundMessage(final SOAPMessage soapMessage)
+    {
+        if (soapMessage == null)
+        {
+            return true ;
+        }
+
+        try
+        {
+            /*
+             * There should either be an Atomic Transaction *or* a Business Activity
+             * associated with the thread.
+             */
+            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
+            final com.arjuna.mw.wst11.BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
+
+            final Context atContext ;
+            if (transactionManager != null)
+            {
+                final TxContextImple txContext =
+                    (TxContextImple)transactionManager.currentTransaction() ;
+                atContext = (txContext == null ? null : txContext.context()) ;
+            }
+            else
+            {
+                atContext = null ;
+            }
+
+            final Context baContext ;
+            if (businessActivityManager != null)
+            {
+                final com.arjuna.mwlabs.wst11.ba.context.TxContextImple txContext =
+                    (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)businessActivityManager.currentTransaction() ;
+                baContext = (txContext == null ? null : txContext.context()) ;
+            }
+            else
+            {
+                baContext = null ;
+            }
+
+            final CoordinationContextType coordinationContext ;
+            if (atContext != null)
+            {
+                coordinationContext = atContext.getCoordinationContext() ;
+            }
+            else if (baContext != null)
+            {
+                coordinationContext = baContext.getCoordinationContext() ;
+            }
+            else
+            {
+                coordinationContext = null ;
+            }
+
+            if (coordinationContext != null)
+            {
+                final SOAPEnvelope env = soapMessage.getSOAPPart().getEnvelope() ;
+                SOAPHeader header = env.getHeader() ;
+                if (header == null)
+                {
+                    header = env.addHeader() ;
+                }
+                final Name name = env.createName(CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT, CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE) ;
+                final SOAPHeaderElement headerElement = header.addHeaderElement(name) ;
+                headerElement.addNamespaceDeclaration(CoordinationConstants.WSCOOR_PREFIX, CoordinationConstants.WSCOOR_NAMESPACE) ;
+                headerElement.setMustUnderstand(true) ;
+                CoordinationContextHelper.serialise(coordinationContext, headerElement) ;
+            }
+        }
+        catch (final Throwable th)
+        {
+	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_1",
+					  new Object[]{"com.arjuna.mw.wst11.client.JaxBaseHeaderContextProcessor.handleRequest()"});
+
+	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_2",
+					  new Object[]{th});
+
+            th.printStackTrace(System.err) ;
+        }
+
+        return true ;
+    }
+
+    /**
+     * Resume the current transaction.
+     *
+     * @message com.arjuna.mw.wst11.client.JaxHC11P_3 [com.arjuna.mw.wst11.client.JaxHC11P_3] - Unknown context type:
+     */
+
+    protected void resumeTransaction(final SOAPMessage soapMessage)
+    {
+        if (soapMessage != null)
+        {
+            try
+            {
+                final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope() ;
+                final SOAPHeaderElement soapHeaderElement = getHeaderElement(soapEnvelope, CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;
+
+                if (soapHeaderElement != null)
+                {
+                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;
+                    if (cc != null)
+                    {
+                        final String coordinationType = cc.getCoordinationType() ;
+                        if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
+                        {
+                            final TxContext txContext = new TxContextImple(cc) ;
+                            TransactionManagerFactory.transactionManager().resume(txContext) ;
+                        }
+                        else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationType))
+                        {
+                            final TxContext txContext = new com.arjuna.mwlabs.wst11.ba.context.TxContextImple(cc);
+                            BusinessActivityManagerFactory.businessActivityManager().resume(txContext) ;
+                        }
+                        else
+                        {
+            			    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_1",
+    			                new Object[]{"com.arjuna.mw.wst11.client.JaxBaseHeaderContextProcessor.resumeTransaction()"});
+
+            			    wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_3",
+                                new Object[]{coordinationType});
+                        }
+                    }
+                }
+            }
+            catch (final Throwable th)
+            {
+        		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_1",
+                    new Object[]{"com.arjuna.mw.wst11.client.JaxBaseHeaderContextProcessor.resumeTransaction()"});
+
+        		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.client.JaxHC11P_2",
+                    new Object[]{th});
+            }
+        }
+    }
+
+    /**
+     * Retrieve the first header matching the uri and name.
+     * @param soapEnvelope The soap envelope containing the header.
+     * @param uri The uri of the header element.
+     * @param name The name of the header element.
+     * @return The header element or null if not found.
+     */
+    private SOAPHeaderElement getHeaderElement(final SOAPEnvelope soapEnvelope, final String uri, final String name)
+        throws SOAPException
+    {
+        final SOAPHeader soapHeader = soapEnvelope.getHeader() ;
+        if (soapHeader != null)
+        {
+            final Iterator headerIter = SOAPUtil.getChildElements(soapHeader) ;
+            while(headerIter.hasNext())
+            {
+                final SOAPHeaderElement current = (SOAPHeaderElement)headerIter.next() ;
+                final Name currentName = current.getElementName() ;
+                if ((currentName != null) &&
+                    match(name, currentName.getLocalName()) &&
+                    match(uri, currentName.getURI()))
+                {
+                    return current ;
+                }
+            }
+        }
+        return null ;
+    }
+
+    /**
+     * Do the two references match?
+     * @param lhs The first reference.
+     * @param rhs The second reference.
+     * @return true if the references are both null or if they are equal.
+     */
+    private boolean match(final Object lhs, final Object rhs)
+    {
+        if (lhs == null)
+        {
+            return (rhs == null) ;
+        }
+        else
+        {
+            return lhs.equals(rhs) ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxWSHeaderContextProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxWSHeaderContextProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/client/JaxWSHeaderContextProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.client;
+
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.mw.wst11.client.JaxBaseHeaderContextProcessor;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * The class is used to perform WS-Transaction context insertion
+ * and extraction for application level SOAP messages using JaxWS.
+ * This is the client side version.
+ */
+public class JaxWSHeaderContextProcessor extends JaxBaseHeaderContextProcessor implements SOAPHandler<SOAPMessageContext>
+{
+    /**
+     * Process a message. Determines if it is inbound or outbound and dispatches accordingly.
+     *
+     * @param msgContext
+     * @return true
+     */
+    public boolean handleMessage(SOAPMessageContext msgContext)
+    {
+        Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+        if (outbound == null)
+            throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+        return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+    }
+
+    /**
+     * Tidy up the Transaction/Thread association.
+     *
+     * @param messageContext
+     * @return true
+     */
+    public boolean handleFault(SOAPMessageContext messageContext)
+    {
+        final SOAPMessageContext soapMessageContext = (SOAPMessageContext)messageContext ;
+        final SOAPMessage soapMessage = soapMessageContext.getMessage() ;
+
+        resumeTransaction(soapMessage);
+        return true;
+    }
+
+    public void close(MessageContext messageContext)
+    {
+    }
+
+    /**
+     * Gets the header blocks that can be processed by this Handler instance.
+     */
+    public Set<QName> getHeaders()
+    {
+        Set<QName> headerSet = new HashSet<QName>();
+        headerSet.add(new QName(CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT));
+
+        return headerSet;
+    }
+
+    /**
+     * Sets the header blocks that can be processed by this Handler instance.
+     * Note: this impl ignores this function's args as the values are hardcoded.
+     */
+    public void setHeaders(Set headers)
+    {
+    }
+
+    /**
+     * Tidy up the Transaction/Thread association before control is returned to the user.
+     *
+     * @param messageContext
+     * @return true
+     */
+    protected boolean handleInbound(SOAPMessageContext messageContext)
+    {
+        final SOAPMessage soapMessage = messageContext.getMessage() ;
+
+        resumeTransaction(soapMessage);
+        return true ;
+    }
+
+    /**
+     * Process the tx thread context and attach serialized version as msg header
+     *
+     * @param messageContext
+     * @return true
+     */
+    protected boolean handleOutbound(SOAPMessageContext messageContext)
+    {
+        final SOAPMessage soapMessage = messageContext.getMessage() ;
+
+        return handleOutboundMessage(soapMessage);
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/CoordinationContextHelper.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/CoordinationContextHelper.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/CoordinationContextHelper.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,76 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.common;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.w3c.dom.Element;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLStreamException;
+
+/**
+ * Helper class for serialising Coordination Contexts into SOAP headers.
+ * @author kevin
+ */
+public class CoordinationContextHelper
+{
+   /**
+     * Deserialise a coordination context from a DOM SOAP Header Element.
+     * @param headerElement The SOAP header element to deserialise.
+     * @return The coordination context.
+     * @throws javax.xml.stream.XMLStreamException for errors during parsing.
+     */
+    public static CoordinationContextType deserialise(final Element headerElement)
+        throws JAXBException
+    {
+        try {
+            JAXBContext jaxbContext = JAXBContext.newInstance("org.oasis_open.docs.ws_tx.wscoor._2006._06");
+            Unmarshaller unmarshaller;
+            unmarshaller = jaxbContext.createUnmarshaller();
+            CoordinationContextType coordinationContextType = unmarshaller.unmarshal(headerElement.getFirstChild(), CoordinationContextType.class).getValue();
+
+            return coordinationContextType;
+        } catch (JAXBException jaxbe) {
+            return null;
+        }
+    }
+
+    /**
+      * Deserialise a coordination context from a DOM SOAP Header Element.
+      * @param headerElement The SOAP header element to deserialise.
+      * @return The coordination context.
+      * @throws javax.xml.stream.XMLStreamException for errors during parsing.
+      */
+    public static void serialise(final CoordinationContextType  coordinationContextType, Element headerElement)
+        throws JAXBException
+    {
+        try {
+            JAXBContext jaxbContext = JAXBContext.newInstance("org.oasis_open.docs.ws_tx.wscoor._2006._06");
+            Marshaller marshaller;
+            marshaller = jaxbContext.createMarshaller();
+            marshaller.marshal(coordinationContextType, headerElement);
+        } catch (JAXBException jaxbe) {
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/common/Environment.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,42 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Environment.java,v 1.6 2004/09/09 08:48:48 kconner Exp $
+ */
+
+package com.arjuna.mw.wst11.common;
+
+/**
+ */
+
+public interface Environment
+{
+
+    public static final String COORDINATOR_URL = "com.arjuna.mw.wst11.coordinatorURL";
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,200 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.deploy;
+
+import com.arjuna.mw.wsas.utils.Configuration;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.services.framework.startup.Sequencer;
+import com.arjuna.webservices.util.ClassLoaderHelper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+
+/**
+ * Initialise WSTX.
+ * @author kevin
+ */
+public class WSTXInitialisation implements ServletContextListener
+{
+    /**
+     * The name of the WS-T configuration.
+     */
+    private static final String WS_T11_CONFIG = "/wst11.xml" ;
+
+    /**
+     * The context has been initialized.
+     * @param servletContextEvent The servlet context event.
+     *
+     * @message com.arjuna.mw.wst11.deploy.WSTXI_1 [com.arjuna.mw.wst11.deploy.WSTXI_1] - WSTX11 Initialisation: init failed:
+     */
+    public void contextInitialized(final ServletContextEvent servletContextEvent)
+    {
+        final WSTXInitialisation listener = this;
+
+        Sequencer.Callback callback = new Sequencer.Callback(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSTX11) {
+           public void run() {
+               try
+               {
+                   Configuration.initialise("/wstx11.xml");
+
+                   listener.configure();
+                   // Start recovery
+//            RecoveryManager.manager() ;
+               }
+               catch (Exception exception)
+               {
+                   wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst11.deploy.WSTXI_1", exception);
+               }
+               catch (Error error)
+               {
+                   wstxLogger.arjLoggerI18N.error("com.arjuna.mw.wst11.deploy.WSTXI_21", error);
+               }
+           }
+        };
+        // this is the last WST callback to be initialised so close the list
+        Sequencer.close(Sequencer.SEQUENCE_WSCOOR11, Sequencer.WEBAPP_WSTX11);
+    }
+
+    /**
+     * Configure WS-T.
+     *
+     * @message com.arjuna.mw.wst11.deploy.WSTXI_21 [com.arjuna.mw.wst11.deploy.WSTXI_21] - {0} not found.
+     * @message com.arjuna.mw.wst11.deploy.WSTXI_22 [com.arjuna.mw.wst11.deploy.WSTXI_22] - Failed to create document: {0}
+     * @message com.arjuna.mw.wst11.deploy.WSTXI_23 [com.arjuna.mw.wst11.deploy.WSTXI_23] - Missing WSTX Initialisation
+     */
+    private void configure()
+        throws Exception
+    {
+        // mostly original JNDI binder code.  Should be tidied up.
+        final InputStream is = ClassLoaderHelper.getResourceAsStream(getClass(), WS_T11_CONFIG) ;
+
+        if (is == null)
+        {
+            final String pattern = wstxLogger.log_mesg.getString("com.arjuna.mw.wst11.deploy.WSTXI_21") ;
+            throw new FileNotFoundException(MessageFormat.format(pattern, new Object[] {WS_T11_CONFIG}));
+        }
+
+        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
+        final DocumentBuilder builder = factory.newDocumentBuilder() ;
+        final Document doc = builder.parse(is);
+
+        if (doc == null)
+        {
+            final String pattern = wstxLogger.log_mesg.getString("com.arjuna.mw.wst11.deploy.WSTXI_22") ;
+            throw new FileNotFoundException(MessageFormat.format(pattern, new Object[] {WS_T11_CONFIG}));
+        }
+
+        final Element docElem = doc.getDocumentElement() ;
+        final String userTx = getService(docElem, "UserTransaction") ;
+        final String txManager = getService(docElem, "TransactionManager") ;
+        final String userBa = getService(docElem, "UserBusinessActivity") ;
+        final String baManager = getService(docElem, "BusinessActivityManager") ;
+
+        if ((userTx == null) || (txManager == null) || (userBa == null) || (baManager == null))
+        {
+            throw new FileNotFoundException(wstxLogger.log_mesg.getString("com.arjuna.mw.wst11.deploy.WSTXI_23"));
+        }
+        UserTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userTx).newInstance()) ;
+        TransactionManager.setTransactionManager((TransactionManager)ClassLoaderHelper.forName(getClass(), txManager).newInstance()) ;
+        UserBusinessActivity.setUserBusinessActivity((UserBusinessActivity)ClassLoaderHelper.forName(getClass(), userBa).newInstance()) ;
+        // we only have one choice for the 1.1 business activity manager
+        // BusinessActivityManager.setBusinessActivityManager(BusinessActivityManagerImple.class.newInstance());
+        BusinessActivityManager.setBusinessActivityManager((BusinessActivityManager)ClassLoaderHelper.forName(getClass(), baManager).newInstance());
+    }
+
+    /**
+     * Get the specified service.
+     * @param root The root element.
+     * @param name The name of the service.
+     * @return The service name or null if not present.
+     */
+    private static String getService(final Node root, final String name)
+    {
+        final NodeList children = root.getChildNodes();
+
+        for (int i = 0; i < children.getLength(); i++)
+        {
+            final Node item = children.item(i) ;
+
+            if ("service".equals(item.getNodeName()))
+            {
+                final Element type = (Element)item;
+
+                if (name.equals(type.getAttribute("name")))
+                {
+                    return getImplementation(type);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Get the specified service.
+     * @param service The service element.
+     * @return The service name or null if not present.
+     */
+    private static String getImplementation(final Node service)
+    {
+        final NodeList children = service.getChildNodes();
+
+        for (int i = 0; i < children.getLength(); i++)
+        {
+            final Node item = children.item(i);
+
+            if ("parameter".equals(item.getNodeName()))
+            {
+                final Element type = (Element)item;
+
+                if ("className".equals(type.getAttribute("name")))
+                {
+                    return type.getAttribute("value");
+                }
+            }
+        }
+
+        return null;
+    }
+
+
+    /**
+     * The context is about to be destroyed.
+     * @param servletContextEvent The servlet context event.
+     */
+    public void contextDestroyed(final ServletContextEvent servletContextEvent)
+    {
+//        RecoveryManager.manager().stop() ;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxBaseHeaderContextProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxBaseHeaderContextProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxBaseHeaderContextProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.service;
+
+import com.arjuna.mw.wst.*;
+import com.arjuna.mw.wst11.common.CoordinationContextHelper;
+import com.arjuna.mw.wst.common.SOAPUtil;
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.TransactionManagerFactory;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.soap.*;
+import java.util.Iterator;
+
+/**
+ * Common base class for classes used to perform
+ * WS-Transaction context manipulation on SOAP messages.
+ *
+ * @message com.arjuna.mw.wst11.service.JaxHC11P_1 [com.arjuna.mw.wst11.service.JaxHC11P_1] - Error in:
+ * @message com.arjuna.mw.wst11.service.JaxHC11P_2 [com.arjuna.mw.wst11.service.JaxHC11P_2] - Stack trace:
+ * @message com.arjuna.mw.wst11.service.JaxHC11P_3 [com.arjuna.mw.wst11.service.JaxHC11P_3] - Unknown context type:
+ */
+class JaxBaseHeaderContextProcessor
+{
+    /**
+     * Handle the request.
+     * @param soapMessage The current message context.
+     */
+    protected boolean handleInboundMessage(final SOAPMessage soapMessage)
+    {
+        if (soapMessage != null)
+        {
+            try
+            {
+                final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope() ;
+                final SOAPHeader soapHeader = soapEnvelope.getHeader() ;
+                final SOAPHeaderElement soapHeaderElement = getHeaderElement(soapHeader, CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;
+
+                if (soapHeaderElement != null)
+                {
+                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;
+                    final String coordinationType = cc.getCoordinationType();
+                    if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
+                    {
+                        final TxContext txContext = new TxContextImple(cc) ;
+                        TransactionManagerFactory.transactionManager().resume(txContext) ;
+                        clearMustUnderstand(soapHeader, soapHeaderElement) ;
+                    }
+                    else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationType))
+                    {
+                        final TxContext txContext = new com.arjuna.mwlabs.wst11.ba.context.TxContextImple(cc);
+                        BusinessActivityManagerFactory.businessActivityManager().resume(txContext) ;
+                        clearMustUnderstand(soapHeader, soapHeaderElement) ;
+                    }
+                    else
+                    {
+                        wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_1",
+                                new Object[]{"com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor.handleRequest(MessageContext context)"});
+
+                        wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_3",
+                                new Object[]{coordinationType});
+                    }
+                }
+            }
+            catch (final Throwable th)
+            {
+                wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_1",
+                        new Object[]{"com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor.handleRequest(MessageContext context)"});
+
+                wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_2",
+                        new Object[]{th});
+            }
+        }
+        return true ;
+    }
+
+    /**
+     * Suspend the current transaction.
+     */
+    protected void suspendTransaction()
+    {
+        try
+        {
+            /*
+             * There should either be an Atomic Transaction *or* a Business Activity
+             * associated with the thread.
+             */
+            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
+            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
+
+            if (transactionManager != null)
+            {
+                transactionManager.suspend() ;
+            }
+
+            if (businessActivityManager != null)
+            {
+                businessActivityManager.suspend() ;
+            }
+        }
+        catch (final Throwable th)
+        {
+            wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_1",
+                    new Object[]{"com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor.suspendTransaction()"});
+
+            wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wst11.service.JaxHC11P_2",
+                    new Object[]{th});
+
+            th.printStackTrace(System.err) ;
+        }
+    }
+
+    /**
+     * Clear the soap MustUnderstand.
+     * @param soapHeader The SOAP header.
+     * @param soapHeaderElement The SOAP header element.
+     */
+    private void clearMustUnderstand(final SOAPHeader soapHeader, final SOAPHeaderElement soapHeaderElement)
+            throws SOAPException
+    {
+        final Name headerName = soapHeader.getElementName() ;
+
+        final SOAPFactory factory = SOAPFactory.newInstance() ;
+        final Name attributeName = factory.createName("mustUnderstand", headerName.getPrefix(), headerName.getURI()) ;
+
+        soapHeaderElement.removeAttribute(attributeName) ;
+    }
+
+    private SOAPHeaderElement getHeaderElement(final SOAPHeader soapHeader, final String uri, final String name)
+            throws SOAPException
+    {
+        if (soapHeader != null)
+        {
+            final Iterator headerIter = SOAPUtil.getChildElements(soapHeader) ;
+            while(headerIter.hasNext())
+            {
+                final SOAPHeaderElement current = (SOAPHeaderElement)headerIter.next() ;
+                final Name currentName = current.getElementName() ;
+                if ((currentName != null) &&
+                        match(name, currentName.getLocalName()) &&
+                        match(uri, currentName.getURI()))
+                {
+                    return current ;
+                }
+            }
+        }
+        return null ;
+    }
+
+    /**
+     * Do the two references match?
+     * @param lhs The first reference.
+     * @param rhs The second reference.
+     * @return true if the references are both null or if they are equal.
+     */
+    private boolean match(final Object lhs, final Object rhs)
+    {
+        if (lhs == null)
+        {
+            return (rhs == null) ;
+        }
+        else
+        {
+            return lhs.equals(rhs) ;
+        }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/service/JaxWSHeaderContextProcessor.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
+ * See the copyright.txt in the distribution for a full listing
+ * of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License, v. 2.0.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2007,
+ * @author JBoss Inc.
+ */
+package com.arjuna.mw.wst11.service;
+
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPHandler;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * The class is used to perform WS-Transaction context insertion
+ * and extraction for application level SOAP messages using JaxWS.
+ * This is the server side version.
+ */
+public class JaxWSHeaderContextProcessor extends JaxBaseHeaderContextProcessor implements SOAPHandler<SOAPMessageContext>
+{
+    /**
+     * Process a message. Determines if it is inbound or outbound and dispatches accordingly.
+     *
+     * @param msgContext
+     * @return true
+     */
+    public boolean handleMessage(SOAPMessageContext msgContext)
+    {
+        Boolean outbound = (Boolean)msgContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+        if (outbound == null)
+            throw new IllegalStateException("Cannot obtain required property: " + MessageContext.MESSAGE_OUTBOUND_PROPERTY);
+
+        return outbound ? handleOutbound(msgContext) : handleInbound(msgContext);
+    }
+
+    /**
+     * Tidy up the Transaction/Thread association before faults are thrown back to the client.
+     *
+     * @param messageContext
+     * @return true
+     */
+    public boolean handleFault(SOAPMessageContext messageContext)
+    {
+        suspendTransaction() ;
+        return true;
+    }
+
+    public void close(MessageContext messageContext)
+    {
+    }
+
+    /**
+     * Gets the header blocks that can be processed by this Handler instance.
+     */
+    public Set<QName> getHeaders()
+    {
+        Set<QName> headerSet = new HashSet<QName>();
+        headerSet.add(new QName(CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT));
+
+        return headerSet;
+    }
+
+    /**
+     * Sets the header blocks that can be processed by this Handler instance.
+     * Note: this impl ignores this function's args as the values are hardcoded.
+     */
+    public void setHeaders(Set headers)
+    {
+    }
+
+
+    /**
+     * Process the tx context header that is attached to the received message.
+     *
+     * @param msgContext
+     * @return true
+     */
+    protected boolean handleInbound(SOAPMessageContext msgContext)
+    {
+        final SOAPMessageContext soapMessageContext = (SOAPMessageContext)msgContext ;
+        final SOAPMessage soapMessage = soapMessageContext.getMessage() ;
+
+        return handleInboundMessage(soapMessage);
+    }
+
+    /**
+     * Tidy up the Transaction/Thread association before response is returned to the client.
+     *
+     * @param messageContext The current message context.
+     * @return true
+     */
+    protected boolean handleOutbound(SOAPMessageContext messageContext)
+    {
+        suspendTransaction() ;
+        return true;
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/TransactionManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/TransactionManagerFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/TransactionManagerFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,166 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ */
+
+package com.arjuna.mw.wstx11;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.common.TransactionXSD;
+import com.arjuna.mw.wstx.TransactionManager;
+
+import com.arjuna.mw.wscf11.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+import com.arjuna.mwlabs.wstx11.model.as.twophase.TwoPhaseTxManager;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+/**
+ * This class is used to obtain the TransactionManager implementation to
+ * use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TransactionManagerFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class TransactionManagerFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wstx11.TransactionManagerFactory_1 [com.arjuna.mw.wstx11.TransactionManagerFactory_1] - Failed to create document:
+     */
+
+    public static TransactionManager transactionManager () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(TwoPhaseTxManager.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx11.TransactionManagerFactory_1",
+					      new Object[]{TwoPhaseTxManager.class.getName()});
+	    }
+	    else
+	    {
+		if (!_protocolManager.present(doc))
+		    _protocolManager.addProtocol(doc, TwoPhaseTxManager.class.getName());
+
+		return transactionManager(doc);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static TransactionManager transactionManager (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
+		String protocolType = child.getNodeValue();
+		TransactionManager tx = (TransactionManager) _implementations.get(protocolType);
+
+		if (tx == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class txImpl = Class.forName((String) implementation);
+
+			tx = (TransactionManager) txImpl.newInstance();
+		    }
+		    else
+			tx = (TransactionManager) implementation;
+
+		    _implementations.put(protocolType, tx);
+		}
+
+		return tx;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/UserTransactionFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/UserTransactionFactory.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wstx11/UserTransactionFactory.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,165 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ */
+
+package com.arjuna.mw.wstx11;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.common.TransactionXSD;
+import com.arjuna.mw.wstx.UserTransaction;
+
+import com.arjuna.mw.wscf11.protocols.*;
+import com.arjuna.mw.wscf.utils.*;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+import com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+import java.util.HashMap;
+
+/**
+ * Return the UserTransaction implementation to use.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTransactionFactory.java,v 1.5 2005/03/10 15:37:12 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class UserTransactionFactory
+{
+
+    /**
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the default
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use. The default
+     * coordination protocol is used (two-phase commit) with its
+     * associated implementation.
+     *
+     * @message com.arjuna.mw.wstx11.UserTransactionFactory_1 [com.arjuna.mw.wstx11.UserTransactionFactory_1] - Failed to create document:
+     */
+
+    public static UserTransaction userTransaction () throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    ProtocolLocator pl = new ProtocolLocator(UserTwoPhaseTx.class);
+	    org.w3c.dom.Document doc = pl.getProtocol();
+
+	    if (doc == null)
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mw.wstx11.UserTransactionFactory_1",
+					      new Object[]{UserTwoPhaseTx.class.getName()});
+	    }
+	    else
+	    {
+		if (!_protocolManager.present(doc))
+		    _protocolManager.addProtocol(doc, UserTwoPhaseTx.class.getName());
+
+		return userTransaction(doc);
+	    }
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+
+	return null;
+    }
+
+    /**
+     * Obtain a reference to a coordinator that implements the specified
+     * protocol.
+     *
+     * @param protocol The XML definition of the type of
+     * coordination protocol required.
+     *
+     * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
+     * protocol is not available.
+     *
+     * @return the UserCoordinator implementation to use.
+     */
+
+    /*
+     * Have the type specified in XML. More data may be specified, which
+     * can be passed to the implementation in the same way ObjectName was.
+     */
+
+    public static UserTransaction userTransaction (org.w3c.dom.Document protocol) throws ProtocolNotRegisteredException, SystemException
+    {
+	try
+	{
+	    synchronized (_implementations)
+	    {
+		org.w3c.dom.Text child = DomUtil.getTextNode(protocol, TransactionXSD.transactionType);
+		String protocolType = child.getNodeValue();
+		UserTransaction tx = (UserTransaction) _implementations.get(protocolType);
+
+		if (tx == null)
+		{
+		    Object implementation = _protocolManager.getProtocolImplementation(protocol);
+
+		    if (implementation instanceof String)
+		    {
+			Class txImpl = Class.forName((String) implementation);
+
+			tx = (UserTransaction) txImpl.newInstance();
+		    }
+		    else
+			tx = (UserTransaction) implementation;
+
+		    _implementations.put(protocolType, tx);
+		}
+
+		return tx;
+	    }
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    throw ex;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private static ProtocolManager _protocolManager = ProtocolRegistry.sharedManager();
+    private static HashMap         _implementations = new HashMap();
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,280 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextFactoryImple.java,v 1.16.4.1 2005/11/22 10:36:21 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.at;
+
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.coordinator.LocalFactory;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorControl;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.CoordinatorServiceImple;
+import com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple;
+import com.arjuna.mwlabs.wst11.at.participants.CleanupSynchronization;
+import com.arjuna.mwlabs.wst11.at.RegistrarImple;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.ContextFactory;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc.InvalidProtocolException;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+public class ContextFactoryImple implements ContextFactory, LocalFactory
+{
+	public ContextFactoryImple()
+	{
+		try
+		{
+			_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+            _theRegistrar = new RegistrarImple();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	/**
+	 * Called when a context factory is added to a context factory mapper. This
+	 * method will be called multiple times if the context factory is added to
+	 * multiple context factory mappers or to the same context mapper with
+	 * different protocol identifiers.
+	 *
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 */
+	public void install(final String coordinationTypeURI)
+	{
+	}
+
+	// TODO interposition
+
+	/*
+	 * If there is a context passed through to create then this newly created
+	 * coordinator should be interposed.
+	 */
+
+	/**
+	 * Creates a coordination context.
+	 *
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 * @param expires
+	 *            the expire date/time for the returned context, can be null
+	 * @param currentContext
+	 *            the current context, can be null
+	 *
+	 * @return the created coordination context
+	 *
+	 * @throws com.arjuna.wsc.InvalidCreateParametersException
+	 *             if a parameter passed is invalid this activity identifier.
+	 *
+	 * @message com.arjuna.mwlabs.wst.at.Context11FactoryImple_1
+	 *          [com.arjuna.mwlabs.wst.at.Context11FactoryImple_1] - Invalid type
+	 *          URI: < {0} , {1} >
+	 * @message com.arjuna.mwlabs.wst.at.Context11FactoryImple_3
+	 *          [com.arjuna.mwlabs.wst.at.Context11FactoryImple_3] - Invalid type
+	 *          URI:
+	 */
+
+	public CoordinationContext create (final String coordinationTypeURI, final Long expires,
+            final CoordinationContextType currentContext)
+			throws InvalidCreateParametersException
+	{
+		if (coordinationTypeURI.equals(AtomicTransactionConstants.WSAT_PROTOCOL))
+		{
+			try
+			{
+				// make sure no transaction is currently associated
+
+				_coordManager.suspend();
+
+				final int timeout ;
+                if (expires == null)
+                {
+                    timeout = 0 ;
+                }
+                else
+                {
+                    final long timeoutVal = expires.longValue() ;
+                    timeout = (timeoutVal > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)timeoutVal) ;
+                }
+
+				_coordManager.begin(timeout);
+
+                final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
+                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+                final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
+
+                final CoordinationContext coordinationContext = new CoordinationContext() ;
+                coordinationContext.setCoordinationType(coordinationTypeURI);
+                CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
+                identifier.setValue("urn:"+arjunaContext.getTransactionIdentifier());
+                coordinationContext.setIdentifier(identifier) ;
+                final int transactionExpires = arjunaContext.getTransactionExpires();
+                if (transactionExpires > 0)
+                {
+                    Expires expiresInstance = new Expires();
+                    expiresInstance.setValue(transactionExpires);
+                    coordinationContext.setExpires(expiresInstance);
+                }
+                W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, arjunaContext);
+                coordinationContext.setRegistrationService(registrationCoordinator) ;
+
+				/*
+				 * Now add the registrar for this specific coordinator to the
+				 * mapper.
+				 */
+
+				_coordManager.enlistSynchronization(new CleanupSynchronization(_coordManager.identifier().toString(), _theRegistrar));
+
+				/*
+				 * TODO Uughh! This does a suspend for us! Left over from original
+				 * WS-AS stuff.
+				 *
+				 * TODO
+				 * REFACTOR, REFACTOR, REFACTOR.
+				 */
+
+				_theRegistrar.associate();
+
+				return coordinationContext;
+			}
+			catch (NoActivityException ex)
+			{
+				ex.printStackTrace();
+
+				throw new InvalidCreateParametersException();
+			}
+			catch (SystemException ex)
+			{
+				ex.printStackTrace();
+            }
+			catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+			{
+				ex.printStackTrace();
+
+				throw new InvalidCreateParametersException();
+			}
+			catch (Exception ex)
+			{
+				// TODO handle properly
+
+				ex.printStackTrace();
+			}
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.Context11FactoryImple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, coordinationTypeURI });
+
+			throw new InvalidCreateParametersException(
+					wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.Context11FactoryImple_3")
+							+ " < "
+							+ AtomicTransactionConstants.WSAT_PROTOCOL
+							+ ", "
+							+ coordinationTypeURI + " >");
+		}
+
+		return null;
+	}
+
+    private static W3CEndpointReference getRegistrationCoordinator(String registrationCoordinatorURI, ArjunaContextImple arjunaContext) {
+        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(CoordinationConstants.REGISTRATION_SERVICE_QNAME);
+        builder.endpointName(CoordinationConstants.REGISTRATION_ENDPOINT_QNAME);
+        // strictly we shouldn't need to set the address because we are in the same web app as the
+        // coordinator but we have to as the W3CEndpointReference implementation is incomplete
+        builder.address(registrationCoordinatorURI);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
+        W3CEndpointReference registrationCoordinator = builder.build();
+        return registrationCoordinator;
+    }
+
+    /**
+	 * Called when a context factory is removed from a context factory mapper.
+	 * This method will be called multiple times if the context factory is
+	 * removed from multiple context factory mappers or from the same context
+	 * factory mapper with different coordination type uris.
+	 *
+	 * @param coordinationTypeURI
+	 *            the coordination type uri
+	 */
+
+	public void uninstall (final String coordinationTypeURI)
+	{
+		// we don't use this as one implementation is registered per type
+	}
+
+	public final Object createSubordinate () throws NoActivityException, InvalidProtocolException, SystemException
+	{
+		try
+		{
+			CoordinatorServiceImple coordManager = (CoordinatorServiceImple) _coordManager;
+			CoordinatorControl theControl = coordManager.coordinatorControl();
+			ACCoordinator subordinateTransaction = theControl.createSubordinate();
+
+			/*
+			 * Now add the registrar for this specific coordinator to the
+			 * mapper.
+			 */
+
+			subordinateTransaction.enlistSynchronization(new CleanupSynchronization(subordinateTransaction.get_uid().stringForm(), _theRegistrar));
+
+			_theRegistrar.associate(subordinateTransaction);
+
+			return subordinateTransaction;
+		}
+		catch (Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	public final RegistrarImple registrar ()
+	{
+		return _theRegistrar;
+	}
+
+	private CoordinatorManager _coordManager;
+	private RegistrarImple _theRegistrar;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,50 @@
+package com.arjuna.mwlabs.wst11.at;
+
+import com.arjuna.mw.wsc11.context.Context;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+/*
+ * this is created and managed using a JaxWS coordination context but it will interconvert to an old style context
+ * on demand, allowing interoperation between JaxWS based activator/ergistrator and the old style
+ * BA/AT participant services
+ */
+
+public class ContextImple implements Context
+{
+
+	public ContextImple(final CoordinationContextType ctx)
+	{
+		_coordContext = ctx;
+    }
+
+	public boolean equals (Object obj)
+	{
+		if (obj instanceof ContextImple)
+		{
+			ContextImple ci = (ContextImple) obj;
+
+			return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
+		}
+		else
+			return false;
+	}
+
+	public String toString ()
+	{
+		// return DomUtil.nodeAsString(toXML());
+
+		return "AtomicTransactionIdentifier: " + _coordContext.getIdentifier().getValue();
+	}
+
+    public CoordinationContextType getCoordinationContext()
+    {
+        return _coordContext;
+    }
+
+    public void setCoordinationContext(CoordinationContextType cc)
+    {
+        _coordContext = cc;
+    }
+
+    private CoordinationContextType _coordContext;
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,301 @@
+package com.arjuna.mwlabs.wst11.at;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateCoordinator;
+import com.arjuna.mwlabs.wst11.at.participants.CompletionCoordinatorImple;
+import com.arjuna.mwlabs.wst.at.participants.DurableTwoPhaseCommitParticipant;
+import com.arjuna.mwlabs.wst.at.participants.VolatileTwoPhaseCommitParticipant;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc.*;
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+import com.arjuna.wst11.stub.Durable2PCStub;
+import com.arjuna.wst11.stub.Volatile2PCStub;
+import com.arjuna.wsc11.RegistrarMapper;
+import com.arjuna.wsc11.Registrar;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import java.util.HashMap;
+
+public class RegistrarImple implements Registrar
+{
+	public RegistrarImple()
+        throws ProtocolNotRegisteredException, SystemException
+    {
+		_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+		// register with mapper using tx id as protocol identifier.
+        final com.arjuna.wsc11.RegistrarMapper mapper = RegistrarMapper.getFactory() ;
+
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC, this);
+		mapper.addRegistrar(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION, this);
+	}
+
+	/**
+	 * Called when a registrar is added to a register mapper. This method will
+	 * be called multiple times if the registrar is added to multiple register
+	 * mappers or to the same register mapper with different protocol
+	 * identifiers.
+	 *
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void install (final String protocolIdentifier)
+	{
+	}
+
+	/**
+	 * Registers the interest of participant in a particular protocol.
+	 *
+	 * @param participantProtocolService
+	 *            the address of the participant protocol service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 *
+	 * @return the PortReference of the coordinator protocol service
+	 *
+	 * @throws com.arjuna.wsc.AlreadyRegisteredException
+     *             if the participant is already registered for this
+	 *             coordination protocol under this activity identifier
+	 * @throws com.arjuna.wsc.InvalidProtocolException
+     *             if the coordination protocol is not supported
+	 * @throws com.arjuna.wsc.InvalidStateException
+     *             if the state of the coordinator no longer allows registration
+	 *             for this coordination protocol
+	 * @throws com.arjuna.wsc.NoActivityException
+     *             if the activity does not exist.
+	 *
+	 * @message com.arjuna.mwlabs.wst.at.Registrar11Imple_1
+	 *          [com.arjuna.mwlabs.wst.at.Registrar11Imple_1] - Invalid type URI: < {0} ,
+	 *          {1} >
+	 */
+
+	/*
+	 * TODO
+	 *
+	 * See comment at head of class definition. We shouldn't have to rely on
+	 * thread-to-activity association to register a participant. We currently do
+	 * because the code is based on old WS-CAF models that are no longer
+	 * applicable. This needs updating!
+	 */
+	public W3CEndpointReference register(final W3CEndpointReference participantProtocolService,
+        final String protocolIdentifier, final InstanceIdentifier instanceIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+            InvalidStateException, NoActivityException
+	{
+		Object tx = _hierarchies.get(instanceIdentifier.getInstanceIdentifier());
+
+		if (tx instanceof SubordinateCoordinator)
+			return registerWithSubordinate((SubordinateCoordinator)tx, participantProtocolService, protocolIdentifier);
+
+		ActivityHierarchy hier = (ActivityHierarchy) tx;
+
+		if (hier == null)
+			throw new NoActivityException();
+
+		try
+		{
+			_coordManager.resume(hier);
+		}
+		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+		{
+			throw new NoActivityException();
+		}
+		catch (SystemException ex)
+		{
+			throw new InvalidProtocolException();
+		}
+
+		// TODO check for AlreadyRegisteredException
+
+		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String participantId = "D" + new Uid().stringForm();
+
+			try
+			{
+                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
+				_coordManager.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
+
+				_coordManager.suspend();
+
+				return getCoordinator(participantId) ;
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String participantId = "V" + new Uid().stringForm();
+
+			try
+			{
+                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
+				_coordManager.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
+
+				_coordManager.suspend();
+
+				return getCoordinator(participantId) ;
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		{
+			try
+			{
+                final CompletionCoordinatorParticipant participant = new CompletionCoordinatorImple(_coordManager, hier, true, participantProtocolService) ;
+                CompletionCoordinatorProcessor.getProcessor().activateParticipant(participant, instanceIdentifier.getInstanceIdentifier()) ;
+
+				_coordManager.suspend();
+
+				return getCompletionCoordinator(instanceIdentifier) ;
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+
+				throw new InvalidStateException(ex.toString());
+			}
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.Registrar11Imple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
+
+			throw new InvalidProtocolException();
+		}
+	}
+
+    /**
+	 * Called when a registrar is removed from a register mapper. This method
+	 * will be called multiple times if the registrar is removed from multiple
+	 * register mappers or from the same register mapper with different protocol
+	 * identifiers.
+	 *
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+	public void uninstall(final String protocolIdentifier)
+	{
+	}
+
+	public final void associate () throws Exception
+	{
+		// TODO colocation won't do suspend
+
+		String txIdentifier = _coordManager.identifier().toString();
+		ActivityHierarchy hier = _coordManager.suspend();
+
+		_hierarchies.put(txIdentifier, hier);
+	}
+
+	public final void associate (ACCoordinator transaction) throws Exception
+	{
+		String txIdentifier = transaction.get_uid().stringForm();
+
+		_hierarchies.put(txIdentifier, transaction);
+	}
+
+	public final void disassociate (String txIdentifier) throws Exception
+	{
+		_hierarchies.remove(txIdentifier);
+	}
+
+	private final W3CEndpointReference registerWithSubordinate(final SubordinateCoordinator theTx,
+        final W3CEndpointReference participantProtocolService, final String protocolIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+			InvalidStateException, NoActivityException
+    {
+		if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+            final String participantId = "D" + new Uid().stringForm();
+
+            try
+            {
+                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
+                theTx.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));
+
+                return getCoordinator(participantId) ;
+            }
+            catch (Exception ex)
+            {
+                throw new InvalidStateException();
+            }
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+            final String participantId = "V" + new Uid().stringForm();
+
+            try
+            {
+                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
+                theTx.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;
+
+                return getCoordinator(participantId) ;
+            }
+            catch (Exception ex)
+            {
+                throw new InvalidStateException();
+            }
+		}
+		else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
+		{
+			// not allowed for subordinate transactions!
+
+			throw new InvalidStateException();
+		}
+		else
+		{
+			wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.Registrar11Imple_1", new Object[]
+			{ AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
+
+			throw new InvalidProtocolException();
+		}
+	}
+
+    private W3CEndpointReference getCompletionCoordinator(final InstanceIdentifier instanceIdentifier)
+    {
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME);
+        builder.serviceName(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_QNAME);
+        builder.endpointName(AtomicTransactionConstants.COMPLETION_COORDINATOR_PORT_QNAME);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, instanceIdentifier);
+        return builder.build();
+    }
+
+    private W3CEndpointReference getCoordinator(final String participantId)
+    {
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME);
+        builder.serviceName(AtomicTransactionConstants.COORDINATOR_SERVICE_QNAME);
+        builder.endpointName(AtomicTransactionConstants.COORDINATOR_PORT_QNAME);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, participantId);
+        return builder.build();
+    }
+
+	private CoordinatorManager _coordManager = null;
+	private HashMap _hierarchies = new HashMap();
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/ArjunaContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,259 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ArjunaContextImple.java,v 1.11.4.1 2005/11/22 10:36:15 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.at.context;
+
+import com.arjuna.ats.arjuna.coordinator.ActionHierarchy;
+import com.arjuna.mw.wsas.UserActivityFactory;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.context.Context;
+import com.arjuna.mw.wsas.context.ContextManager;
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.utils.DomUtil;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.ACCoordinator;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.DocumentBuilder;
+
+/**
+ * On demand this class creates the SOAP context information necessary to
+ * propagate the hierarchy of coordinators associated with the current thread.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ArjunaContextImple.java,v 1.11.4.1 2005/11/22 10:36:15 kconner Exp $
+ */
+
+public class ArjunaContextImple implements SOAPContext
+{
+
+	public ArjunaContextImple()
+	{
+		_context = null;
+	}
+
+	public ArjunaContextImple(ACCoordinator currentCoordinator)
+	{
+		_context = null;
+
+		initialiseContext(currentCoordinator);
+	}
+
+    /**
+     * Serialise the SOAP context into a DOM node.
+     * @param element The element to contain the serialisation.
+     * @return the element added.
+     */
+    public Element serialiseToElement(final Element element)
+    {
+        final Element context = context() ;
+        element.appendChild(context) ;
+        return context ;
+    }
+
+	public void initialiseContext(Object param)
+	{
+		try
+		{
+			ACCoordinator currentCoordinator = (ACCoordinator) param;
+
+			ActivityHierarchy hier = null;
+
+			try
+			{
+				hier = UserActivityFactory.userActivity().currentActivity();
+			}
+			catch (SystemException ex)
+			{
+				ex.printStackTrace();
+			}
+
+			if ((currentCoordinator != null) && (hier != null))
+			{
+				/*
+				 * Do the manditory stuff first.
+				 */
+
+				ActionHierarchy txHier = currentCoordinator.getHierarchy();
+                final int depth = txHier.depth() ;
+                _identifierValues = new String[depth] ;
+                _expiresValues = new int[depth] ;
+
+                _identifierValues[0] = txHier.getDeepestActionUid().stringForm() ;
+                _expiresValues[0] = hier.activity(hier.size()-1).getTimeout() ;
+
+				/*
+				 * Now let's do the optional stuff.
+				 */
+                for(int count = 1, index = 0 ; count < depth ; count++, index++)
+                {
+                    _identifierValues[count] = txHier.getActionUid(index).stringForm() ;
+                    _expiresValues[count] = hier.activity(index).getTimeout() ;
+                }
+			}
+		}
+		catch (ClassCastException ex)
+		{
+			throw new IllegalArgumentException();
+		}
+	}
+
+    /**
+     * @return the context document object.
+     */
+    private synchronized Element context()
+    {
+        // TODO - work out which bits of this we can do using JAXB
+        // TODO - sort out expires etc
+
+        if (_context == null)
+        {
+            DocumentBuilder builder = DomUtil.getDocumentBuilder();
+            org.w3c.dom.Document doc = builder.newDocument();
+
+            _context = doc.createElement("wscoor:" + _contextName);
+
+            _context.setAttribute("xmlns:wsu", _wsuNamespace);
+            _context.setAttribute("xmlns:wscoor", _wscoorNamespace);
+            _context.setAttribute("xmlns:arjuna", _arjunaNamespace);
+
+            if (_identifierValues != null)
+            {
+                /*
+                 * Do the manditory stuff first.
+                 */
+
+                Element identifier = doc.createElement("wsu:"+_identifier);
+                identifier.appendChild(doc.createTextNode(_identifierValues[0]));
+
+                _context.appendChild(identifier);
+
+                Element expires = doc.createElement("wsu:"+_expires);
+                expires.appendChild(doc.createTextNode(Integer.toString(_expiresValues[0])));
+
+                _context.appendChild(expires);
+
+                Element coordinationType = doc.createElement("wscoor:" + _coordinationType);
+                coordinationType.appendChild(doc.createTextNode(AtomicTransactionConstants.WSAT_PROTOCOL));
+
+                _context.appendChild(coordinationType);
+
+                /*
+                 * Now let's do the optional stuff.
+                 */
+                final int depth = _identifierValues.length ;
+                if (depth > 1)
+                {
+                    Element extensionRoot = doc.createElement("arjuna:"+_contextName);
+
+                    for(int count = 1 ; count < depth ; count++)
+                    {
+                        identifier = doc.createElement("arjuna:"+_identifier);
+                        identifier.appendChild(doc.createTextNode(_identifierValues[count]));
+
+                        extensionRoot.appendChild(identifier);
+
+                        expires = doc.createElement("arjuna:"+_expires);
+                        expires.appendChild(doc.createTextNode(Integer.toString(_expiresValues[count])));
+
+                        extensionRoot.appendChild(expires);
+                    }
+
+                    _context.appendChild(extensionRoot);
+                }
+            }
+        }
+
+        return _context ;
+    }
+
+	public String identifier ()
+	{
+		return ArjunaContextImple.class.getName();
+	}
+
+    public String getTransactionIdentifier()
+    {
+        return _identifierValues[0] ;
+    }
+
+    public int getTransactionExpires()
+    {
+        return _expiresValues[0] ;
+    }
+
+	public String toString ()
+	{
+		return DomUtil.nodeAsString(_context);
+	}
+
+    /**
+     * @message com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple_1 [com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple_1] - ignoring context:
+     */
+    public static ArjunaContextImple getContext()
+    {
+        ContextManager cxman = new ContextManager();
+        Context[] contexts = cxman.contexts();
+
+        for (int i = 0; i < contexts.length; i++)
+        {
+            if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
+            {
+                if (contexts[i] instanceof ArjunaContextImple)
+                {
+                    return (ArjunaContextImple)contexts[i] ;
+                }
+                else
+                {
+                    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple_1",
+                            new Object[]{contexts[i]});
+                }
+                break;
+            }
+        }
+        return null ;
+    }
+
+	private Element _context;
+    private String[] _identifierValues ;
+    private int[] _expiresValues ;
+
+	private static final String _wscoorNamespace = CoordinationConstants.WSCOOR_NAMESPACE;
+	private static final String _wsuNamespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
+	private static final String _arjunaNamespace = "http://arjuna.com/schemas/wsc/2003/01/extension";
+	private static final String _contextName = CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT;
+	private static final String _identifier = CoordinationConstants.WSCOOR_ELEMENT_IDENTIFIER;
+	private static final String _expires = CoordinationConstants.WSCOOR_ELEMENT_EXPIRES;
+    private static final String _coordinationType = CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_TYPE;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/context/TxContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,96 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TxContextImple.java,v 1.8.4.1 2005/11/22 10:36:15 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.at.context;
+
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mwlabs.wst11.at.ContextImple;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TxContextImple.java,v 1.8.4.1 2005/11/22 10:36:15 kconner Exp $
+ */
+
+public class TxContextImple implements TxContext
+{
+
+	public TxContextImple(CoordinationContextType ctx)
+	{
+		_context = new ContextImple(ctx);
+	}
+
+	public TxContextImple(Context context)
+	{
+		_context = context;
+	}
+
+	public boolean valid ()
+	{
+		return (_context != null) ;
+	}
+
+	public boolean equals (Object obj)
+	{
+		if (obj instanceof TxContextImple)
+		{
+			TxContextImple compare = (TxContextImple) obj;
+
+			return compare.context().equals(_context);
+		}
+		else
+			return false;
+	}
+
+	public final String identifier ()
+	{
+	    final String value = _context.getCoordinationContext().getIdentifier().getValue();
+	    if ((value != null) && value.startsWith("urn:"))
+        {
+            return value.substring(4) ;
+        }
+	    return value ;
+	}
+
+	public final Context context ()
+	{
+		return _context;
+	}
+
+	public String toString ()
+	{
+		return _context.toString();
+	}
+
+	private Context _context;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CleanupSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CleanupSynchronization.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CleanupSynchronization.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,78 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.at.participants;
+
+import com.arjuna.mwlabs.wst11.at.RegistrarImple;
+
+import com.arjuna.mw.wscf.model.twophase.participants.*;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CleanupSynchronization.java,v 1.3 2005/05/19 12:13:42 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CleanupSynchronization implements Synchronization
+{
+
+	public CleanupSynchronization(String cleanupId, RegistrarImple theRegistrar)
+	{
+		_cleanupId = cleanupId;
+		_theRegistrar = theRegistrar;
+	}
+
+	public void beforeCompletion () throws SystemException
+	{
+		// do nothing
+	}
+
+	public void afterCompletion (int status) throws SystemException
+	{
+		try
+		{
+			_theRegistrar.disassociate(_cleanupId);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	private String _cleanupId;
+
+	private RegistrarImple _theRegistrar;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CompletionCoordinatorImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CompletionCoordinatorImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/participants/CompletionCoordinatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,154 @@
+package com.arjuna.mwlabs.wst11.at.participants;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+import com.arjuna.webservices11.wsat.processors.CompletionCoordinatorProcessor;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst11.CompletionCoordinatorParticipant;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Oct 30, 2007
+ * Time: 2:37:26 PM
+ * To change this template use File | Settings | File Templates.
+ */
+
+/**
+ *
+ */
+public class CompletionCoordinatorImple implements CompletionCoordinatorParticipant
+{
+    public CompletionCoordinatorImple(CoordinatorManager cm, ActivityHierarchy hier, final boolean deactivate, W3CEndpointReference participant)
+    {
+        _cm = cm;
+        _hier = hier;
+        this.deactivate = deactivate ;
+        this.participant = participant;
+    }
+
+    public void commit () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier != null)
+		_cm.resume(_hier);
+
+	    _cm.confirm();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    //	    throw new HeuristicHazardException();
+
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorCancelledException ex)
+	{
+	    throw new TransactionRolledBackException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
+	{
+	    //	    throw new HeuristicMixedException();
+
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
+	{
+	    //	    throw new HeuristicHazardException();
+
+	    throw new SystemException(ex.toString());
+
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	finally
+	{
+	    if (deactivate)
+	        CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
+	}
+    }
+
+    public void rollback () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier != null)
+		_cm.resume(_hier);
+
+	    _cm.cancel();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorConfirmedException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicMixedException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.twophase.exceptions.HeuristicHazardException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	finally
+	{
+        if (deactivate)
+            CompletionCoordinatorProcessor.getProcessor().deactivateParticipant(this);
+	}
+    }
+
+    public W3CEndpointReference getParticipant()
+    {
+        return participant;
+    }
+
+    private CoordinatorManager   _cm;
+    private ActivityHierarchy    _hier;
+    private final boolean deactivate ;
+    private W3CEndpointReference participant;
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/TransactionManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,218 @@
+package com.arjuna.mwlabs.wst11.at.remote;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+import com.arjuna.mwlabs.wst.at.remote.ContextManager;
+import com.arjuna.webservices11.wsat.processors.ParticipantProcessor;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc.*;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.*;
+import com.arjuna.wst11.messaging.engines.ParticipantEngine;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+/**
+ * This is the interface that the core exposes in order to allow different types
+ * of participants to be enrolled. The messaging layer continues to work in
+ * terms of the registrar, but internally we map to one of these methods.
+ */
+
+public class TransactionManagerImple extends TransactionManager
+{
+	public TransactionManagerImple()
+	{
+	}
+
+	public void enlistForDurableTwoPhase (Durable2PCParticipant tpp, String id)
+			throws WrongStateException, UnknownTransactionException,
+            AlreadyRegisteredException, SystemException
+    {
+		try
+		{
+			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC);
+
+			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			throw new UnknownTransactionException();
+		}
+	}
+
+	public void enlistForVolatileTwoPhase (Volatile2PCParticipant tpp, String id)
+			throws WrongStateException, UnknownTransactionException,
+			AlreadyRegisteredException, SystemException
+	{
+		try
+		{
+			final W3CEndpointReference coordinator = registerParticipant(getParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC);
+
+			ParticipantProcessor.getProcessor().activateParticipant(new ParticipantEngine(tpp, id, coordinator), id) ;
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			ex.printStackTrace();
+
+			throw new UnknownTransactionException();
+		}
+	}
+
+	/*
+	 * TODO
+	 *
+	 * Have participant interfaces in WSTX have url method and services use
+	 * those. The ones in WS-T are message oriented and we translate to/from.
+	 *
+	 */
+
+	/**
+	 * @message com.arjuna.mwlabs.wst.at.remote.Transaction11ManagerImple_1
+	 *          [com.arjuna.mwlabs.wst.at.remote.Transaction11ManagerImple_1] -
+	 *          Not implemented!
+	 */
+
+	public int replay () throws SystemException
+	{
+		throw new SystemException(
+				wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.Transaction11ManagerImple_1"));
+	}
+
+	public TxContext suspend () throws SystemException
+	{
+		return _ctxManager.suspend();
+	}
+
+	// resume overwrites. Should we check first a la JTA?
+
+	public void resume (TxContext tx) throws UnknownTransactionException,
+			SystemException
+	{
+		_ctxManager.resume(tx);
+	}
+
+	public TxContext currentTransaction () throws SystemException
+	{
+		return _ctxManager.currentTransaction();
+	}
+
+	protected W3CEndpointReference enlistForCompletion (final W3CEndpointReference participantEndpoint)
+			throws WrongStateException, UnknownTransactionException,
+			AlreadyRegisteredException, SystemException
+	{
+		try
+		{
+			TxContextImple currentTx = (TxContextImple) _ctxManager.currentTransaction();
+
+			if (currentTx == null)
+				throw new com.arjuna.wsc.NoActivityException();
+
+			return registerParticipant(participantEndpoint, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION);
+		}
+		catch (com.arjuna.wsc.InvalidProtocolException ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wsc.InvalidStateException ex)
+		{
+			throw new WrongStateException();
+		}
+		catch (com.arjuna.wsc.NoActivityException ex)
+		{
+			throw new UnknownTransactionException();
+		}
+	}
+
+    private W3CEndpointReference getParticipant(final String id)
+    {
+        final QName serviceName = AtomicTransactionConstants.PARTICIPANT_SERVICE_QNAME;
+        final QName endpointName = AtomicTransactionConstants.PARTICIPANT_PORT_QNAME;
+        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME);
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(serviceName);
+        builder.endpointName(endpointName);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+        return builder.build();
+    }
+
+	private final W3CEndpointReference registerParticipant (final W3CEndpointReference participant, final String protocol)
+			throws InvalidProtocolException, InvalidStateException, NoActivityException, SystemException
+	{
+		TxContextImple currentTx = null;
+
+		try
+		{
+			currentTx = (TxContextImple) _ctxManager.suspend();
+
+			if (currentTx == null)
+				throw new NoActivityException();
+
+            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
+            final String messageId = MessageId.getMessageId() ;
+
+            return com.arjuna.wsc11.RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
+        }
+		catch (final SoapFault sf)
+		{
+			throw new SystemException(sf.getMessage());
+		}
+		catch (final NoActivityException nae)
+		{
+			throw nae ;
+		}
+        catch (final InvalidStateException ise)
+        {
+            throw ise ;
+        }
+        catch (final InvalidProtocolException ipe)
+        {
+            throw ipe ;
+        }
+		catch (final Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (currentTx != null)
+					_ctxManager.resume(currentTx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+
+	private ContextManager _ctxManager = new ContextManager();
+
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserTransactionImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,383 @@
+package com.arjuna.mwlabs.wst11.at.remote;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.common.Environment;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mwlabs.wst11.at.ContextImple;
+import com.arjuna.mwlabs.wst11.at.remote.TransactionManagerImple;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+import com.arjuna.mwlabs.wst.at.remote.ContextManager;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.stub.CompletionStub;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import java.util.Hashtable;
+
+/**
+ * @message com.arjuna.mwlabs.wst.at.remote.UserTransaction11Imple__2
+ *          [com.arjuna.mwlabs.wst.at.remote.UserTransaction11Imple__2] - Received
+ *          context is null!
+ */
+public class UserTransactionImple extends UserTransaction
+{
+
+	public UserTransactionImple()
+	{
+		try
+		{
+            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
+
+			/*
+			 * If the coordinator URL hasn't been specified via the
+			 * configuration file then assume we are using a locally registered
+			 * implementation.
+			 */
+
+			if (_activationCoordinatorService == null)
+			{
+                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+                _activationCoordinatorService = serviceRegistry.getServiceURI(CoordinationConstants.ACTIVATION_SERVICE_NAME) ;
+			}
+		}
+		catch (Exception ex)
+		{
+			// TODO
+
+			ex.printStackTrace();
+		}
+	}
+
+	public void begin () throws WrongStateException, SystemException
+    {
+		begin(0);
+	}
+
+	public void begin (int timeout) throws WrongStateException, SystemException
+	{
+		try
+		{
+			if (_ctxManager.currentTransaction() != null)
+				throw new WrongStateException();
+
+			Context ctx = startTransaction(timeout);
+
+			_ctxManager.resume(new TxContextImple(ctx));
+
+			enlistCompletionParticipants();
+		}
+		catch (com.arjuna.wsc.InvalidCreateParametersException ex)
+		{
+			tidyup();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (com.arjuna.wst.UnknownTransactionException ex)
+		{
+			tidyup();
+
+			throw new SystemException(ex.toString());
+		}
+		catch (SystemException ex)
+		{
+			tidyup();
+
+			throw ex;
+		}
+	}
+
+	public void commit () throws TransactionRolledBackException,
+            UnknownTransactionException, SecurityException, SystemException
+	{
+		try
+		{
+			commitWithoutAck();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		finally
+		{
+			tidyup();
+		}
+	}
+
+	public void rollback () throws UnknownTransactionException, SecurityException, SystemException
+	{
+		try
+		{
+			abortWithoutAck();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		finally
+		{
+			tidyup();
+		}
+	}
+
+	public String transactionIdentifier ()
+	{
+		try
+		{
+			return _ctxManager.currentTransaction().toString();
+		}
+		catch (SystemException ex)
+		{
+			return "Unknown";
+		}
+		catch (NullPointerException ex)
+		{
+			return "Unknown";
+		}
+	}
+
+	public String toString ()
+	{
+		return transactionIdentifier();
+	}
+
+	/*
+	 * Not sure if this is right as it doesn't map to registering a participant
+	 * with the coordinator.
+	 */
+
+	private final void enlistCompletionParticipants ()
+			throws WrongStateException, UnknownTransactionException,
+			SystemException
+	{
+		try
+		{
+			TransactionManagerImple tm = (TransactionManagerImple) TransactionManager.getTransactionManager();
+
+            final TxContextImple txContext = (TxContextImple) tm.currentTransaction();
+            final String id = txContext.identifier();
+            final W3CEndpointReference completionCoordinator = tm.enlistForCompletion(getCompletionParticipant(id));
+
+			_completionCoordinators.put(id, completionCoordinator);
+		}
+		catch (com.arjuna.wsc.AlreadyRegisteredException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+    private final Context startTransaction(int timeout)
+			throws com.arjuna.wsc.InvalidCreateParametersException,
+			SystemException
+	{
+		try
+		{
+            // TODO: tricks for per app _activationCoordinatorService config, perhaps:
+            //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
+
+
+            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+            final String messageId = MessageId.getMessageId() ;
+            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+                    _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, null) ;
+            if (coordinationContext == null)
+            {
+                throw new SystemException(
+                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserTransaction11Imple__2"));
+            }
+            return new ContextImple(coordinationContext) ;
+		}
+        catch (final InvalidCreateParametersException icpe)
+        {
+            throw icpe ;
+        }
+		catch (final SoapFault sf)
+		{
+			throw new SystemException(sf.getMessage()) ;
+		}
+		catch (final Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	private final void commitWithoutAck ()
+			throws TransactionRolledBackException, UnknownTransactionException,
+			SecurityException, SystemException
+	{
+		TxContextImple ctx = null;
+		String id = null;
+
+		try
+		{
+			ctx = (TxContextImple) _ctxManager.suspend();
+			id = ctx.identifier();
+
+			/*
+			 * By default the completionParticipantURL won't be set for an interposed (imported)
+			 * bridged transaction. This is fine, because you shouldn't be able to commit that
+			 * transaction from a node in the tree, only from the root. So, we can prevent commit
+			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
+			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
+			 * for how to do this).
+			 */
+
+			final W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);
+
+			if (completionCoordinator == null)
+				throw new SecurityException();
+
+			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
+
+			completionStub.commit();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		catch (TransactionRolledBackException ex)
+		{
+			throw ex;
+		}
+		catch (UnknownTransactionException ex)
+		{
+			throw ex;
+		}
+		catch (SecurityException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (ctx != null)
+					_ctxManager.resume(ctx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+
+			if (id != null)
+				_completionCoordinators.remove(id);
+		}
+	}
+
+	private final void abortWithoutAck () throws UnknownTransactionException, SecurityException,
+			SystemException
+	{
+		TxContextImple ctx = null;
+		String id = null;
+
+		try
+		{
+			ctx = (TxContextImple) _ctxManager.suspend();
+			id = ctx.identifier();
+
+			/*
+			 * By default the completionParticipantURL won't be set for an interposed (imported)
+			 * bridged transaction. This is fine, because you shouldn't be able to commit that
+			 * transaction from a node in the tree, only from the root. So, we can prevent commit
+			 * or rollback at this stage. The alternative would be to setup the completionParticipantURL
+			 * and throw the exception from the remote coordinator side (see enlistCompletionParticipants
+			 * for how to do this).
+			 */
+
+			W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);
+
+			if (completionCoordinator == null)
+				throw new SecurityException();
+
+			CompletionStub completionStub = new CompletionStub(id, completionCoordinator);
+
+			completionStub.rollback();
+		}
+		catch (SystemException ex)
+		{
+			throw ex;
+		}
+		catch (UnknownTransactionException ex)
+		{
+			throw ex;
+		}
+		catch (SecurityException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				if (ctx != null)
+					_ctxManager.resume(ctx);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+
+			if (id != null)
+				_completionCoordinators.remove(id);
+		}
+	}
+
+    /**
+     * Create an endpoint for the local participant service labelled with the current context id which can be passed
+     * to the registration service and handed on to the registered coordinator to call back to this transaction
+     * @param id the current transaction context identifier
+     * @return
+     */
+    private W3CEndpointReference getCompletionParticipant(final String id)
+    {
+        final QName serviceName = AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_QNAME;
+        final QName endpointName = AtomicTransactionConstants.COMPLETION_INITIATOR_PORT_QNAME;
+        final String address = ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME);
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(serviceName);
+        builder.endpointName(endpointName);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+        return builder.build();
+    }
+
+	private final void tidyup ()
+	{
+		try
+		{
+			_ctxManager.suspend();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	private ContextManager _ctxManager = new ContextManager();
+	private String _activationCoordinatorService;
+	private Hashtable _completionCoordinators = new Hashtable();
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/BusinessActivityTerminatorImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/BusinessActivityTerminatorImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/BusinessActivityTerminatorImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,215 @@
+package com.arjuna.mwlabs.wst11.ba;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.wst11.BusinessActivityTerminator;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+
+/**
+ * Local business activity terminator which can be used to close a business activity from the terminator
+ * side.
+ */
+public class BusinessActivityTerminatorImple
+        implements BusinessActivityTerminator
+{
+    private W3CEndpointReference participantEndpoint;
+
+    /**
+     * create a business activity terminator for use on the server side with an empty participant endpoint
+     * which gets set at registration time
+     * @throws SystemException
+     */
+    public BusinessActivityTerminatorImple()
+            throws SystemException
+    {
+        try
+        {
+            _coordManager = CoordinatorManagerFactory.coordinatorManager();
+            _hier = _coordManager.currentActivity();
+        }
+        catch (ProtocolNotRegisteredException pnre)
+        {
+            throw new SystemException(pnre.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+
+        participantEndpoint = null;
+    }
+
+    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+        try
+        {
+            if (_hier == null)
+            throw new UnknownTransactionException();
+
+            _coordManager.resume(_hier);
+
+            _coordManager.close();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+        {
+            throw new UnknownTransactionException();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorCancelledException ex)
+        {
+            throw new TransactionRolledBackException();
+        }
+        catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+        {
+            throw new UnknownTransactionException();
+        }
+        catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+        catch (UnknownTransactionException ex)
+        {
+            throw ex;
+        }
+        finally
+        {
+            TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
+        }
+    }
+
+    public void cancel () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+
+	    _coordManager.cancel();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.model.sagas.exceptions.CoordinatorConfirmedException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (UnknownTransactionException ex)
+	{
+	    throw ex;
+	}
+	finally
+	{
+        TerminationCoordinatorProcessor.getProcessor().deactivateParticipant(this) ;
+	}
+    }
+
+    /**
+     * Complete doesn't mean go away, it just means that all work you need to
+     * accomplish the commit/rollback has been received.
+     */
+
+    public void complete () throws UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+
+	    _coordManager.complete();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoPermissionException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.ProtocolViolationException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wscf.exceptions.NoCoordinatorException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException();
+	}
+	catch (UnknownTransactionException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    /**
+     * update the business activity terminator with an endpoint supplied at registration time
+     *
+     * @param participantEndpoint
+     */
+    public void setEndpoint(W3CEndpointReference participantEndpoint)
+    {
+        this.participantEndpoint = participantEndpoint;
+    }
+
+    /**
+     * retrieve the participant endpoint associated with this business activity terminator
+     * 
+     * @return
+     */
+    public W3CEndpointReference getEndpoint()
+    {
+        return participantEndpoint;
+    }
+
+    private CoordinatorManager _coordManager = null;
+    private ActivityHierarchy _hier = null;
+}

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextFactoryImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,228 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextFactoryImple.java,v 1.4.4.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba;
+
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple;
+import com.arjuna.mwlabs.wst11.ba.RegistrarImple;
+import com.arjuna.mwlabs.wst11.ba.BusinessActivityTerminatorImple;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.ContextFactory;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wst11.BusinessActivityTerminator;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires;
+
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+public class ContextFactoryImple implements ContextFactory
+{
+
+    public ContextFactoryImple()
+    {
+        try
+        {
+            _coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+            _theRegistrar = new RegistrarImple();
+        }
+        catch (Exception ex)
+        {
+            ex.printStackTrace();
+        }
+    }
+
+    /**
+     * Called when a context factory is added to a context factory mapper. This method will be called multiple times
+     * if the context factory is added to multiple context factory mappers or to the same context mapper with different
+     * protocol identifiers.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+
+    public void install (final String coordinationTypeURI)
+    {
+    }
+
+    // TODO interposition
+
+    /*
+     * If there is a context passed through to create then this newly created
+     * coordinator should be interposed.
+     */
+
+    /**
+     * Creates a coordination context.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     * @param expires the expire date/time for the returned context, can be null
+     * @param currentContext the current context, can be null
+     *
+     * @return the created coordination context
+     *
+     * @throws com.arjuna.wsc.InvalidCreateParametersException if a parameter passed is invalid
+     *         this activity identifier.
+     *
+     * @message com.arjuna.mwlabs.wst.ba.Context11FactoryImple_1 [com.arjuna.mwlabs.wst.ba.Context11FactoryImple_1] - Invalid type URI: < {0} , {1} >
+     * @message com.arjuna.mwlabs.wst.ba.Context11FactoryImple_3 [com.arjuna.mwlabs.wst.ba.Context11FactoryImple_3] - Invalid type URI:
+     */
+
+    public CoordinationContext create (final String coordinationTypeURI,
+            final Long expires, final CoordinationContextType currentContext)
+        throws InvalidCreateParametersException
+    {
+        if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationTypeURI))
+    	{
+    	    try
+    	    {
+    		// make sure no transaction is currently associated
+
+    		_coordManager.suspend();
+
+    		final int timeout ;
+            if (expires == null)
+            {
+                timeout = 0 ;
+            }
+            else
+            {
+                final long longTimeout = expires.longValue() ;
+                timeout = (longTimeout > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int)longTimeout) ;
+            }
+
+    		_coordManager.begin(timeout);
+
+            final ArjunaContextImple arjunaContext = ArjunaContextImple.getContext() ;
+            final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+            final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME) ;
+
+            final CoordinationContext coordinationContext = new CoordinationContext() ;
+            coordinationContext.setCoordinationType(coordinationTypeURI) ;
+            CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
+            identifier.setValue("urn:"+arjunaContext.getTransactionIdentifier());
+            coordinationContext.setIdentifier(identifier) ;
+            final int transactionExpires = arjunaContext.getTransactionExpires() ;
+            if (transactionExpires > 0)
+            {
+                Expires expiresInstance = new Expires();
+                expiresInstance.setValue(transactionExpires);
+                coordinationContext.setExpires(expiresInstance);
+            }
+            final W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, arjunaContext);
+            coordinationContext.setRegistrationService(registrationCoordinator) ;
+
+            String transactionIdentifier = arjunaContext.getTransactionIdentifier();
+            BusinessActivityTerminator terminator = new BusinessActivityTerminatorImple();
+            TerminationCoordinatorProcessor.getProcessor().activateParticipant(terminator, transactionIdentifier);
+
+    		_theRegistrar.associate();
+
+    		return coordinationContext;
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	    {
+		// TODO handle properly
+
+            ex.printStackTrace();
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	    catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	    catch (Exception ex)
+	    {
+		// TODO handle properly
+
+		ex.printStackTrace();
+	    }
+	}
+	else
+	{
+	    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.Context11FactoryImple_1",
+					  new Object[]{BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, coordinationTypeURI});
+
+	    throw new InvalidCreateParametersException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.ba.Context11FactoryImple_3")+" < "+ BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME+", "+coordinationTypeURI+" >");
+	}
+
+	return null;
+    }
+
+    private static W3CEndpointReference getRegistrationCoordinator(String registrationCoordinatorURI, ArjunaContextImple arjunaContext) {
+        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(CoordinationConstants.REGISTRATION_SERVICE_QNAME);
+        builder.endpointName(CoordinationConstants.REGISTRATION_ENDPOINT_QNAME);
+        // strictly we shouldn't need to set the address because we are in the same web app as the
+        // coordinator but we have to as the W3CEndpointReference implementation is incomplete
+        builder.address(registrationCoordinatorURI);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, arjunaContext.getTransactionIdentifier());
+        W3CEndpointReference registrationCoordinator = builder.build();
+        return registrationCoordinator;
+    }
+
+    /**
+     * Called when a context factory is removed from a context factory mapper. This method will be called multiple
+     * times if the context factory is removed from multiple context factory mappers or from the same context factory
+     * mapper with different coordination type uris.
+     *
+     * @param coordinationTypeURI the coordination type uri
+     */
+
+    public void uninstall (String coordinationTypeURI)
+    {
+	// we don't use this as one implementation is registered per type
+    }
+
+    public final RegistrarImple registrar ()
+    {
+        return _theRegistrar;
+    }
+
+    private CoordinatorManager                   _coordManager;
+    private RegistrarImple _theRegistrar;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/ContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,73 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ContextImple.java,v 1.3.6.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba;
+
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import com.arjuna.mw.wsc11.context.Context;
+
+
+public class ContextImple implements Context
+{
+    public ContextImple(CoordinationContextType ctx)
+    {
+        _coordContext = ctx;
+    }
+
+    public boolean equals (Object obj)
+    {
+        if (obj instanceof ContextImple)
+        {
+    	    ContextImple ci = (ContextImple) obj;
+
+            return ci.getCoordinationContext().getIdentifier().getValue().equals(_coordContext.getIdentifier().getValue());
+        }
+        else
+            return false;
+    }
+
+    public CoordinationContextType getCoordinationContext ()
+    {
+    	return _coordContext;
+    }
+
+    public void setCoordinationContext (CoordinationContextType cc)
+    {
+    	_coordContext = cc;
+    }
+
+    public String toString ()
+    {
+    	return "BusinessActivityIdentifier: "+_coordContext.getIdentifier().getValue();
+    }
+
+    private CoordinationContextType _coordContext;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/RegistrarImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,276 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002, 2003, 2004,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: RegistrarImple.java,v 1.7.4.1 2005/11/22 10:36:14 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba;
+
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wst11.ba.participants.BusinessAgreementWithCoordinatorCompletionImple;
+import com.arjuna.mwlabs.wst11.ba.participants.BusinessAgreementWithParticipantCompletionImple;
+import com.arjuna.mwlabs.wst11.ba.BusinessActivityTerminatorImple;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wsarjtx.processors.TerminationCoordinatorProcessor;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc.*;
+import com.arjuna.wst11.messaging.engines.CoordinatorCompletionCoordinatorEngine;
+import com.arjuna.wst11.messaging.engines.ParticipantCompletionCoordinatorEngine;
+import com.arjuna.wst11.stub.BusinessAgreementWithCoordinatorCompletionStub;
+import com.arjuna.wst11.stub.BusinessAgreementWithParticipantCompletionStub;
+import com.arjuna.wsc11.RegistrarMapper;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+import java.util.HashMap;
+
+public class RegistrarImple implements com.arjuna.wsc11.Registrar
+{
+
+	public RegistrarImple() throws ProtocolNotRegisteredException,
+			SystemException
+	{
+		_coordManager = CoordinatorManagerFactory.coordinatorManager();
+
+		// register with mapper using tx id as protocol identifier.
+		final RegistrarMapper mapper = RegistrarMapper.getFactory();
+
+		mapper.addRegistrar(
+			BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION, this);
+		mapper.addRegistrar(
+			BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION, this);
+		mapper.addRegistrar(com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION, this);
+	}
+
+	/**
+	 * Called when a registrar is added to a register mapper. This method will
+	 * be called multiple times if the registrar is added to multiple register
+	 * mappers or to the same register mapper with different protocol
+	 * identifiers.
+	 *
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void install (String protocolIdentifier)
+	{
+	}
+
+	/**
+	 * Registers the interest of participant in a particular protocol.
+	 *
+	 * @param participantProtocolService
+	 *            the address of the participant protocol service
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 *
+	 * @return the PortReference of the coordinator protocol service
+	 *
+	 * @throws com.arjuna.wsc.AlreadyRegisteredException
+	 *             if the participant is already registered for this
+	 *             coordination protocol under this activity identifier
+	 * @throws com.arjuna.wsc.InvalidProtocolException
+	 *             if the coordination protocol is not supported
+	 * @throws com.arjuna.wsc.InvalidStateException
+	 *             if the state of the coordinator no longer allows registration
+	 *             for this coordination protocol
+	 * @throws com.arjuna.wsc.NoActivityException
+	 *             if the activity does not exist.
+	 *
+	 * @message com.arjuna.mwlabs.wst.ba.Registrar11Imple_1
+	 *          [com.arjuna.mwlabs.wst.ba.Registrar11Imple_1] - Invalid type URI: < {0} , {1} >
+	 */
+
+	public W3CEndpointReference register (
+			final W3CEndpointReference participantProtocolService,
+			final String protocolIdentifier,
+			final InstanceIdentifier instanceIdentifier)
+			throws AlreadyRegisteredException, InvalidProtocolException,
+			InvalidStateException, NoActivityException
+	{
+		ActivityHierarchy hier = (ActivityHierarchy) _hierarchies
+				.get(instanceIdentifier.getInstanceIdentifier());
+
+		if (hier == null) throw new NoActivityException();
+
+		try
+		{
+			_coordManager.resume(hier);
+		}
+		catch (com.arjuna.mw.wsas.exceptions.InvalidActivityException ex)
+		{
+			throw new NoActivityException();
+		}
+		catch (SystemException ex)
+		{
+			throw new InvalidProtocolException();
+		}
+
+		// TODO check for AlreadyRegisteredException
+
+		if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
+				.equals(protocolIdentifier))
+		{
+			// enlist participant that wraps the requester URI.
+			final String id = new Uid().stringForm();
+
+			try
+			{
+                final ParticipantCompletionCoordinatorEngine engine = new ParticipantCompletionCoordinatorEngine(id, participantProtocolService) ;
+				BusinessAgreementWithParticipantCompletionImple participant = new BusinessAgreementWithParticipantCompletionImple(
+						new BusinessAgreementWithParticipantCompletionStub(engine), id);
+                engine.setCoordinator(participant.participantManager()) ;
+
+				_coordManager.enlistParticipant(participant);
+
+				_coordManager.suspend();
+
+				return getParticipantManager(
+                        BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_QNAME,
+                        BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_PORT_QNAME,
+                        ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME),
+						id);
+			}
+			catch (Exception ex)
+			{
+				throw new InvalidStateException();
+			}
+		}
+		else
+			if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
+					.equals(protocolIdentifier))
+			{
+				final String id = new Uid().stringForm();
+				try
+				{
+                    final CoordinatorCompletionCoordinatorEngine engine = new CoordinatorCompletionCoordinatorEngine(id, participantProtocolService) ;
+					BusinessAgreementWithCoordinatorCompletionImple participant = new BusinessAgreementWithCoordinatorCompletionImple(
+							new BusinessAgreementWithCoordinatorCompletionStub(engine), id);
+                    engine.setCoordinator(participant.participantManager()) ;
+
+					_coordManager.enlistParticipant(participant);
+
+					_coordManager.suspend();
+
+					return getParticipantManager(
+                            BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_QNAME,
+							BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_PORT_QNAME,
+                            ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_COORDINATOR_SERVICE_NAME),
+							id);
+				}
+				catch (Exception ex)
+				{
+					throw new InvalidStateException();
+				}
+			}
+			else
+				if (com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
+				{
+                    /*
+                     * update the server side terminator with the participant end point
+                     */
+                    BusinessActivityTerminatorImple terminator;
+                    terminator = (BusinessActivityTerminatorImple) TerminationCoordinatorProcessor.getProcessor().getParticipant(instanceIdentifier);
+                    terminator.setEndpoint(participantProtocolService);
+                    
+                    try
+					{
+                        return getParticipantManager(
+                                ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_QNAME,
+								ArjunaTX11Constants.TERMINATION_COORDINATOR_PORT_QNAME,
+                                ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_COORDINATOR_SERVICE_NAME),
+                                instanceIdentifier.getInstanceIdentifier());
+					}
+					catch (Exception ex)
+					{
+						throw new InvalidStateException();
+					}
+				}
+				else
+				{
+					wstxLogger.arjLoggerI18N
+							.warn(
+									"com.arjuna.mwlabs.wst.ba.Registrar11Imple_1",
+									new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });
+
+					throw new InvalidProtocolException();
+				}
+	}
+
+	/**
+	 * Called when a registrar is removed from a register mapper. This method
+	 * will be called multiple times if the registrar is removed from multiple
+	 * register mappers or from the same register mapper with different protocol
+	 * identifiers.
+	 *
+	 * @param protocolIdentifier
+	 *            the protocol identifier
+	 */
+
+	public void uninstall (String protocolIdentifier)
+	{
+	}
+
+	public final void associate () throws Exception
+	{
+		// TODO colocation won't do suspend
+
+		String txIdentifier = _coordManager.identifier().toString();
+		ActivityHierarchy hier = _coordManager.suspend();
+
+		_hierarchies.put(txIdentifier, hier);
+	}
+
+	public final void disassociate (String txIdentifier) throws Exception
+	{
+		_hierarchies.remove(txIdentifier);
+	}
+
+	private W3CEndpointReference getParticipantManager (final QName serviceName, final QName endpointName, final String address, final String id)
+	{
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(serviceName);
+        builder.endpointName(endpointName);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+        return builder.build();
+	}
+
+	private CoordinatorManager _coordManager = null;
+
+	private HashMap _hierarchies = new HashMap();
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/ArjunaContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,261 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ArjunaContextImple.java,v 1.6.6.1 2005/11/22 10:36:16 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.context;
+
+import com.arjuna.ats.arjuna.coordinator.ActionHierarchy;
+import com.arjuna.mw.wsas.UserActivityFactory;
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.context.Context;
+import com.arjuna.mw.wsas.context.ContextManager;
+import com.arjuna.mw.wsas.context.soap.SOAPContext;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wscf.utils.DomUtil;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mwlabs.wscf.model.sagas.arjunacore.ACCoordinator;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import org.w3c.dom.Element;
+
+import javax.xml.parsers.DocumentBuilder;
+
+/**
+ * On demand this class creates the SOAP context information necessary to
+ * propagate the hierarchy of coordinators associated with the current
+ * thread.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ArjunaContextImple.java,v 1.6.6.1 2005/11/22 10:36:16 kconner Exp $
+ */
+
+public class ArjunaContextImple implements SOAPContext
+{
+
+    public ArjunaContextImple()
+    {
+        _context = null;
+    }
+
+    public ArjunaContextImple(ACCoordinator currentCoordinator)
+    {
+    	_context = null;
+
+    	initialiseContext(currentCoordinator);
+    }
+
+    /**
+     * Serialise the SOAP context into a DOM node.
+     * @param element The element to contain the serialisation.
+     * @return the element added.
+     */
+    public Element serialiseToElement(final Element element)
+    {
+        final Element context = context() ;
+        element.appendChild(context) ;
+        return context ;
+    }
+
+    public void initialiseContext(Object param)
+    {
+    	try
+    	{
+    	    ACCoordinator currentCoordinator = (ACCoordinator) param;
+
+    	    ActivityHierarchy hier = null;
+
+    	    try
+    	    {
+    	        hier = UserActivityFactory.userActivity().currentActivity();
+    	    }
+    	    catch (SystemException ex)
+    	    {
+    	        ex.printStackTrace();
+    	    }
+
+    	    if ((currentCoordinator != null) && (hier != null))
+    	    {
+        		/*
+        		 * Do the manditory stuff first.
+        		 */
+
+        		ActionHierarchy txHier = currentCoordinator.getHierarchy();
+                final int depth = txHier.depth() ;
+                _identifierValues = new String[depth] ;
+                _expiresValues = new int[depth] ;
+
+                _identifierValues[0] = txHier.getDeepestActionUid().stringForm() ;
+                _expiresValues[0] = hier.activity(hier.size()-1).getTimeout() ;
+
+        		/*
+        		 * Now let's do the optional stuff.
+        		 */
+                for(int count = 1, index = 0 ; count < depth ; count++, index++)
+                {
+                    _identifierValues[count] = txHier.getActionUid(index).stringForm() ;
+                    _expiresValues[count] = hier.activity(index).getTimeout() ;
+                }
+            }
+    	}
+    	catch (ClassCastException ex)
+    	{
+    	    throw new IllegalArgumentException();
+    	}
+    }
+
+    /**
+     * @return the context document object.
+     */
+    private synchronized Element context()
+    {
+        // TODO - work out which bits of this we can do using JAXB
+        // TODO - sort out expires etc
+
+        if (_context == null)
+        {
+            DocumentBuilder builder = DomUtil.getDocumentBuilder();
+            org.w3c.dom.Document doc = builder.newDocument();
+
+            _context = doc.createElement("wscoor:"+_contextName);
+
+            _context.setAttribute("xmlns:wsu", _wsuNamespace);
+            _context.setAttribute("xmlns:wscoor", _wscoorNamespace);
+            _context.setAttribute("xmlns:arjuna", _arjunaNamespace);
+
+            if (_identifierValues != null)
+            {
+                /*
+                 * Do the manditory stuff first.
+                 */
+
+                Element identifier = doc.createElement("wsu:"+_identifier);
+                identifier.appendChild(doc.createTextNode(_identifierValues[0]));
+
+                _context.appendChild(identifier);
+
+                Element expires = doc.createElement("wsu:"+_expires);
+                expires.appendChild(doc.createTextNode(Integer.toString(_expiresValues[0])));
+
+                _context.appendChild(expires);
+
+                Element coordinationType = doc.createElement("wscoor:" + _coordinationType);
+                coordinationType.appendChild(doc.createTextNode(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME));
+
+                _context.appendChild(coordinationType);
+
+                /*
+                 * Now let's do the optional stuff.
+                 */
+                final int depth = _identifierValues.length ;
+                if (depth > 1)
+                {
+                    Element extensionRoot = doc.createElement("arjuna:"+_contextName);
+
+                    for(int count = 1; count < depth ; count++)
+                    {
+                        identifier = doc.createElement("arjuna:"+_identifier);
+                        identifier.appendChild(doc.createTextNode(_identifierValues[count]));
+
+                        extensionRoot.appendChild(identifier);
+
+                        expires = doc.createElement("arjuna:"+_expires);
+                        expires.appendChild(doc.createTextNode(Integer.toString(_expiresValues[count])));
+
+                        extensionRoot.appendChild(expires);
+                    }
+
+                    _context.appendChild(extensionRoot);
+                }
+            }
+        }
+        return _context ;
+    }
+
+    public String identifier ()
+    {
+        return ArjunaContextImple.class.getName();
+    }
+
+    public String getTransactionIdentifier()
+    {
+        return _identifierValues[0] ;
+    }
+
+    public int getTransactionExpires()
+    {
+        return _expiresValues[0] ;
+    }
+
+    public String toString ()
+    {
+        return DomUtil.nodeAsString(_context);
+    }
+
+    /**
+     * @message com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple_1 [com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple_1] - ignoring context:
+     */
+    public static ArjunaContextImple getContext()
+    {
+        ContextManager cxman = new ContextManager();
+        Context[] contexts = cxman.contexts();
+
+        for (int i = 0; i < contexts.length; i++)
+        {
+            if (contexts[i].identifier().equals(ArjunaContextImple.class.getName()))
+            {
+                if (contexts[i] instanceof ArjunaContextImple)
+                {
+                    return (ArjunaContextImple)contexts[i] ;
+                }
+                else
+                {
+                    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple_1",
+                            new Object[]{contexts[i]});
+                }
+                break;
+            }
+        }
+        return null ;
+    }
+
+    private Element _context;
+    private String[] _identifierValues ;
+    private int[] _expiresValues ;
+
+    private static final String _wscoorNamespace = CoordinationConstants.WSCOOR_NAMESPACE;
+    private static final String _wsuNamespace = "http://schemas.xmlsoap.org/ws/2002/07/utility";
+    private static final String _arjunaNamespace = "http://arjuna.com/schemas/wsc/2003/01/extension";
+
+    private static final String _contextName = CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT;
+    private static final String _identifier = CoordinationConstants.WSCOOR_ELEMENT_IDENTIFIER;
+    private static final String _expires = CoordinationConstants.WSCOOR_ELEMENT_EXPIRES;
+    private static final String _coordinationType = CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_TYPE;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/context/TxContextImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,96 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TxContextImple.java,v 1.2.20.1 2005/11/22 10:36:16 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.context;
+
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mwlabs.wst11.ba.ContextImple;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TxContextImple.java,v 1.2.20.1 2005/11/22 10:36:16 kconner Exp $
+ */
+
+public class TxContextImple implements TxContext
+{
+
+    public TxContextImple(CoordinationContextType ctx)
+    {
+        _context = new ContextImple(ctx);
+    }
+
+    public TxContextImple(Context context)
+    {
+        _context = context;
+    }
+
+    public boolean valid ()
+    {
+    	return (_context != null) ;
+    }
+
+    public boolean equals (Object obj)
+    {
+    	if (obj instanceof TxContextImple)
+    	{
+    	    TxContextImple compare = (TxContextImple) obj;
+
+    	    return compare.context().equals(_context);
+    	}
+    	else
+    	    return false;
+    }
+
+    public final String identifier ()
+    {
+        final String value = _context.getCoordinationContext().getIdentifier().getValue();
+        if ((value != null) && value.startsWith("urn:"))
+        {
+            return value.substring(4) ;
+        }
+        return value ;
+    }
+
+    public final Context context ()
+    {
+        return _context;
+    }
+
+    public String toString ()
+    {
+        return _context.toString();
+    }
+
+    private Context _context;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithCoordinatorCompletionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithCoordinatorCompletionImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithCoordinatorCompletionImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,81 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessAgreementWithCoordinatorCompletionImple.java,v 1.1.2.2 2004/08/09 12:34:26 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.participants;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wscf.exceptions.InvalidParticipantException;
+import com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant;
+import com.arjuna.mwlabs.wst11.ba.participants.BusinessAgreementWithParticipantCompletionImple;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BusinessAgreementWithCoordinatorCompletionImple.java,v 1.1.2.2
+ *          2004/08/09 12:34:26 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class BusinessAgreementWithCoordinatorCompletionImple extends
+        BusinessAgreementWithParticipantCompletionImple implements
+		com.arjuna.mw.wscf.model.sagas.participants.ParticipantWithComplete
+{
+
+	public BusinessAgreementWithCoordinatorCompletionImple(
+			BusinessAgreementWithCoordinatorCompletionParticipant participant,
+			String identifier)
+	{
+		super(participant, identifier);
+	}
+
+	public void complete () throws InvalidParticipantException,
+			WrongStateException, SystemException
+	{
+		if (_resource != null)
+		{
+			try
+			{
+				((BusinessAgreementWithCoordinatorCompletionParticipant) _resource)
+						.complete();
+			}
+			catch (com.arjuna.wst.WrongStateException ex)
+			{
+				throw new WrongStateException(ex.toString());
+			}
+			catch (com.arjuna.wst.SystemException ex)
+			{
+				throw new SystemException(ex.toString());
+			}
+		}
+		else
+			throw new InvalidParticipantException();
+	}
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithParticipantCompletionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithParticipantCompletionImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/participants/BusinessAgreementWithParticipantCompletionImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,230 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessAgreementWithParticipantCompletionImple.java,v 1.1.2.2 2004/08/09 12:34:26 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.participants;
+
+// import com.arjuna.mw.wst.resources.BusinessAgreement;
+
+import com.arjuna.ats.arjuna.state.InputObjectState;
+import com.arjuna.ats.arjuna.state.OutputObjectState;
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wscf.exceptions.InvalidParticipantException;
+import com.arjuna.mw.wscf.model.sagas.exceptions.CompensateFailedException;
+import com.arjuna.mwlabs.wst.util.PersistableParticipantHelper;
+import com.arjuna.mwlabs.wst11.ba.remote.BAParticipantManagerImple;
+import com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant;
+import com.arjuna.wst11.BAParticipantManager;
+
+// TODO crash recovery (for EVERYTHING!!)
+
+// TODO re-architect!!
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BusinessAgreementWithParticipantCompletionImple.java,v 1.1.2.2
+ *          2004/08/09 12:34:26 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class BusinessAgreementWithParticipantCompletionImple implements
+		com.arjuna.mw.wscf.model.sagas.participants.Participant
+{
+//
+	public BusinessAgreementWithParticipantCompletionImple(
+			BusinessAgreementWithParticipantCompletionParticipant resource,
+			String id)
+	{
+		_resource = resource;
+		_identifier = id;
+		_baParticipantManager = new BAParticipantManagerImple(id);
+	}
+
+	public void close () throws InvalidParticipantException,
+			WrongStateException, SystemException
+	{
+		try
+		{
+			if (_resource != null)
+			{
+				_resource.close();
+			}
+			else
+				throw new InvalidParticipantException();
+		}
+		catch (com.arjuna.wst.WrongStateException ex)
+		{
+			throw new WrongStateException(ex.toString());
+		}
+		catch (com.arjuna.wst.SystemException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	public void cancel () throws InvalidParticipantException,
+			WrongStateException, SystemException
+	{
+		try
+		{
+			if (_resource != null)
+			{
+				_resource.cancel();
+			}
+			else
+				throw new InvalidParticipantException();
+		}
+		catch (com.arjuna.wst.WrongStateException ex)
+		{
+			throw new WrongStateException(ex.toString());
+		}
+		catch (com.arjuna.wst.SystemException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	public void compensate () throws CompensateFailedException,
+			InvalidParticipantException, WrongStateException, SystemException
+	{
+		try
+		{
+			if (_resource != null)
+			{
+				_resource.compensate();
+			}
+			else
+				throw new InvalidParticipantException();
+		}
+		catch (com.arjuna.wst.FaultedException ex)
+		{
+			throw new CompensateFailedException();
+		}
+		catch (com.arjuna.wst.WrongStateException ex)
+		{
+			throw new WrongStateException(ex.toString());
+		}
+		catch (com.arjuna.wst.SystemException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	/**
+	 * @return the status value.
+	 */
+
+	public String status () throws SystemException
+	{
+		try
+		{
+			if (_resource != null)
+			{
+				return _resource.status();
+			}
+			else
+				throw new SystemException("InvalidParticipant");
+		}
+		catch (com.arjuna.wst.SystemException ex)
+		{
+			throw new SystemException(ex.toString());
+		}
+	}
+
+	/**
+	 * Inform the participant that is can forget the heuristic result.
+	 *
+	 * @exception com.arjuna.mw.wscf.exceptions.InvalidParticipantException
+	 *                Thrown if the participant identity is invalid.
+	 * @exception com.arjuna.mw.wsas.exceptions.WrongStateException
+	 *                Thrown if the participant is in an invalid state.
+	 * @exception com.arjuna.mw.wsas.exceptions.SystemException
+	 *                Thrown in the event of a general fault.
+	 */
+
+	public void forget () throws InvalidParticipantException,
+			WrongStateException, SystemException
+	{
+		// not supported by the IBM protocol.
+	}
+
+	public void unknown () throws SystemException
+	{
+		/*
+		 * If the transaction is unknown, then we assume it cancelled.
+		 */
+
+		try
+		{
+			cancel();
+		}
+		catch (Exception ex)
+		{
+			// TODO
+		}
+	}
+
+	public String id () throws SystemException
+	{
+		return _identifier;
+	}
+
+	public final BAParticipantManager participantManager ()
+	{
+		return _baParticipantManager;
+	}
+
+	public boolean save_state (OutputObjectState os)
+	{
+        return PersistableParticipantHelper.save_state(os, _resource) ;
+	}
+
+	public boolean restore_state (InputObjectState is)
+	{
+        final Object resource = PersistableParticipantHelper.restore_state(is) ;
+        if (resource != null)
+        {
+            _resource = (BusinessAgreementWithParticipantCompletionParticipant)resource ;
+            return true ;
+        }
+        else
+        {
+            return false ;
+        }
+	}
+
+	protected BusinessAgreementWithParticipantCompletionParticipant _resource;
+
+	private String _identifier = null;
+
+	private BAParticipantManager _baParticipantManager = null;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BAParticipantManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BAParticipantManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BAParticipantManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,203 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BAParticipantManagerImple.java,v 1.5.6.1 2005/11/22 10:36:08 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.remote;
+
+import com.arjuna.mw.wsas.activity.ActivityHierarchy;
+import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
+import com.arjuna.mw.wscf11.model.sagas.CoordinatorManagerFactory;
+import com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.BAParticipantManager;
+
+import javax.xml.namespace.QName;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ *
+ * This could also be the interface that high-level users see (e.g., at the
+ * application Web Service).
+ */
+
+public class BAParticipantManagerImple implements BAParticipantManager
+{
+
+    public BAParticipantManagerImple(String participantId)
+    {
+	try
+	{
+	    _coordManager = CoordinatorManagerFactory.coordinatorManager();
+	    _hier = _coordManager.currentActivity();
+	    _participantId = participantId;
+	}
+	catch (Exception ex)
+	{
+	    ex.printStackTrace();
+	}
+    }
+
+    public void exit () throws WrongStateException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+
+	    _coordManager.delistParticipant(_participantId);
+
+	    _coordManager.suspend();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new WrongStateException();
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void completed () throws WrongStateException, UnknownTransactionException, SystemException
+    {
+	try
+	{
+	    if (_hier == null)
+		throw new UnknownTransactionException();
+
+	    _coordManager.resume(_hier);
+
+	    _coordManager.participantCompleted(_participantId);
+
+	    _coordManager.suspend();
+	}
+    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new WrongStateException();
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new UnknownTransactionException();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void fail (final QName exceptionIdentifier) throws SystemException
+    {
+	try
+	{
+        if (_hier == null)
+            throw new UnknownTransactionException();
+
+            _coordManager.resume(_hier);
+
+        // fail means faulted as far as the coordinator manager is concerned
+            _coordManager.participantFaulted(_participantId);
+
+            _coordManager.suspend();
+	}
+    catch (final InvalidActivityException iae)
+    {
+        throw new SystemException("UnknownTransactionException");
+    }
+    catch (final UnknownTransactionException ute)
+    {
+        throw new SystemException("UnknownTransactionException");
+    }
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new SystemException("UnknownParticipantException");
+	}
+    	catch (com.arjuna.mw.wsas.exceptions.NoActivityException ex)
+	{
+	    throw new SystemException("UnknownTransactionException");
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    public void cannotComplete () throws WrongStateException, UnknownTransactionException, SystemException
+    {
+        exit();
+    }
+
+    public void error () throws SystemException
+    {
+	try
+	{
+	    _coordManager.setCancelOnly();
+	}
+	catch (com.arjuna.mw.wsas.exceptions.WrongStateException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+	catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
+	{
+	    throw new SystemException(ex.toString());
+	}
+    }
+
+    private CoordinatorManager _coordManager = null;
+    private ActivityHierarchy  _hier = null;
+    private String             _participantId = null;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/BusinessActivityManagerImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,215 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: BusinessActivityManagerImple.java,v 1.7.4.1 2005/11/22 10:36:08 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.remote;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mwlabs.wst11.ba.context.TxContextImple;
+import com.arjuna.mwlabs.wst.ba.remote.ContextManager;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wsba.processors.CoordinatorCompletionParticipantProcessor;
+import com.arjuna.webservices11.wsba.processors.ParticipantCompletionParticipantProcessor;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc.AlreadyRegisteredException;
+import com.arjuna.wsc11.RegistrationCoordinator;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.*;
+import com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine;
+import com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine;
+import com.arjuna.wst11.stub.BACoordinatorCompletionParticipantManagerStub;
+import com.arjuna.wst11.stub.BAParticipantCompletionParticipantManagerStub;
+import com.arjuna.wst11.BAParticipantManager;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+/**
+ * This is the interface that the core exposes in order to allow different
+ * types of participants to be enrolled. The messaging layer continues to
+ * work in terms of the registrar, but internally we map to one of these
+ * methods.
+ */
+
+public class BusinessActivityManagerImple extends BusinessActivityManager
+{
+    public BusinessActivityManagerImple()
+    {
+    }
+
+    public BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion (BusinessAgreementWithParticipantCompletionParticipant bap, String id)
+        throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
+    {
+        final QName service = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME;
+        final QName endpoint = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME;
+        final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME);
+        final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
+    	try
+    	{
+            W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
+            final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap) ;
+            ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+
+            return new BAParticipantCompletionParticipantManagerStub(engine);
+    	}
+    	catch (com.arjuna.wsc.InvalidProtocolException ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (com.arjuna.wsc.InvalidStateException ex)
+    	{
+    	    throw new WrongStateException();
+    	}
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    throw new UnknownTransactionException();
+    	}
+    	catch (Throwable ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public com.arjuna.wst11.BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion (BusinessAgreementWithCoordinatorCompletionParticipant bawcp, String id) throws WrongStateException, UnknownTransactionException, AlreadyRegisteredException, SystemException
+    {
+        final QName service = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME;
+        final QName endpoint = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME;
+        final String address = ServiceRegistry.getRegistry().getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME);
+        final W3CEndpointReference participant = getParticipant(service, endpoint, address, id) ;
+    	try
+    	{
+    	    W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
+            final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, baPMEndpoint, bawcp) ;
+            CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id) ;
+
+            return new BACoordinatorCompletionParticipantManagerStub(engine);
+    	}
+    	catch (com.arjuna.wsc.InvalidProtocolException ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (com.arjuna.wsc.InvalidStateException ex)
+    	{
+    	    throw new WrongStateException();
+    	}
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new UnknownTransactionException();
+    	}
+    	catch (Throwable ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public TxContext suspend () throws SystemException
+    {
+        return _ctxManager.suspend();
+    }
+
+    // resume overwrites. Should we check first a la JTA?
+
+    public void resume (TxContext tx) throws UnknownTransactionException, SystemException
+    {
+        _ctxManager.resume(tx);
+    }
+
+    public TxContext currentTransaction () throws SystemException
+    {
+        return _ctxManager.currentTransaction();
+    }
+
+    private final W3CEndpointReference registerParticipant(final W3CEndpointReference participant, final String protocol)
+        throws com.arjuna.wsc.InvalidProtocolException, com.arjuna.wsc.InvalidStateException, com.arjuna.wsc.NoActivityException, SystemException
+    {
+    	TxContextImple currentTx = null;
+
+    	try
+    	{
+    	    currentTx = (TxContextImple) _ctxManager.currentTransaction();
+
+    	    if (currentTx == null)
+        		throw new com.arjuna.wsc.NoActivityException();
+
+            final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext() ;
+            final String messageId = MessageId.getMessageId() ;
+            return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol) ;
+    	}
+        catch (final SoapFault sf)
+        {
+            throw new SystemException(sf.getMessage());
+        }
+    	catch (com.arjuna.wsc.NoActivityException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    try
+    	    {
+        		if (currentTx != null)
+        		    _ctxManager.resume(currentTx);
+    	    }
+    	    catch (Exception ex)
+    	    {
+        		ex.printStackTrace();
+    	    }
+    	}
+    }
+
+    private W3CEndpointReference getParticipant(final QName service, final QName endpoint, final String address, final String id)
+    {
+        final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(service);
+        builder.endpointName(endpoint);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
+        return builder.build();
+    }
+
+    private ContextManager _ctxManager = new ContextManager();
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/ba/remote/UserBusinessActivityImple.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,331 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2003,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserBusinessActivityImple.java,v 1.10.4.1 2005/11/22 10:36:07 kconner Exp $
+ */
+
+package com.arjuna.mwlabs.wst11.ba.remote;
+
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.mw.wst11.common.Environment;
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mwlabs.wst11.ba.ContextImple;
+import com.arjuna.mwlabs.wst11.ba.context.TxContextImple;
+import com.arjuna.mwlabs.wst.ba.remote.ContextManager;
+import com.arjuna.webservices11.wsba.BusinessActivityConstants;
+import com.arjuna.webservices11.wsarjtx.ArjunaTX11Constants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices11.wsarj.InstanceIdentifier;
+import com.arjuna.webservices11.wscoor.CoordinationConstants;
+import com.arjuna.webservices11.ServiceRegistry;
+import com.arjuna.wsc11.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc11.RegistrationCoordinator;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import com.arjuna.wst11.stub.BusinessActivityTerminatorStub;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.wsaddressing.W3CEndpointReference;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ *
+ * @message com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_1 [com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_1] - Invalid address.
+ * @message com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_2 [com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_2] - Received context is null!
+ * @message com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_3 [com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_3] - No termination context!
+ */
+
+public class UserBusinessActivityImple extends UserBusinessActivity
+{
+    public UserBusinessActivityImple()
+    {
+        try
+        {
+            _activationCoordinatorService = System.getProperty(Environment.COORDINATOR_URL);
+
+            /*
+             * If the coordinator URL hasn't been specified via the
+             * configuration file then assume we are using a locally registered
+             * implementation.
+             */
+
+            if (_activationCoordinatorService == null)
+            {
+                final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry() ;
+                _activationCoordinatorService = serviceRegistry.getServiceURI(CoordinationConstants.ACTIVATION_SERVICE_NAME) ;
+            }
+        }
+        catch (Exception ex)
+        {
+            // TODO
+
+            ex.printStackTrace();
+        }
+    }
+
+    public void begin () throws WrongStateException, SystemException
+    {
+    	begin(0);
+    }
+
+    public void begin (int timeout) throws WrongStateException, SystemException
+    {
+    	try
+    	{
+    	    if (_ctxManager.currentTransaction() != null)
+        		throw new WrongStateException();
+
+    	    Context ctx = startTransaction(timeout);
+
+    	    _ctxManager.resume(new TxContextImple(ctx));
+    	}
+    	catch (InvalidCreateParametersException ex)
+    	{
+    	    tidyup();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    tidyup();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    	catch (SystemException ex)
+    	{
+    	    tidyup();
+
+    	    throw ex;
+    	}
+    }
+
+    public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException
+    {
+    	TxContextImple ctx = null;
+
+    	try
+    	{
+    	    ctx = (TxContextImple) _ctxManager.suspend();
+
+            final String id = ctx.identifier() ;
+            final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ;
+
+    	    BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+
+    	    terminatorStub.close();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (TransactionRolledBackException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    tidyup();
+    	}
+    }
+
+    public void cancel () throws UnknownTransactionException, SystemException
+    {
+    	TxContextImple ctx = null;
+
+    	try
+    	{
+            ctx = (TxContextImple) _ctxManager.suspend();
+
+            final String id = ctx.identifier() ;
+            final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ;
+
+            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+
+    	    terminatorStub.cancel();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+
+    	    throw new SystemException(ex.toString());
+    	}
+    	finally
+    	{
+    	    tidyup();
+    	}
+    }
+
+    public void complete () throws UnknownTransactionException, SystemException
+    {
+    	try
+    	{
+            final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction()) ;
+            final String id = ctx.identifier() ;
+            final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx) ;
+
+            BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
+
+    	    terminatorStub.complete();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (UnknownTransactionException ex)
+    	{
+    	    throw ex;
+    	}
+    	catch (Exception ex)
+    	{
+    	    throw new SystemException(ex.toString());
+    	}
+    }
+
+    public String transactionIdentifier ()
+    {
+    	try
+    	{
+    	    return _ctxManager.currentTransaction().toString();
+    	}
+    	catch (SystemException ex)
+    	{
+    	    return "Unknown";
+    	}
+    	catch (NullPointerException ex)
+    	{
+    	    return "Unknown";
+    	}
+    }
+
+    public String toString ()
+    {
+    	return transactionIdentifier();
+    }
+
+    private final Context startTransaction (int timeout) throws InvalidCreateParametersException, SystemException
+    {
+        try
+        {
+            final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+            final String messageId = MessageId.getMessageId() ;
+            final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+                    _activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, null) ;
+            if (coordinationContext == null)
+            {
+                throw new SystemException(
+                    wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_2"));
+            }
+            return new ContextImple(coordinationContext) ;
+        }
+        catch (final InvalidCreateParametersException icpe)
+        {
+            throw icpe ;
+        }
+        catch (final SoapFault sf)
+        {
+            throw new SystemException(sf.getMessage()) ;
+        }
+        catch (final Exception ex)
+        {
+            throw new SystemException(ex.toString());
+        }
+	}
+
+    private W3CEndpointReference getTerminationCoordinator(final TxContextImple ctx)
+        throws SystemException
+    {
+        final CoordinationContextType coordinationContext = ctx.context().getCoordinationContext() ;
+        final String messageId = MessageId.getMessageId() ;
+        try
+        {
+            return RegistrationCoordinator.register(coordinationContext, messageId,
+                getParticipantProtocolService(ctx.identifier()), com.arjuna.webservices.wsarjtx.ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION) ;
+        }
+        catch (final Throwable th)
+        {
+            throw new SystemException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple_3"));
+        }
+    }
+
+    private W3CEndpointReference getParticipantProtocolService(final String id)
+    {
+        // final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
+        // final String serviceURI = soapRegistry.getServiceURI(ArjunaTX11Constants.SERVICE_TERMINATION_PARTICIPANT) ;
+        final QName serviceId = ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_QNAME;
+        final QName endpointId = ArjunaTX11Constants.TERMINATION_PARTICIPANT_PORT_QNAME;
+        final String address = ServiceRegistry.getRegistry().getServiceURI(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME);
+        W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+        builder.serviceName(serviceId);
+        builder.endpointName(endpointId);
+        builder.address(address);
+        InstanceIdentifier.setEndpointInstanceIdentifier(builder, id) ;
+        return builder.build();
+    }
+
+    private final void tidyup ()
+    {
+    	try
+    	{
+    	    _ctxManager.suspend();
+    	}
+    	catch (Exception ex)
+    	{
+    	    ex.printStackTrace();
+    	}
+    }
+
+    private ContextManager _ctxManager = new ContextManager();
+    private String _activationCoordinatorService;
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/TwoPhaseTxManager.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/TwoPhaseTxManager.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/TwoPhaseTxManager.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,221 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wstx11.model.as.twophase;
+
+import com.arjuna.mw.wscf.model.as.CoordinatorManager;
+import com.arjuna.mw.wscf11.model.as.CoordinatorManagerFactory;
+
+import com.arjuna.mw.wscf.model.as.coordinator.twophase.common.*;
+
+import com.arjuna.mw.wstx.resource.Participant;
+import com.arjuna.mw.wstx.resource.Synchronization;
+
+import com.arjuna.mw.wstx.TransactionManager;
+
+import com.arjuna.mwlabs.wstx.model.as.twophase.resource.ParticipantAction;
+import com.arjuna.mwlabs.wstx.model.as.twophase.resource.SynchronizationAction;
+
+import com.arjuna.mw.wstx.exceptions.DuplicateParticipantException;
+import com.arjuna.mw.wstx.exceptions.NoTransactionException;
+import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
+import com.arjuna.mw.wstx.exceptions.InvalidParticipantException;
+import com.arjuna.mw.wstx.exceptions.DuplicateSynchronizationException;
+import com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+
+/**
+ * This is the service side component of the user interface. Since services
+ * or some entity acting on their behalf (e.g., an interceptor) must enlist
+ * participants with the transaction (atom or cohesion), this interface
+ * primarily concentrates on those methods. However, a service may well
+ * not be the final destination for a transaction, i.e., in order to perform
+ * its work, the service may have to make other remote invocations on other
+ * services and propagate the context, suspend it, etc. As such, all of the
+ * UserTransaction methods are also available to the service.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: TwoPhaseTxManager.java,v 1.2 2003/03/04 12:59:29 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class TwoPhaseTxManager implements TransactionManager
+{
+
+    public TwoPhaseTxManager()
+    {
+	try
+	{
+	    _coordinatorManager = CoordinatorManagerFactory.coordinatorManager();
+	}
+	catch (Exception ex)
+	{
+	    // TODO
+
+	    ex.printStackTrace();
+
+	    _coordinatorManager = null;
+	}
+    }
+
+    /**
+     * Enrol the specified participant in the current transaction.
+     * It is illegal to call this method when no transaction is associated
+     * with the thread.
+     *
+     * @param Participant participant The participant to enrol.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the transaction is not in a state
+     * whereby participants can be enrolled.
+     * @exception com.arjuna.mw.wstx.exceptions.DuplicateParticipantException Thrown if the participant identifier
+     * has already been associated with a participant.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the transaction associated with
+     * the thread is invalid.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidParticipantException Thrown if the participant reference
+     * is invalid.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void enlist (Participant participant) throws WrongStateException, DuplicateParticipantException, NoTransactionException, InvalidTransactionException, InvalidParticipantException, SystemException
+    {
+	try
+	{
+	    _coordinatorManager.addParticipant(new ParticipantAction(participant), Priorities.PARTICIPANT, null);
+	}
+	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
+	{
+	    throw new DuplicateParticipantException();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new InvalidParticipantException();
+	}
+    }
+
+    /**
+     * Cause the specified participant to resign from the transaction.
+     * CAUTION: use with *extreme* care since if invoked at the wrong time
+     * it could lead to data corruption or state modifications that are
+     * no longer under the control of the transaction. You *must* ensure
+     * that no state changes have been made that should be controlled by
+     * the specified participant.
+     *
+     * @param Participant participant The participant to resign.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the transaction associated with
+     * the thread is invalid.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if no transaction is associated
+     * with the invoking thread.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidParticipantException Thrown if the transaction does not know
+     * about the specified participant or the parameter is invalid.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the transaction is not in a state
+     * that allows participants to resign.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void delist (Participant participant) throws InvalidTransactionException, NoTransactionException, InvalidParticipantException, WrongStateException, SystemException
+    {
+	// TODO: support it!
+
+	throw new WrongStateException();
+    }
+
+    /**
+     * Enlist a synchronization with the current transaction. Synchronizations
+     * do not receive the two-phase commit messages but instead are invoked
+     * prior to its start and after it has completed.
+     *
+     * @param Synchronization participant The synchronization to enroll.
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the transaction state is such
+     * that synchronizations cannot be enrolled.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the transaction is not
+     * top-level.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException Thrown if the synchronization
+     * reference is invalid.
+     * @exception com.arjuna.mw.wstx.exceptions.DuplicateSynchronizationException Thrown if the synchronization
+     * has already been registered with the transaction.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void addSynchronization (Synchronization participant) throws WrongStateException, NoTransactionException, InvalidTransactionException, InvalidSynchronizationException, DuplicateSynchronizationException, SystemException
+    {
+	try
+	{
+	    _coordinatorManager.addParticipant(new SynchronizationAction(participant), Priorities.SYNCHRONIZATION, null);
+	}
+	catch (com.arjuna.mw.wscf.exceptions.DuplicateParticipantException ex)
+	{
+	    throw new DuplicateSynchronizationException();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (com.arjuna.mw.wscf.exceptions.InvalidParticipantException ex)
+	{
+	    throw new InvalidSynchronizationException();
+	}
+    }
+
+    /**
+     * Remove the specified synchronization participant from the transaction.
+     *
+     * @param Synchronization participant The participant to remove.
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the transaction is not
+     * top-level.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidSynchronizationException Thrown if the transaction
+     * does not know about the specified synchronization.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the state of the transaction is
+     * such that the synchronization cannot be removed.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void removeSynchronization (Synchronization participant) throws SystemException, InvalidTransactionException, NoTransactionException, InvalidSynchronizationException, WrongStateException
+    {
+	throw new WrongStateException();
+    }
+
+    private CoordinatorManager _coordinatorManager;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wstx11/model/as/twophase/UserTwoPhaseTx.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,558 @@
+/*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
+ */
+
+package com.arjuna.mwlabs.wstx11.model.as.twophase;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+
+import com.arjuna.mw.wstx.UserTransaction;
+
+import com.arjuna.mw.wstx.transaction.*;
+import com.arjuna.mw.wstx.status.*;
+
+import com.arjuna.mw.wstx.common.TxId;
+
+import com.arjuna.mwlabs.wstx.transaction.*;
+
+import com.arjuna.mwlabs.wstx.common.arjunacore.TxIdImple;
+
+import com.arjuna.mw.wsas.status.*;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.mw.wsas.completionstatus.Success;
+import com.arjuna.mw.wsas.completionstatus.Failure;
+import com.arjuna.mw.wsas.completionstatus.FailureOnly;
+
+import com.arjuna.mw.wscf.UserCoordinator;
+import com.arjuna.mw.wscf11.UserCoordinatorFactory;
+
+import com.arjuna.mw.wscf.common.Qualifier;
+import com.arjuna.mw.wscf.common.CoordinatorId;
+
+import com.arjuna.mwlabs.wscf.model.as.coordinator.arjunacore.CoordinatorIdImple;
+
+import com.arjuna.mw.wscf.model.twophase.common.TwoPhaseResult;
+import com.arjuna.mw.wscf.model.twophase.status.*;
+import com.arjuna.mw.wscf.model.twophase.outcomes.*;
+
+import com.arjuna.mw.wsas.exceptions.SystemException;
+import com.arjuna.mw.wsas.exceptions.WrongStateException;
+import com.arjuna.mw.wsas.exceptions.InvalidTimeoutException;
+import com.arjuna.mw.wsas.exceptions.InvalidActivityException;
+import com.arjuna.mw.wsas.exceptions.ProtocolViolationException;
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.mw.wsas.exceptions.NoPermissionException;
+import com.arjuna.mw.wsas.exceptions.ActiveChildException;
+
+import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
+
+import com.arjuna.mw.wstx.exceptions.InvalidTransactionException;
+import com.arjuna.mw.wstx.exceptions.NoTransactionException;
+import com.arjuna.mw.wstx.exceptions.HeuristicHazardException;
+import com.arjuna.mw.wstx.exceptions.HeuristicMixedException;
+import com.arjuna.mw.wstx.exceptions.TransactionRolledBackException;
+import com.arjuna.mw.wstx.exceptions.TransactionCommittedException;
+
+/**
+ * The user portion of the transaction API.
+ *
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: UserTwoPhaseTx.java,v 1.2 2005/03/10 15:37:17 nmcl Exp $
+ * @since 1.0.
+ *
+ * @message com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_2 [com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_2] - Transaction has active children.
+ * @message com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_3 [com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_3] - Unknown end result!
+ */
+
+public class UserTwoPhaseTx implements UserTransaction
+{
+
+    public UserTwoPhaseTx()
+    {
+	try
+	{
+	    /*
+	     * TODO: currently relies on the fact that the default
+	     * coordination protocol is two-phase. Needs to be explicit.
+	     */
+
+	    _theCoordinator = UserCoordinatorFactory.userCoordinator();
+	}
+	catch (SystemException ex)
+	{
+	    // TODO
+
+	    ex.printStackTrace();
+
+	    _theCoordinator = null;
+	}
+	catch (ProtocolNotRegisteredException ex)
+	{
+	    ex.printStackTrace();
+
+	    _theCoordinator = null;
+	}
+    }
+
+    /**
+     * Start a new transaction. If there is already a transaction associated
+     * with the thread then it will be interposed (nesting is to come!)
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the any currently associated
+     * transaction is in a state that does not allow a new transaction to be
+     * enlisted.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown in any other situation.
+     */
+
+    public void begin () throws WrongStateException, SystemException
+    {
+	_theCoordinator.start();
+    }
+
+    /**
+     * Commit the transaction. All participants that are still enlisted
+     * with the transaction are committed.
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the current transaction is not
+     * known about by the transaction system.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the current transaction is not in a
+     * state that allows commit to be called.
+     * @exception com.arjuna.mw.wstx.exceptions.HeuristicHazardException Thrown if the participants generated a hazard
+     * heuristic.
+     * @exception com.arjuna.mw.wstx.exceptions.HeuristicMixedException Thrown if the participants generated a mixed heuristic.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if some other error occurred.
+     */
+
+    public void commit () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionRolledBackException, SystemException
+    {
+	try
+	{
+	    Outcome result = _theCoordinator.end(Success.instance());
+
+	    parseOutcome(result, true);
+	}
+	catch (ActiveChildException ex)
+	{
+	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_2"));
+	}
+	catch (TransactionCommittedException ex)
+	{
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+	catch (WrongStateException ex)
+	{
+	    throw ex;
+	}
+	catch (ProtocolViolationException ex)
+	{
+	    throw new HeuristicHazardException(ex.toString());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (NoPermissionException ex)
+	{
+	    throw new InvalidTransactionException(ex.toString());
+	}
+	catch (HeuristicHazardException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    /**
+     * Abort the transaction. All participants that are still enlisted
+     * with the transaction are rolled back.
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the current transaction is not
+     * known about by the transaction system.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the current transaction is not in a
+     * state that allows cancel to be called.
+     * @exception com.arjuna.mw.wstx.exceptions.HeuristicHazardException Thrown if the participants generated a hazard
+     * heuristic.
+     * @exception com.arjuna.mw.wstx.exceptions.HeuristicMixedException Thrown if the participants generated a mixed heuristic.
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if some other error occurred.
+     */
+
+    public void rollback () throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, NoTransactionException, TransactionCommittedException, SystemException
+    {
+	try
+	{
+	    Outcome result = _theCoordinator.end(Failure.instance());
+
+	    parseOutcome(result, false);
+	}
+	catch (ActiveChildException ex)
+	{
+	    throw new InvalidTransactionException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_2"));
+	}
+	catch (TransactionRolledBackException ex)
+	{
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+	catch (WrongStateException ex)
+	{
+	    throw ex;
+	}
+	catch (ProtocolViolationException ex)
+	{
+	    throw new HeuristicHazardException(ex.toString());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+	catch (NoPermissionException ex)
+	{
+	    throw new InvalidTransactionException(ex.toString());
+	}
+	catch (HeuristicHazardException ex)
+	{
+	    throw ex;
+	}
+    }
+
+    /**
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs.
+     *
+     * @return the status of the current transaction. If there is no
+     * transaction associated with the thread then NO_TRANSACTION
+     * will be returned.
+     */
+
+    public Status status () throws SystemException
+    {
+	Status s = _theCoordinator.status();
+
+	if (s instanceof Cancelling)
+	    s = RollingBack.instance();
+	else
+	{
+	    if (s instanceof CancelOnly)
+		s = RollbackOnly.instance();
+	    else
+	    {
+		if (s instanceof Confirming)
+		    s = Committing.instance();
+		else
+		{
+		    if (s instanceof Confirmed)
+			s = Committed.instance();
+		    else
+		    {
+			if (s instanceof Cancelled)
+			    s = RolledBack.instance();
+			else
+			{
+			    if (s instanceof NoActivity)
+				s = NoTransaction.instance();
+			}
+		    }
+		}
+	    }
+	}
+
+	return s;
+    }
+
+    /**
+     * What is the name of the current transaction? Use only for
+     * debugging purposes.
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the invoking thread.
+     *
+     * @return the name of the transaction.
+     */
+
+    public String transactionName () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    return _theCoordinator.activityName();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    /**
+     * Suspend all transactions associated with this thread. The thread then
+     * becomes associated with no transaction (atom or cohesion).
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException if any error occurs.
+     *
+     * @return a representation of the context associated with the thread,
+     * or null if there is no context.
+     */
+
+    public TransactionHierarchy suspend () throws SystemException
+    {
+	ActivityHierarchy hier = _theCoordinator.suspend();
+
+	if (hier != null)
+	    return new TransactionHierarchyImple(hier);
+	else
+	    return null;
+    }
+
+    /**
+     * Associate this thread with the specified context. Any current
+     * associations are lost.
+     *
+     * @param TransactionHierarchy tx The context representation to associate (may be
+     * null).
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.InvalidTransactionException Thrown if the context is invalid.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void resume (TransactionHierarchy tx) throws InvalidTransactionException, SystemException
+    {
+	ActivityHierarchy hier;
+
+	if (tx == null)
+	    hier = null;
+	else
+	{
+	    if (tx instanceof TransactionHierarchyImple)
+	    {
+		hier = ((TransactionHierarchyImple) tx).activityHierarchy();
+	    }
+	    else
+		throw new InvalidTransactionException();
+	}
+
+	try
+	{
+	    _theCoordinator.resume(hier);
+	}
+	catch (InvalidActivityException ex)
+	{
+	    throw new InvalidTransactionException();
+	}
+    }
+
+    /**
+     * @return a representation of the context currently associated with
+     * the invoking thread, or null if there is none.
+     */
+
+    public TransactionHierarchy currentTransaction () throws SystemException
+    {
+	ActivityHierarchy hier = _theCoordinator.currentActivity();
+
+	if (hier != null)
+	    return new TransactionHierarchyImple(hier);
+	else
+	    return null;
+    }
+
+    /**
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     *
+     * @return the qualifiers that are currently associated with the
+     * transaction, or null if there are none.
+     */
+
+    public Qualifier[] qualifiers () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    return _theCoordinator.qualifiers();
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    /**
+     * Set the state of the transaction such that the only possible outcome is
+     * for it to rollback.
+     *
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no transaction
+     * associated with the current thread.
+     * @exception com.arjuna.mw.wsas.exceptions.WrongStateException Thrown if the state of the transaction is
+     * such that it is not possible to put it into a rollback-only state, e.g.,
+     * it is committing.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void setRollbackOnly () throws NoTransactionException, WrongStateException, SystemException
+    {
+	try
+	{
+	    _theCoordinator.setCompletionStatus(FailureOnly.instance());
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    /**
+     * Get the timeout value currently associated with transactions.
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any error occurs.
+     *
+     * @return the timeout value in seconds, or 0 if no application specified
+     * timeout has been provided.
+     */
+
+    public int getTimeout () throws SystemException
+    {
+	// TODO
+
+	return 0;
+    }
+
+    /**
+     * Set the timeout to be associated with all subsequently created
+     * activities. A default value of 0 is automatically associated with
+     * each thread and this means that no application specified timeout is
+     * set for activities.
+     *
+     * @param int timeout The timeout (in seconds) to associate with all
+     * subsequently created activities. This value must be 0 or greater.
+     *
+     * @exception com.arjuna.mw.wsas.exceptions.InvalidTimeoutException Thrown if the timeout value provided
+     * is negative, too large, or if timeouts are simply not supported by
+     * the activity implementation.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if any other error occurs.
+     */
+
+    public void setTimeout (int timeout) throws InvalidTimeoutException, SystemException
+    {
+	// TODO
+    }
+
+    /**
+     * @exception com.arjuna.mw.wstx.exceptions.NoTransactionException Thrown if there is no activity
+     * associated with the invoking thread.
+     * @exception com.arjuna.mw.wsas.exceptions.SystemException Thrown if some other error occurred.
+     *
+     * @return the unique transaction id for the current transaction. This
+     * may or may not be the same as the activity id.
+     *
+     * @message com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_1 [com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_1] - Unknown coordinator identifier type {0}
+     */
+
+    public TxId identifier () throws NoTransactionException, SystemException
+    {
+	try
+	{
+	    CoordinatorId coordId = _theCoordinator.identifier();
+
+	    if (coordId instanceof CoordinatorIdImple)
+		return new TxIdImple((CoordinatorIdImple) coordId);
+	    else
+	    {
+		wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_1",
+					      new Object[]{coordId});
+
+		return null;
+	    }
+	}
+	catch (NoActivityException ex)
+	{
+	    throw new NoTransactionException();
+	}
+    }
+
+    private final void parseOutcome (Outcome out, boolean commit) throws InvalidTransactionException, WrongStateException, HeuristicHazardException, HeuristicMixedException, TransactionRolledBackException, TransactionCommittedException
+    {
+	try
+	{
+	    if ((out.completedStatus().equals(Failure.instance()) ||
+		 out.completedStatus().equals(FailureOnly.instance())) && commit)
+	    {
+		throw new TransactionRolledBackException();
+	    }
+	}
+	catch (SystemException ex)
+	{
+	    throw new HeuristicHazardException();
+	}
+
+	if (out instanceof CoordinationOutcome)
+	{
+	    int res = ((CoordinationOutcome) out).result();
+
+	    switch (res)
+	    {
+	    case TwoPhaseResult.CANCELLED:
+	    case TwoPhaseResult.HEURISTIC_CANCEL:
+		{
+		    if (commit)
+			throw new TransactionRolledBackException();
+		}
+		break;
+	    case TwoPhaseResult.CONFIRMED:
+	    case TwoPhaseResult.HEURISTIC_CONFIRM:
+		{
+		    if (!commit)
+			throw new TransactionCommittedException();
+		}
+		break;
+	    case TwoPhaseResult.HEURISTIC_MIXED:
+		throw new HeuristicMixedException();
+	    case TwoPhaseResult.HEURISTIC_HAZARD:
+		throw new HeuristicHazardException();
+	    case TwoPhaseResult.FINISH_OK:
+		break;
+	    case TwoPhaseResult.FINISH_ERROR:
+	    default:
+		throw new HeuristicHazardException();
+	    }
+	}
+	else
+	    throw new HeuristicHazardException(wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wstx11.model.as.twophase.UserTwoPhaseTx_3"));
+    }
+
+    private UserCoordinator _theCoordinator;
+
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,38 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+<deployment>
+	<service name="UserTransaction">
+		<parameter name="className"
+		value="com.arjuna.mwlabs.wst11.at.remote.UserTransactionImple"/>
+	</service>
+	<service name="TransactionManager">
+		<parameter name="className"
+		value="com.arjuna.mwlabs.wst11.at.remote.TransactionManagerImple"/>
+	</service>
+	<service name="UserBusinessActivity">
+		<parameter name="className"
+		value="com.arjuna.mwlabs.wst11.ba.remote.UserBusinessActivityImple"/>
+	</service>
+	<service name="BusinessActivityManager">
+		<parameter name="className"
+		value="com.arjuna.mwlabs.wst11.ba.remote.BusinessActivityManagerImple"/>
+	</service>
+</deployment>

Added: labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wstx11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<wstx-config>
+	<properties>
+	    <property name="com.arjuna.mw.wscf11.protocols.twophase.context"
+	    value="com.arjuna.mwlabs.wst11.at.context.ArjunaContextImple"/>
+	    <property name="com.arjuna.mw.wscf11.protocols.sagas.context"
+	    value="com.arjuna.mwlabs.wst11.ba.context.ArjunaContextImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation1"
+        value="com.arjuna.mwlabs.wscf11.model.twophase.arjunacore.TwoPhaseHLSImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation2"
+        value="com.arjuna.mwlabs.wscf11.model.sagas.arjunacore.SagasHLSImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation3"
+        value="com.arjuna.mwlabs.wst11.at.ContextFactoryImple"/>
+        <property
+        name="com.arjuna.mw.wscf11.protocolImplementation4"
+        value="com.arjuna.mwlabs.wst11.ba.ContextFactoryImple"/>
+
+	    <property
+	    name="com.arjuna.ats.arjuna.objectstore.objectStoreDir"
+	    value="XTSObjectStore"/>
+
+	    <property
+	    name="com.arjuna.ats.arjuna.recovery.recoveryExtension1"
+	    value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
+	</properties>
+</wstx-config>

Added: labs/jbosstm/trunk/XTS/WSTX/xml/AtomicTransaction11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/xml/AtomicTransaction11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/xml/AtomicTransaction11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,23 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 20067, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags. 
+  See the copyright.txt in the distribution for a full listing 
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<coordination-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\mlittle\Desktop\standards work\WS architecture\WSCF\0.8.2\xml\WSCF.xsd">
+<coordinator-type>http://docs.oasis-open.org/ws-tx/wsat/2006/06</coordinator-type>
+</coordination-type>

Added: labs/jbosstm/trunk/XTS/WSTX/xml/BusinessActivity11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/xml/BusinessActivity11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/xml/BusinessActivity11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,23 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2007, Red Hat Middleware LLC, and individual contributors
+  as indicated by the @author tags. 
+  See the copyright.txt in the distribution for a full listing 
+  of individual contributors.
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU General Public License, v. 2.0.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<coordination-type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\mlittle\Desktop\standards work\WS architecture\WSCF\0.8.2\xml\WSCF.xsd">
+<coordinator-type>http://docs.oasis-open.org/ws-tx/wsba/2006/06/AtomicOutcome</coordinator-type>
+</coordination-type>

Modified: labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -19,7 +19,7 @@
   @author JBoss Inc.
 -->
 
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtd/web-app_2_3.dtd">
 
 <web-app>
     <display-name>Arjuna WS-TX</display-name>

Added: labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/xml/wstx_web-app11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,32 @@
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Arjuna WS-TX11</display-name>
+
+    <description>Arjuna WS-TX11</description>
+
+    <listener>
+        <listener-class>com.arjuna.mw.wst11.deploy.WSTXInitialisation</listener-class>
+    </listener>
+</web-app>

Modified: labs/jbosstm/trunk/XTS/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -43,7 +43,7 @@
     <property name="com.arjuna.buildsystem.lib.jars" value="buildsystem.jar"/>
     <property name="com.arjuna.jta.install.lib.jars" value="jbossjta.jar"/>
     <property name="com.arjuna.jta.install.ext.jars" value="jbossts-common.jar commons-logging-1.1.jar"/>
-    <property name="com.arjuna.xts.ext.jars" value="jaxrpc.jar saaj-api.jar servlet.jar stax-api-1.0.jar wstx-asl-2.0.3.jar"/>
+    <property name="com.arjuna.xts.ext.jars" value="jaxb-api.jar jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jbossws-client.jar jboss-saaj.jar"/>
 
 	<!-- Set internal property defaults -->
 
@@ -161,7 +161,6 @@
 	</target>
 
 	<target name="install" depends="build">
-
 		<echo message="Installation directory : ${com.arjuna.mwlabs.installationdirectory}"/>
 
 		<echo message="Installing jar files"/>
@@ -216,8 +215,8 @@
 			<fileset dir="${com.arjuna.mwlabs.coordinator.dir}"/>
 		</copy>
         <copy todir="${com.arjuna.mwlabs.installationdirectory}/coordinator/dd">
-            <fileset dir="WS-C/dev/dd" includes="ws-c_web-app.xml"/>
-            <fileset dir="WS-T/dev/dd" includes="ws-t_web-app.xml"/>
+            <fileset dir="WS-C/dev/dd" includes="ws-c_web-app.xml ws-c11_web-app.xml"/>
+            <fileset dir="WS-T/dev/dd" includes="ws-t_web-app.xml ws-t11_web-app.xml"/>
         </copy>
 
         <echo message="Installing demo"/>

Deleted: labs/jbosstm/trunk/XTS/demo/dd/jboss/application-sa.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/dd/jboss/application-sa.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/dd/jboss/application-sa.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,73 +0,0 @@
-<!--
-  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 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) 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>
-        <web>
-            <web-uri>ws-c.war</web-uri>
-            <context-root>/xts</context-root>
-        </web>
-    </module>
-    
-    <module>
-        <web>
-            <web-uri>ws-t.war</web-uri>
-            <context-root>/ws-t</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>wscf.war</web-uri>
-            <context-root>/wscf</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>wstx.war</web-uri>
-            <context-root>/wstx</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>xts-sa-demo-webservices.war</web-uri>
-            <context-root>/xtsdemowebservices</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>xts-sa-demo.war</web-uri>
-            <context-root>/xts-demo</context-root>
-        </web>
-    </module>
-
-</application>

Modified: labs/jbosstm/trunk/XTS/demo/dd/jboss/application.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/dd/jboss/application.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/dd/jboss/application.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,23 +1,23 @@
-<!--
-  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 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) 2005-2006,
-  @author JBoss Inc.
--->
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
 
 <!-- $Id: axis-application.xml,v 1.8.4.1 2005/11/22 10:42:05 kconner Exp $ -->
 
@@ -31,7 +31,7 @@
     <module>
         <web>
             <web-uri>xts-demo-webservices.war</web-uri>
-            <context-root>/xtsdemowebservices</context-root>
+            <context-root>/@urlstub@</context-root>
         </web>
     </module>
 

Modified: labs/jbosstm/trunk/XTS/demo/dd/jboss/context-handlers.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/dd/jboss/context-handlers.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/dd/jboss/context-handlers.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -7,7 +7,7 @@
     <handler-chain>
 	<handler>
 		<handler-name>ContextHandler</handler-name>
-		<handler-class>com.arjuna.mw.wst.service.JaxWSHeaderContextProcessor</handler-class>
+		<handler-class>com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor</handler-class>
 	</handler>
     </handler-chain>
 </handler-chains>

Deleted: labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application-sa.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application-sa.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application-sa.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,73 +0,0 @@
-<!--
-  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 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) 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>
-        <web>
-            <web-uri>ws-c.war</web-uri>
-            <context-root>/xts</context-root>
-        </web>
-    </module>
-    
-    <module>
-        <web>
-            <web-uri>ws-t.war</web-uri>
-            <context-root>/ws-t</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>wscf.war</web-uri>
-            <context-root>/wscf</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>wstx.war</web-uri>
-            <context-root>/wstx</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>xts-sa-demo-webservices.war</web-uri>
-            <context-root>/xtsdemowebservices</context-root>
-        </web>
-    </module>
-
-    <module>
-        <web>
-            <web-uri>xts-sa-demo.war</web-uri>
-            <context-root>/xts-demo</context-root>
-        </web>
-    </module>
-
-</application>

Modified: labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/application.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,23 +1,23 @@
-<!--
-  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 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) 2005-2006,
-  @author JBoss Inc.
--->
+<!--
+  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 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) 2005-2006,
+  @author JBoss Inc.
+-->
 
 <!-- $Id: axis-application.xml,v 1.8.4.1 2005/11/22 10:42:05 kconner Exp $ -->
 
@@ -30,15 +30,15 @@
 
     <module>
         <web>
-            <web-uri>xts-demo-webservices.war</web-uri>
-            <context-root>/xtsdemowebservices</context-root>
+            <web-uri>xts-demo-webservicesrpc.war</web-uri>
+            <context-root>/@urlstub@</context-root>
         </web>
     </module>
 
     <module>
         <web>
-            <web-uri>xts-demo.war</web-uri>
-            <context-root>/xts-demo</context-root>
+            <web-uri>xts-demorpc.war</web-uri>
+            <context-root>/xts-demorpc</context-root>
         </web>
     </module>
 

Modified: labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/client-web-app.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/client-web-app.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/ddrpc/jboss/client-web-app.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -57,7 +57,7 @@
 
     <servlet-mapping>
         <servlet-name>Basic Client Servlet</servlet-name>
-        <url-pattern>/basicclient</url-pattern>
+        <url-pattern>/basicclientrpc</url-pattern>
     </servlet-mapping>
     
     <service-ref>

Modified: labs/jbosstm/trunk/XTS/demo/jboss.properties
===================================================================
--- labs/jbosstm/trunk/XTS/demo/jboss.properties	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/jboss.properties	2008-04-14 10:44:28 UTC (rev 19546)
@@ -40,4 +40,11 @@
   <taxiBAURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUB/TaxiServiceBA</taxiBAURL>
   <theatreATURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUB/TheatreServiceAT</theatreATURL>
   <theatreBAURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUB/TheatreServiceBA</theatreBAURL>
+
+  <restaurantATRPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/RestaurantServiceAT</restaurantATRPCURL>
+  <restaurantBARPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/RestaurantServiceBA</restaurantBARPCURL>
+  <taxiATRPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/TaxiServiceAT</taxiATRPCURL>
+  <taxiBARPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/TaxiServiceBA</taxiBARPCURL>
+  <theatreATRPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/TheatreServiceAT</theatreATRPCURL>
+  <theatreBARPCURL>http://JBOSS_HOSTNAME:JBOSS_PORT/JBOSS_URLSTUBrpc/TheatreServiceBA</theatreBARPCURL>
 </arjuna>

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/client/BasicClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -29,11 +29,11 @@
 
 package com.jboss.jbosstm.xts.demo.client;
 
-import com.arjuna.mw.wst.UserBusinessActivity;
-import com.arjuna.mw.wst.UserBusinessActivityFactory;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserTransactionFactory;
-import com.arjuna.mw.wst.client.JaxWSHeaderContextProcessor;
+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 com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceAT;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceBA;

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceAT.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,8 +30,8 @@
 package com.jboss.jbosstm.xts.demo.services.restaurant;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.UserTransactionFactory;
+import com.arjuna.mw.wst11.TransactionManagerFactory;
+import com.arjuna.mw.wst11.UserTransactionFactory;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceAT;
 
 import javax.jws.HandlerChain;

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/restaurant/RestaurantServiceBA.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,9 +30,9 @@
 package com.jboss.jbosstm.xts.demo.services.restaurant;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.mw.wst11.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.wst11.BAParticipantManager;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.restaurant.IRestaurantServiceBA;
 

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceAT.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,8 +30,8 @@
 package com.jboss.jbosstm.xts.demo.services.taxi;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.UserTransactionFactory;
+import com.arjuna.mw.wst11.TransactionManagerFactory;
+import com.arjuna.mw.wst11.UserTransactionFactory;
 import com.jboss.jbosstm.xts.demo.taxi.ITaxiServiceAT;
 
 import javax.jws.WebService;

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/taxi/TaxiServiceBA.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,9 +30,9 @@
 package com.jboss.jbosstm.xts.demo.services.taxi;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.mw.wst11.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.wst11.BAParticipantManager;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.taxi.ITaxiServiceBA;
 

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceAT.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,8 +30,8 @@
 package com.jboss.jbosstm.xts.demo.services.theatre;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.TransactionManagerFactory;
-import com.arjuna.mw.wst.UserTransactionFactory;
+import com.arjuna.mw.wst11.TransactionManagerFactory;
+import com.arjuna.mw.wst11.UserTransactionFactory;
 import com.jboss.jbosstm.xts.demo.theatre.ITheatreServiceAT;
 
 import javax.jws.WebService;

Modified: labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/src/com/jboss/jbosstm/xts/demo/services/theatre/TheatreServiceBA.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -30,9 +30,9 @@
 package com.jboss.jbosstm.xts.demo.services.theatre;
 
 import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.mw.wst.BusinessActivityManagerFactory;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.wst.BAParticipantManager;
+import com.arjuna.mw.wst11.BusinessActivityManagerFactory;
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.wst11.BAParticipantManager;
 import com.arjuna.wst.SystemException;
 import com.jboss.jbosstm.xts.demo.theatre.ITheatreServiceBA;
 

Modified: labs/jbosstm/trunk/XTS/demo/srcrpc/com/arjuna/xts/nightout/clients/jboss/BasicClient.java
===================================================================
--- labs/jbosstm/trunk/XTS/demo/srcrpc/com/arjuna/xts/nightout/clients/jboss/BasicClient.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/srcrpc/com/arjuna/xts/nightout/clients/jboss/BasicClient.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,24 +1,24 @@
-/*
- * 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 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) 2005-2006,
- * @author JBoss Inc.
- */
 /*
+ * 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 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) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
  * BasicClient.java
  *
  * Copyright (c) 2003, 2004 Arjuna Technologies Ltd.
@@ -161,7 +161,7 @@
     public void init(final ServletConfig config)
         throws ServletException
     {
-        final String baseURL = "http://localhost:8080/xtsdemowebservices/" ;
+        final String baseURL = "http://localhost:8080/xtsdemowebservicesrpc/" ;
 
         restaurantATURL = getURL(config, "restaurantATURL", baseURL + "RestaurantServiceAT") ;
         restaurantBAURL = getURL(config, "restaurantBAURL", baseURL + "RestaurantServiceBA") ;

Modified: labs/jbosstm/trunk/XTS/demo/web/index.jsp
===================================================================
--- labs/jbosstm/trunk/XTS/demo/web/index.jsp	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/web/index.jsp	2008-04-14 10:44:28 UTC (rev 19546)
@@ -1,10 +1,10 @@
 <!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 $ -->
+<!-- $Id:$ -->
 
 <head>
-<title>XML Transaction Service Demo Application Client</title>
+<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">
@@ -17,13 +17,13 @@
   <tr>
     <td width="20">&nbsp;</td>
     <td align="center" width="170" bgcolor="#ffffff">
-      <img src="images/JBoss_DivOfRH_RGB.gif" alt="jboss logo" border="0">
+      <img src="images/JBoss_DivOfRH_RGB.gif" alt="arjuna 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
+        XML Transaction Service 1.1 Demonstrator Application
       </font>
     </td>
   </tr>

Added: labs/jbosstm/trunk/XTS/demo/web/indexrpc.jsp
===================================================================
--- labs/jbosstm/trunk/XTS/demo/web/indexrpc.jsp	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/demo/web/indexrpc.jsp	2008-04-14 10:44:28 UTC (rev 19546)
@@ -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_DivOfRH_RGB.gif" 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>
+


Property changes on: labs/jbosstm/trunk/XTS/demo/web/indexrpc.jsp
___________________________________________________________________
Name: svn:executable
   + *

Modified: labs/jbosstm/trunk/XTS/demo/xts-build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/demo/xts-build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/demo/xts-build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -54,20 +54,14 @@
     <!--  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                                                -->
+    <!--  as JaxWS endpoints. It employs the WS-COOR and WS-AT/BA 1.1       -->
+    <!--  protocol implementation of web services transactions              -->
 
-    <!--  target sa-build will build an ear file for the demo app for use   -->
-    <!--  with a remote coordinator. this contains the XTS code and config  -->
-    <!--  files bundled into an ear file to provide the client side         -->
-    <!--   services.                                                        -->
-
     <!--  target buildrpc will build an ear file for the demo app using     -->
-    <!--  JaxRPC to communicate between the demo client and services        -->
+    <!--  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                                         -->
 
-    <!--  target sa-buildrpc will build an ear file for the demo app for    -->
-    <!--  with a remote coordinator using JaxRPC to communicate between the -->
-    <!--  demo client and services                                          -->
-
     <!-- ================================================================== -->
 
     <xmlproperty file="${xmlpropertyfile}" keeproot="false"/>
@@ -79,19 +73,19 @@
     <property name="ext.dir" location="${lib.dir}/ext"/>
     <property name="jboss.client.lib.dir" location="${jboss.home}/client"/>
 
-    <property name="lib.libs" value="wstx.jar ws-t.jar ws-c.jar"/>
-    <property name="ext.libs" value="jbossjta.jar"/>
+    <property name="lib.libs" value="wscf.jar wstx.jar ws-t.jar ws-c.jar"/>
+    <property name="lib10.libs" value="wscf10.jar wstx10.jar ws-t10.jar ws-c10.jar"/>
+    <property name="lib11.libs" value="wscf11.jar wstx11.jar ws-t11.jar ws-c11.jar"/>
+    <property name="ext.libs" value="jbossjta.jar jbossts-common.jar commons-logging.jar jaxb-api.jar jboss-javaee.jar jboss-jaxrpc.jar jboss-jaxws-ext.jar jboss-jaxws.jar jbossws-client.jar jboss-saaj.jar"/>
     <property name="jboss.client.libs" value="jbossall-client.jar jboss-jaxws.jar"/>
-    <property name="ext.compile" value="${ext.libs} jaxrpc.jar servlet.jar"/>
 
-    <property name="ext.package" value="${ext.libs} jbossts-common.jar commons-logging-1.1.jar wstx-asl-2.0.3.jar stax-api-1.0.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="build.config" location="${build.dir}/config"/>
     <property name="build.soapconfig" location="${build.dir}/soapconfig"/>
 
@@ -99,10 +93,12 @@
     <property name="srcrpc.dir" location="srcrpc"/>
     <property name="ddrpc.dir" location="ddrpc"/>
     <property name="jboss.ddrpc.dir" location="${ddrpc.dir}/jboss"/>
+    <property name="build.jboss.ddrpc.dir" location="${buildrpc.dir}/dd/jboss"/>
     <property name="buildrpc.config" location="${buildrpc.dir}/config"/>
     <property name="buildrpc.soapconfig" location="${buildrpc.dir}/soapconfig"/>
 
     <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"/>
@@ -110,14 +106,32 @@
     <path id="lib.path">
         <fileset dir="${lib.dir}" includes="${lib.libs}"/>
     </path>
+    <path id="lib10.path">
+        <fileset dir="${lib.dir}" includes="${lib10.libs}"/>
+    </path>
+    <path id="lib11.path">
+        <fileset dir="${lib.dir}" includes="${lib11.libs}"/>
+    </path>
     <path id="ext.path">
-        <fileset dir="${ext.dir}" includes="${ext.compile}"/>
+        <fileset dir="${ext.dir}" includes="${ext.libs}"/>
     </path>
 
     <path id="jboss.client.path">
         <fileset dir="${jboss.client.lib.dir}" includes="${jboss.client.libs}"/>
     </path>
 
+    <filterset id="webxmlrpc.filter">
+        <filter token="restaurantATURL" value="${restaurantATRPCURL}"/>
+        <filter token="restaurantBAURL" value="${restaurantBARPCURL}"/>
+        <filter token="taxiATURL" value="${taxiATRPCURL}"/>
+        <filter token="taxiBAURL" value="${taxiBARPCURL}"/>
+        <filter token="theatreATURL" value="${theatreATRPCURL}"/>
+        <filter token="theatreBAURL" value="${theatreBARPCURL}"/>
+        <filter token="hostname" value="${hostname}"/>
+        <filter token="port" value="${port}"/>
+        <filter token="urlstub" value="${urlstub}rpc"/>
+    </filterset>
+
     <filterset id="webxml.filter">
         <filter token="restaurantATURL" value="${restaurantATURL}"/>
         <filter token="restaurantBAURL" value="${restaurantBAURL}"/>
@@ -150,11 +164,22 @@
             <path refid="jboss.client.path"/>
             <path refid="ext.path"/>
         </path>
+        <path id="compile10.path">
+            <path refid="lib10.path"/>
+            <path refid="jboss.client.path"/>
+            <path refid="ext.path"/>
+        </path>
+        <path id="compile11.path">
+            <path refid="lib11.path"/>
+            <path refid="jboss.client.path"/>
+            <path refid="ext.path"/>
+        </path>
     </target>
 
     <target name="init" depends="init-properties">
         <mkdir dir="${build.dir}"/>
         <mkdir dir="${build.dir}/classes"/>
+        <mkdir dir="${build.jboss.dd.dir}"/>
         <mkdir dir="${build.config}"/>
         <mkdir dir="${build.soapconfig}"/>
     </target>
@@ -162,6 +187,7 @@
     <target name="initrpc" depends="init-properties">
         <mkdir dir="${buildrpc.dir}"/>
         <mkdir dir="${buildrpc.dir}/classes"/>
+        <mkdir dir="${build.jboss.ddrpc.dir}"/>
         <mkdir dir="${buildrpc.config}"/>
         <mkdir dir="${buildrpc.soapconfig}"/>
     </target>
@@ -170,7 +196,7 @@
         <javac destdir="${buildrpc.dir}/classes" debug="${javac.debug}"
             optimize="${javac.optimize}" deprecation="${javac.deprecation}" >
             <classpath>
-                <path refid="compile.path"/>
+                <path refid="compile10.path"/>
             </classpath>
             <src path="${srcrpc.dir}"/>
             <patternset>
@@ -184,7 +210,7 @@
         <javac destdir="${build.dir}/classes" debug="${javac.debug}"
             optimize="${javac.optimize}" deprecation="${javac.deprecation}" >
             <classpath>
-                <path refid="compile.path"/>
+                <path refid="compile11.path"/>
             </classpath>
             <src path="${src.dir}"/>
             <patternset>
@@ -205,12 +231,27 @@
         <copy tofile="${build.dir}/classes/com/jboss/jbosstm/xts/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="com/jboss/jbosstm/xts/demo/services/**/*"/>
 	    </classes>
+	        <!-- generated server interfaces -->
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceAT.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceBA.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceAT.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceBA.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceAT.class"/>
+	    <classes dir="${build.dir}/classes/"
+		includes="com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceBA.class"/>
             <manifest>
-                <attribute name="Class-Path" value="${lib.libs}"/>
+                <attribute name="Class-Path" value="/WEB-INF/classes ${lib11.libs} ${lib.libs}"/>
             </manifest>
         </war>
     </target>
@@ -224,26 +265,9 @@
         <jar destfile="${build.dir}/config.jar" basedir="${build.config}"/>
     </target>
 
-    <target name="jboss-sa-webservices" depends="compile">
-        <copy tofile="${build.dir}/classes/com/jboss/jbosstm/xts/demo/services/context-handlers.xml"
-	      file="${jboss.dd.dir}/context-handlers.xml"/>
-	<war destfile="${build.dir}/xts-sa-demo-webservices.war" webxml="${jboss.dd.dir}/service-web-app.xml" >
-            <webinf dir="${jboss.dd.dir}" includes="webservices.xml wsdl/*.wsdl"/>
-	    <classes dir="${build.dir}/classes">
-	         <include name="com/jboss/jbosstm/xts/demo/services/**/*"/>
-	         <include name="com/jboss/jbosstm/xts/demo/restaurant/**/*"/>
-	         <include name="com/jboss/jbosstm/xts/demo/theatre/**/*"/>
-	         <include name="com/jboss/jbosstm/xts/demo/taxi/**/*"/>
-	    </classes>
-            <manifest>
-                <attribute name="Class-Path" value="${lib.libs} ${ext.package}"/>
-            </manifest>
-        </war>
-    </target>
-
     <target name="jboss-webservicesrpc" depends="compilerpc">
-        <war destfile="${buildrpc.dir}/xts-demo-webservices.war" webxml="${jboss.ddrpc.dir}/service-web-app.xml">
-            <webinf dir="${jboss.ddrpc.dir}" excludes="client-web-app.xml service-web-app.xml application-sa.xml application.xml client-jaxrpc-mapping.xml"/>
+        <war destfile="${buildrpc.dir}/xts-demo-webservicesrpc.war" webxml="${jboss.ddrpc.dir}/service-web-app.xml">
+            <webinf dir="${jboss.ddrpc.dir}" excludes="client-web-app.xml service-web-app.xml application.xml client-jaxrpc-mapping.xml"/>
             <classes dir="${buildrpc.dir}/classes">
                 <include name="com/arjuna/xts/nightout/services/**"/>
             </classes>
@@ -259,18 +283,6 @@
         <jar destfile="${buildrpc.dir}/config.jar" basedir="${buildrpc.config}"/>
     </target>
 
-    <target name="jboss-sa-webservicesrpc" depends="compilerpc">
-        <war destfile="${buildrpc.dir}/xts-sa-demo-webservices.war" webxml="${jboss.ddrpc.dir}/service-web-app.xml">
-            <webinf dir="${jboss.ddrpc.dir}" excludes="client-web-app.xml service-web-app.xml application-sa.xml application.xml client-jaxrpc-mapping.xml"/>
-            <classes dir="${buildrpc.dir}/classes">
-                <include name="com/arjuna/xts/nightout/services/**"/>
-            </classes>
-            <manifest>
-                <attribute name="Class-Path" value="${lib.libs} ${ext.package}"/>
-            </manifest>
-        </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">
@@ -278,133 +290,104 @@
         </copy>
 
         <war warfile="${build.dir}/xts-demo.war" webxml="${build.dir}/client-web-app.xml">
-            <classes dir="${build.dir}/classes">
-                <exclude name="com/jboss/jbosstm/xts/demo/services/**/*"/>
-            </classes>
-            <fileset dir="${web.dir}"/>
-            <webinf dir="${jboss.dd.dir}" includes="wsdl/**"/>
-        </war>
-    </target>
-
-    <target name="jboss-sa-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-sa-demo.war" webxml="${build.dir}/client-web-app.xml">
-            <classes dir="${build.dir}/classes">
-                <exclude name="com/jboss/jbosstm/xts/demo/services/**/*"/>
-            </classes>
-            <fileset dir="${web.dir}"/>
+	    <!-- include app wsdl and wscoor wsdl -->
+            <webinf dir="${jboss.dd.dir}" includes="wsdl/*.wsdl"/>
+	    <!-- impl classes -->
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/client/**"/>
+	    <!-- generated interfaces -->
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceAT.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/restaurant/IRestaurantServiceBA.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceAT.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/theatre/ITheatreServiceBA.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceAT.class"/>
+            <classes dir="${build.dir}/classes"
+                includes="com/jboss/jbosstm/xts/demo/taxi/ITaxiServiceBA.class"/>
+	    <!-- jsp files -->
+            <fileset dir="${web.dir}" excludes="indexrpc.jsp"/>
             <manifest>
-                <attribute name="Class-Path" value="${ext.package}"/>
+                <attribute name="Class-Path" value="wstx11.jar wstx.jar"/>
             </manifest>
-            <webinf dir="${jboss.dd.dir}" includes="wsdl/**"/>
         </war>
     </target>
 
     <target name="jboss-webapprpc" depends="compilerpc">
         <copy tofile="${buildrpc.dir}/client-web-app.xml" file="${jboss.ddrpc.dir}/client-web-app.xml">
-            <filterset refid="webxml.filter"/>
+            <filterset refid="webxmlrpc.filter"/>
         </copy>
 
-        <war warfile="${buildrpc.dir}/xts-demo.war" webxml="${buildrpc.dir}/client-web-app.xml">
-            <classes dir="${buildrpc.dir}/classes">
-                <exclude name="com/arjuna/xts/nightout/services/**/*"/>
-            </classes>
-            <fileset dir="${web.dir}"/>
-            <webinf dir="${jboss.ddrpc.dir}" includes="client-jaxrpc-mapping.xml wsdl/**"/>
-        </war>
-    </target>
-
-    <target name="jboss-sa-webapprpc" depends="compilerpc">
-        <copy tofile="${buildrpc.dir}/client-web-app.xml" file="${jboss.ddrpc.dir}/client-web-app.xml">
-            <filterset refid="webxml.filter"/>
+        <copy tofile="${build.web.dir}/index.jsp" file="${web.dir}/indexrpc.jsp">
+                <filterset refid="webxmlrpc.filter"/>
         </copy>
 
-        <war warfile="${buildrpc.dir}/xts-sa-demo.war" webxml="${buildrpc.dir}/client-web-app.xml">
+        <war warfile="${buildrpc.dir}/xts-demorpc.war" webxml="${buildrpc.dir}/client-web-app.xml">
             <classes dir="${buildrpc.dir}/classes">
                 <exclude name="com/arjuna/xts/nightout/services/**/*"/>
             </classes>
-            <fileset dir="${web.dir}"/>
-            <manifest>
-                <attribute name="Class-Path" value="${ext.package}"/>
-            </manifest>
-            <webinf dir="${jboss.ddrpc.dir}" includes="wsdl/** client-jaxrpc-mapping.xml"/>
+            <fileset dir="${web.dir}" excludes="index.jsp indexrpc.jsp"/>
+            <fileset dir="${build.web.dir}" includes="index.jsp"/>
+            <webinf dir="${jboss.ddrpc.dir}" includes="client-jaxrpc-mapping.xml wsdl/**"/>
         </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="${jboss.dd.dir}/application.xml">
+            appxml="${build.jboss.dd.dir}/application.xml">
             <fileset dir="${build.dir}" includes="xts-demo-webservices.war xts-demo.war"/>
         </ear>
     </target>
 
-    <target name="jboss-sa-ear" depends="jboss-sa-webservices, jboss-sa-webapp, config">
-        <ear earfile="${build.dir}/xts-sa-demo.ear"
-            appxml="${jboss.dd.dir}/application-sa.xml">
-            <fileset dir="${build.dir}" includes="xts-sa-demo-webservices.war xts-sa-demo.war config.jar ws-t.war ws-c.war"/>
-	        <fileset dir="${xts.home}/lib" includes="*.jar"/>
-	        <fileset dir="${xts.home}/lib/ext" includes="${ext.package}"/>
-	        <fileset dir="${xts.home}/webapps" includes="*.war" excludes="ws-t.war ws-c.war"/>
-        </ear>
-    </target>
-
     <target name="jboss-earrpc" depends="jboss-webservicesrpc, jboss-webapprpc">
-        <ear earfile="${buildrpc.dir}/xts-demo.ear"
-            appxml="${jboss.ddrpc.dir}/application.xml">
-            <fileset dir="${buildrpc.dir}" includes="xts-demo-webservices.war xts-demo.war"/>
+        <copy tofile="${build.jboss.ddrpc.dir}/application.xml" file="${jboss.ddrpc.dir}/application.xml">
+            <filterset refid="webxmlrpc.filter"/>
+        </copy>
+        <ear earfile="${buildrpc.dir}/xts-demorpc.ear"
+            appxml="${build.jboss.ddrpc.dir}/application.xml">
+            <fileset dir="${buildrpc.dir}" includes="xts-demo-webservicesrpc.war xts-demorpc.war"/>
         </ear>
     </target>
 
-    <target name="jboss-sa-earrpc" depends="jboss-sa-webservicesrpc, jboss-sa-webapprpc, configrpc">
-        <ear earfile="${buildrpc.dir}/xts-sa-demo.ear"
-            appxml="${jboss.ddrpc.dir}/application-sa.xml">
-            <fileset dir="${buildrpc.dir}" includes="xts-sa-demo-webservices.war xts-sa-demo.war config.jar ws-t.war ws-c.war"/>
-	        <fileset dir="${xts.home}/lib" includes="*.jar"/>
-	        <fileset dir="${xts.home}/lib/ext" includes="${ext.package}"/>
-	        <fileset dir="${xts.home}/webapps" includes="*.war" excludes="ws-t.war ws-c.war"/>
-        </ear>
-    </target>
-
     <target name="build" depends="jboss-ear"/>
 
-    <target name="sa-build" depends="jboss-sa-ear"/>
-
     <target name="buildrpc" depends="jboss-earrpc"/>
 
-    <target name="sa-buildrpc" depends="jboss-sa-earrpc"/>
-
     <target name="insertcfg" depends="init">
         <filter token="hostname" value="${hostname}"/>
         <filter token="port" value="${port}"/>
         <filter token="urlstub" value="${urlstub}"/>
 
-        <unjar src="${xts.home}/webapps/ws-c.war" dest="${build.dir}/tmp/ws-c"/>
+        <unjar src="${xts.home}/webapps/ws-c11.war" dest="${build.dir}/tmp/ws-c11"/>
 
-        <copy file="${xts.home}/coordinator/dd/ws-c_web-app.xml"
-            tofile="${build.dir}/tmp/ws-c/WEB-INF/web.xml" filtering="true" overwrite="true"/>
+        <copy file="${xts.home}/coordinator/dd/ws-c11_web-app.xml"
+            tofile="${build.dir}/tmp/ws-c11/WEB-INF/web.xml" filtering="true" overwrite="true"/>
 
-        <jar destfile="${build.dir}/ws-c.war" basedir="${build.dir}/tmp/ws-c" manifest="${build.dir}/tmp/ws-c/META-INF/MANIFEST.MF"/>
+        <jar destfile="${build.dir}/ws-c11.war" basedir="${build.dir}/tmp/ws-c11" manifest="${build.dir}/tmp/ws-c11/META-INF/MANIFEST.MF"/>
 
-        <delete dir="${build.dir}/tmp/ws-c"/>
+        <delete dir="${build.dir}/tmp/ws-c11"/>
 
-        <unjar src="${xts.home}/webapps/ws-t.war" dest="${build.dir}/tmp/ws-t"/>
+        <unjar src="${xts.home}/webapps/ws-t.war" dest="${build.dir}/tmp/ws-t11"/>
 
-        <copy file="${xts.home}/coordinator/dd/ws-t_web-app.xml"
-            tofile="${build.dir}/tmp/ws-t/WEB-INF/web.xml" filtering="true" overwrite="true"/>
+        <copy file="${xts.home}/coordinator/dd/ws-t11_web-app.xml"
+            tofile="${build.dir}/tmp/ws-t11/WEB-INF/web.xml" filtering="true" overwrite="true"/>
 
-        <jar destfile="${build.dir}/ws-t.war" basedir="${build.dir}/tmp/ws-t" manifest="${build.dir}/tmp/ws-t/META-INF/MANIFEST.MF"/>
+        <jar destfile="${build.dir}/ws-t11.war" basedir="${build.dir}/tmp/ws-t11" manifest="${build.dir}/tmp/ws-t11/META-INF/MANIFEST.MF"/>
 
-        <delete dir="${build.dir}/tmp/ws-t"/>
+        <delete dir="${build.dir}/tmp/ws-t11"/>
     </target>
 
     <target name="insertcfgrpc" depends="initrpc">
         <filter token="hostname" value="${hostname}"/>
         <filter token="port" value="${port}"/>
-        <filter token="urlstub" value="${urlstub}"/>
+        <filter token="urlstub" value="${urlstub}rpc"/>
 
         <unjar src="${xts.home}/webapps/ws-c.war" dest="${buildrpc.dir}/tmp/ws-c"/>
 
@@ -433,27 +416,11 @@
         <delete file="${deploy.dir}/xts-demo.ear"/>
     </target>
 
-    <target name="sa-deploy" depends="sa-build, undeploy">
-        <copy file="${build.dir}/xts-sa-demo.ear" tofile="${deploy.dir}/xts-sa-demo.ear"/>
-    </target>
-
-    <target name="sa-undeploy">
-        <delete file="${deploy.dir}/xts-sa-demo.ear"/>
-    </target>
-
     <target name="deployrpc" depends="buildrpc, undeployrpc">
-        <copy file="${buildrpc.dir}/xts-demo.ear" tofile="${deploy.dir}/xts-demo.ear"/>
+        <copy file="${buildrpc.dir}/xts-demorpc.ear" tofile="${deploy.dir}/xts-demorpc.ear"/>
     </target>
 
     <target name="undeployrpc">
-        <delete file="${deploy.dir}/xts-demo.ear"/>
+        <delete file="${deploy.dir}/xts-demorpc.ear"/>
     </target>
-
-    <target name="sa-deployrpc" depends="sa-buildrpc, sa-undeployrpc">
-        <copy file="${buildrpc.dir}/xts-sa-demo.ear" tofile="${deploy.dir}/xts-sa-demo.ear"/>
-    </target>
-
-    <target name="sa-undeployrpc">
-        <delete file="${deploy.dir}/xts-sa-demo.ear"/>
-    </target>
 </project>

Deleted: labs/jbosstm/trunk/XTS/ext/glue.jar
===================================================================
(Binary files differ)

Added: labs/jbosstm/trunk/XTS/ext/jaxb-api.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jaxb-api.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbosstm/trunk/XTS/ext/jaxrpc.jar
===================================================================
(Binary files differ)

Deleted: labs/jbosstm/trunk/XTS/ext/jaxws-2_1-mrel2-api.jar
===================================================================
(Binary files differ)

Added: labs/jbosstm/trunk/XTS/ext/jboss-javaee.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jboss-javaee.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/trunk/XTS/ext/jboss-jaxrpc.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jboss-jaxrpc.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/trunk/XTS/ext/jboss-jaxws-ext.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jboss-jaxws-ext.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/trunk/XTS/ext/jboss-jaxws.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jboss-jaxws.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/trunk/XTS/ext/jboss-saaj.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jboss-saaj.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/trunk/XTS/ext/jbossws-client.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/trunk/XTS/ext/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Deleted: labs/jbosstm/trunk/XTS/ext/saaj-api.jar
===================================================================
(Binary files differ)

Deleted: labs/jbosstm/trunk/XTS/ext/servlet.jar
===================================================================
(Binary files differ)

Deleted: labs/jbosstm/trunk/XTS/ext/stax-api-1.0.jar
===================================================================
(Binary files differ)

Deleted: labs/jbosstm/trunk/XTS/ext/wstx-asl-2.0.3.jar
===================================================================
(Binary files differ)

Added: labs/jbosstm/trunk/XTS/sar/META-INF/application.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/META-INF/application.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/META-INF/application.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,87 @@
+<!--
+  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 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) 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 1.0 and 1.1 deployment config</display-name>
+
+    <description>XML Transaction Service 1.0 and 1.1 deployment config</description>
+
+    <module>
+        <web>
+            <web-uri>ws-c10.war</web-uri>
+            <context-root>/ws-c10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>ws-t10.war</web-uri>
+            <context-root>/ws-t10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wscf10.war</web-uri>
+            <context-root>/wscf10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wstx10.war</web-uri>
+            <context-root>/wstx10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>ws-c11.war</web-uri>
+            <context-root>/ws-c11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>ws-t11.war</web-uri>
+            <context-root>/ws-t11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wscf11.war</web-uri>
+            <context-root>/wscf11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wstx11.war</web-uri>
+            <context-root>/wstx11</context-root>
+        </web>
+    </module>
+
+</application>


Property changes on: labs/jbosstm/trunk/XTS/sar/META-INF/application.xml
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbosstm/trunk/XTS/sar/META-INF/application10.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/META-INF/application10.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/META-INF/application10.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+<!--
+  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 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) 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 1.0 deployment config</display-name>
+
+    <description>XML Transaction Service 1.0 deployment config</description>
+
+    <module>
+        <web>
+            <web-uri>ws-c10.war</web-uri>
+            <context-root>/ws-c10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>ws-t10.war</web-uri>
+            <context-root>/ws-t10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wscf10.war</web-uri>
+            <context-root>/wscf10</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wstx10.war</web-uri>
+            <context-root>/wstx10</context-root>
+        </web>
+    </module>
+
+</application>

Added: labs/jbosstm/trunk/XTS/sar/META-INF/application11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/META-INF/application11.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/sar/META-INF/application11.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -0,0 +1,59 @@
+<!--
+  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 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) 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 1.1 deployment config</display-name>
+
+    <description>XML Transaction Service 1.1 deployment config</description>
+
+    <module>
+        <web>
+            <web-uri>ws-c11.war</web-uri>
+            <context-root>/ws-c11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>ws-t11.war</web-uri>
+            <context-root>/ws-t11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wscf11.war</web-uri>
+            <context-root>/wscf11</context-root>
+        </web>
+    </module>
+
+    <module>
+        <web>
+            <web-uri>wstx11.war</web-uri>
+            <context-root>/wstx11</context-root>
+        </web>
+    </module>
+
+</application>

Modified: labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/sar/WEB-INF/web.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -12,7 +12,7 @@
      -->
     <init-param>
         <param-name>BaseHttpURI</param-name>
-        <param-value>http://@hostname@:@port@/jbossxts/soap/</param-value>
+        <param-value>http://@hostname@:@port@/ws-c/soap/</param-value>
     </init-param>
     <!--
     <init-param>

Modified: labs/jbosstm/trunk/XTS/sar/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/sar/build.xml	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/sar/build.xml	2008-04-14 10:44:28 UTC (rev 19546)
@@ -54,11 +54,15 @@
     </fail>
 
     <property name="lib.dir" location="${xts.home}/lib"/>
+    <property name="webapps.dir" location="${xts.home}/webapps"/>
+    <property name="conf.dir" location="${xts.home}/conf"/>
     <property name="ext.dir" location="${lib.dir}/ext"/>
 
     <property name="webinf.dir"         value="WEB-INF"/>
+    <property name="metainf.dir"         value="META-INF"/>
     <property name="build.dir"         value="build"/>
     <property name="build.webinf.dir"       value="${build.dir}/WEB-INF"/>
+    <property name="build.metainf.dir"       value="${build.dir}/META-INF"/>
 
     <!-- enable debugging of XTS service code -->
 
@@ -68,77 +72,202 @@
         <delete dir="${build.dir}"/>
         <mkdir dir="${build.dir}"/>
         <mkdir dir="${build.webinf.dir}"/>
+        <mkdir dir="${build.metainf.dir}"/>
     </target>
 
     <!-- TODO are the xts engine and its WS stack conceptually separate deployments? at what level do they integrate? spi or jax-ws?-->
-    <target name="sar" depends="init">
 
-      <!--
-	  as a jbossas component we would like to use just the
-	  integration jar here. however it does not contain some stuff
-	  we need e.g. rmi, system, logger classes etc, so we pick up
-	  jbossall-client instead. also, pending some refactoring in
-	  the AS we still depend upon class
-	  org.jboss.system.ServiceMBeanSupport which is not in the
-	  integration/client jars. we can find it in the lib dir in
-	  jboss-system-jmx.jar.
-      -->
-      <!--
+    <!-- by default build XTS service archive supporting 1.1 WS-C/T protocols -->
+    <target name="sar" depends="sar-11"/>
+
+    <!-- build XTS service archive supporting both 1.0 and 1.1 WS-C/T protocols -->
+    <target name="sar-both" depends="init">
+
+        <!--
+        as a jbossas component we would like to use just the
+	    integration jar here. however it does not contain some stuff
+	    we need e.g. rmi, system, logger classes etc, so we pick up
+	    jbossall-client instead. also, pending some refactoring in
+	    the AS we still depend upon class
+	    org.jboss.system.ServiceMBeanSupport which is not in the
+	    integration/client jars. we can find it in the lib dir in
+	    jboss-system-jmx.jar.
+        -->
         <javac srcdir="src" destdir="${build.dir}" debug="${javac.debug}">
             <classpath>
-                <pathelement location="${jbossas.home}/lib/jboss-common.jar"/>
-                <pathelement location="${jbossas.home}/lib/jboss-system.jar"/>
-                <pathelement location="${jbossas.home}/lib/jboss-jmx.jar"/>
-                <fileset dir="${lib.dir}" includes="*.jar"/>
+                <pathelement location="${jbossas.home}/client/jbossall-client.jar"/>
+                <pathelement location="${jbossas.home}/lib/jboss-system-jmx.jar"/>
+                <!-- sar code only depends on generic XTS code -->
+                <fileset dir="${lib.dir}" includes="*.jar" excludes="*10.jar *11.jar"/>
                 <fileset dir="${lib.dir}/ext" includes="jbossjta.jar jbossts-common.jar"/>
             </classpath>
         </javac>
-	-->
+
+        <!-- create config jar containing conf files for 1.0 and 1.1 -->
+        <jar jarfile="${build.dir}/config.jar">
+            <fileset dir="${conf.dir}" includes="*.xml"/>
+        </jar>
+        <!-- substitute host and port in ws-c/ws-t deployment descriptors -->
+        <!-- !! todo still need to do this a la insertcfg in old demo code !!  -->
+
+        <!-- copy 11 and 1.0 application.xml to build dir -->
+        <copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application.xml"/>
+
+        <!-- pack everything in the service archive -->
+        <jar jarfile="${build.dir}/jbossxts.sar">
+            <!-- include generic 1.0 and 1.1 jars -->
+            <fileset dir="${lib.dir}" includes="*.jar"/>
+
+            <!-- include 1.0 and 1.1 web apps all config files are included -->
+            <!-- !! need to pick up substituted versions !! -->
+            <fileset dir="${webapps.dir}" includes="*.war"/>
+
+            <!-- include config jar -->
+            <fileset dir="${build.dir}" includes="config.jar"/>
+
+            <!-- include service def (e.g. dependencies) -->
+            <fileset dir="." includes="META-INF/jboss-service.xml"/>
+
+            <!-- include web service config -->
+            <fileset dir="${build.dir}" includes="META-INF/application.xml"/>
+
+            <!-- include sar boot and shutdown code -->
+            <fileset dir="${build.dir}" includes="**/*.class"/>
+        </jar>
+    </target>
+
+    <!-- build XTS service archive supporting 1.1 WS-C/T protocols -->
+    <target name="sar-11" depends="init">
+
+        <!--
+        as a jbossas component we would like to use just the
+	    integration jar here. however it does not contain some stuff
+	    we need e.g. rmi, system, logger classes etc, so we pick up
+	    jbossall-client instead. also, pending some refactoring in
+	    the AS we still depend upon class
+	    org.jboss.system.ServiceMBeanSupport which is not in the
+	    integration/client jars. we can find it in the lib dir in
+	    jboss-system-jmx.jar.
+        -->
         <javac srcdir="src" destdir="${build.dir}" debug="${javac.debug}">
             <classpath>
                 <pathelement location="${jbossas.home}/client/jbossall-client.jar"/>
                 <pathelement location="${jbossas.home}/lib/jboss-system-jmx.jar"/>
-                <!-- XTS -->
-                <fileset dir="${lib.dir}" includes="*.jar"/>
+                <!-- sar code only depends on generic XTS code -->
+                <fileset dir="${lib.dir}" includes="*.jar" excludes="*10.jar *11.jar"/>
                 <fileset dir="${lib.dir}/ext" includes="jbossjta.jar jbossts-common.jar"/>
             </classpath>
         </javac>
 
-	<!-- substitute host and port in deployment descriptor -->
-        <filter token="hostname" value="${hostname}"/>
-        <filter token="port" value="${port}"/>
-	<copy file="${webinf.dir}/web.xml" tofile="${build.webinf.dir}/web.xml" filtering="true"/>
-
-	<!-- build the war containing the XTS HTTP multiplexor -->
-
-        <jar jarfile="${build.dir}/jbossxts.war">
-            <fileset dir="${build.dir}" includes="WEB-INF/web.xml"/>
+        <!-- create config jar containing conf files for 1.1 -->
+        <jar jarfile="${build.dir}/config.jar">
+            <fileset dir="${conf.dir}" includes="*11.xml"/>
         </jar>
+        <!-- substitute host and port in ws-c/ws-t deployment descriptors -->
+        <!-- !! todo still need to do this a la insertcfg in old demo code !!  -->
 
+        <!-- copy 11 application.xml to build dir -->
+        <copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application11.xml"/>
+        
+        <!-- pack everything in the service archive -->
         <jar jarfile="${build.dir}/jbossxts.sar">
-            <fileset dir="${lib.dir}" includes="*.jar"/>
+            <!-- include generic and 1.1 jars -->
+            <fileset dir="${lib.dir}" includes="*.jar" excludes="*10.jar"/>
 
+            <!-- include 1.1 web apps all config files are included -->
+            <!-- !! todo need to pick up substituted versions !! -->
+            <fileset dir="${webapps.dir}" includes="*11.war"/>
+
+            <!-- include config jar -->
+            <fileset dir="${build.dir}" includes="config.jar"/>
+
+            <!-- include service def (e.g. dependencies) -->
             <fileset dir="." includes="META-INF/jboss-service.xml"/>
+
+            <!-- include web service config -->
+            <fileset dir="${build.dir}" includes="META-INF/application.xml"/>
+
+            <!-- include sar boot and shutdown code -->
             <fileset dir="${build.dir}" includes="**/*.class"/>
+        </jar>
+    </target>
 
-            <fileset dir="${build.dir}" includes="jbossxts.war"/>
+    <!-- build XTS service archive supporting 1.0 WS-C/T protocols -->
+    <target name="sar-10" depends="init">
 
-            <!-- AS /lib supplies servlet.jar, jbossjta.jar, commons-logging.jar, jbossts-common.jar
-                saaj-api.jar, jaxrpc.jar.  stax is in jbossws.sar but not server /lib    -->
-            <fileset dir="${ext.dir}" includes="stax-api-1.0.jar wstx-asl-2.0.3.jar"/>
+        <!--
+        as a jbossas component we would like to use just the
+	    integration jar here. however it does not contain some stuff
+	    we need e.g. rmi, system, logger classes etc, so we pick up
+	    jbossall-client instead. also, pending some refactoring in
+	    the AS we still depend upon class
+	    org.jboss.system.ServiceMBeanSupport which is not in the
+	    integration/client jars. we can find it in the lib dir in
+	    jboss-system-jmx.jar.
+        -->
+        <javac srcdir="src" destdir="${build.dir}" debug="${javac.debug}">
+            <classpath>
+                <pathelement location="${jbossas.home}/client/jbossall-client.jar"/>
+                <pathelement location="${jbossas.home}/lib/jboss-system-jmx.jar"/>
+                <!-- sar only depends on generic XTS code -->
+                <fileset dir="${lib.dir}" includes="*.jar" excludes="*10.jar *11.jar"/>
+                <fileset dir="${lib.dir}/ext" includes="jbossjta.jar jbossts-common.jar"/>
+            </classpath>
+        </javac>
 
-            <fileset dir="." includes="jbossxts.xml"/>
+        <!-- create config jar containing conf files for 1.0 -->
+        <jar jarfile="${build.dir}/config.jar">
+            <fileset dir="${conf.dir}" includes="*.xml" excludes="*11.xml"/>
         </jar>
+        <!-- substitute host and port in ws-c/ws-t deployment descriptors -->
+        <!-- !! todo still need to do this a la insertcfg in old demo code !!  -->
+
+        <!-- copy 10 application.xml to build dir -->
+        <copy toFile="${build.metainf.dir}/application.xml" file="${metainf.dir}/application10.xml"/>
+
+        <!-- pack everything in the servcie archive -->
+        <jar jarfile="${build.dir}/jbossxts.sar">
+            <!-- include generic and 1.0 jars -->
+            <fileset dir="${lib.dir}" includes="*.jar" excludes="*11.jar"/>
+
+            <!-- include 1.0 web apps all config files are included -->
+            <!-- !! need to pick up substituted versions !! -->
+            <fileset dir="${webapps.dir}" includes="*10.war"/>
+
+            <!-- include config jar -->
+            <fileset dir="${build.dir}" includes="config.jar"/>
+
+            <!-- include service def (e.g. dependencies) -->
+            <fileset dir="." includes="META-INF/jboss-service.xml"/>
+
+            <!-- include web service config -->
+            <fileset dir="${build.dir}" includes="META-INF/application.xml"/>
+
+            <!-- include sar boot and shutdown code -->
+            <fileset dir="${build.dir}" includes="**/*.class"/>
+        </jar>
     </target>
 
     <target name="clean">
       <delete dir="${build.dir}"/>
     </target>
 
-    <target name="deploy" depends="sar">
+    <target name="deploy11" depends="undeploy, sar-11">
         <copy file="${build.dir}/jbossxts.sar" todir="${jbossas.home}/server/default/deploy"/>
     </target>
 
+    <target name="deploy10" depends="undeploy, sar-10">
+        <copy file="${build.dir}/jbossxts.sar" todir="${jbossas.home}/server/default/deploy"/>
+    </target>
+
+    <target name="deployboth" depends="undeploy,sar-both">
+        <copy file="${build.dir}/jbossxts.sar" todir="${jbossas.home}/server/default/deploy"/>
+    </target>
+
+    <!-- by default deploy sar implementing 1.1. WS-C/T protocols -->
+    <target name="deploy" depends="deploy11">
+    </target>
+
     <target name="undeploy">
         <delete file="${jbossas.home}/server/default/deploy/jbossxts.sar"/>
     </target>

Modified: labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java
===================================================================
--- labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java	2008-04-14 08:50:15 UTC (rev 19545)
+++ labs/jbosstm/trunk/XTS/sar/src/org/jboss/transactions/XTSService.java	2008-04-14 10:44:28 UTC (rev 19546)
@@ -25,55 +25,55 @@
 import org.jboss.transactions.xts.recovery.ACCoordinatorRecoveryModule;
 
 import com.arjuna.mw.wsas.utils.Configuration;
-import com.arjuna.mw.wst.deploy.WSTXInitialisation;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserBusinessActivity;
-import com.arjuna.mw.wst.BusinessActivityManager;
-import com.arjuna.wsc.ContextFactoryMapper;
-import com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl;
-import com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl;
-import com.arjuna.mwlabs.wsc.ContextFactoryMapperImple;
+//import com.arjuna.mw.wst.deploy.WSTXInitialisation;
+//import com.arjuna.mw.wst.UserTransaction;
+//import com.arjuna.mw.wst.TransactionManager;
+//import com.arjuna.mw.wst.UserBusinessActivity;
+//import com.arjuna.mw.wst.BusinessActivityManager;
+//import com.arjuna.wsc.ContextFactoryMapper;
+//import com.arjuna.wsc.messaging.ActivationCoordinatorProcessorImpl;
+//import com.arjuna.wsc.messaging.RegistrationCoordinatorProcessorImpl;
+//import com.arjuna.mwlabs.wsc.ContextFactoryMapperImple;
 import com.arjuna.services.framework.task.TaskManager;
-import com.arjuna.webservices.HandlerRegistry;
-import com.arjuna.webservices.SoapRegistry;
-import com.arjuna.webservices.SoapService;
-import com.arjuna.webservices.SoapClient;
-import com.arjuna.webservices.util.ClassLoaderHelper;
-import com.arjuna.webservices.wsba.policy.CoordinatorCompletionCoordinatorPolicy;
-import com.arjuna.webservices.wsba.policy.CoordinatorCompletionParticipantPolicy;
-import com.arjuna.webservices.wsba.policy.ParticipantCompletionCoordinatorPolicy;
-import com.arjuna.webservices.wsba.policy.ParticipantCompletionParticipantPolicy;
-import com.arjuna.webservices.wsba.BusinessActivityConstants;
-import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessor;
-import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessor;
-import com.arjuna.webservices.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
-import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessor;
-import com.arjuna.webservices.wsat.policy.CompletionCoordinatorPolicy;
-import com.arjuna.webservices.wsat.policy.CompletionInitiatorPolicy;
-import com.arjuna.webservices.wsat.policy.CoordinatorPolicy;
-import com.arjuna.webservices.wsat.policy.ParticipantPolicy;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
-import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
-import com.arjuna.webservices.wsat.processors.CoordinatorProcessor;
-import com.arjuna.webservices.wsarjtx.policy.TerminationParticipantPolicy;
-import com.arjuna.webservices.wsarjtx.policy.TerminationCoordinatorPolicy;
-import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
-import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
-import com.arjuna.webservices.transport.http.HttpClient;
-import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
-import com.arjuna.webservices.wscoor.policy.ActivationCoordinatorPolicy;
-import com.arjuna.webservices.wscoor.policy.ActivationRequesterPolicy;
-import com.arjuna.webservices.wscoor.policy.RegistrationCoordinatorPolicy;
-import com.arjuna.webservices.wscoor.policy.RegistrationRequesterPolicy;
-import com.arjuna.webservices.wscoor.CoordinationConstants;
-import com.arjuna.webservices.wscoor.processors.ActivationCoordinatorProcessor;
-import com.arjuna.webservices.wscoor.processors.RegistrationCoordinatorProcessor;
-import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
-import com.arjuna.wst.messaging.*;
+//import com.arjuna.webservices.HandlerRegistry;
+//import com.arjuna.webservices.SoapRegistry;
+//import com.arjuna.webservices.SoapService;
+//import com.arjuna.webservices.SoapClient;
+//import com.arjuna.webservices.util.ClassLoaderHelper;
+//import com.arjuna.webservices.wsba.policy.CoordinatorCompletionCoordinatorPolicy;
+//import com.arjuna.webservices.wsba.policy.CoordinatorCompletionParticipantPolicy;
+//import com.arjuna.webservices.wsba.policy.ParticipantCompletionCoordinatorPolicy;
+//import com.arjuna.webservices.wsba.policy.ParticipantCompletionParticipantPolicy;
+//import com.arjuna.webservices.wsba.BusinessActivityConstants;
+//import com.arjuna.webservices.wsba.processors.CoordinatorCompletionParticipantProcessor;
+//import com.arjuna.webservices.wsba.processors.ParticipantCompletionParticipantProcessor;
+//import com.arjuna.webservices.wsba.processors.CoordinatorCompletionCoordinatorProcessor;
+//import com.arjuna.webservices.wsba.processors.ParticipantCompletionCoordinatorProcessor;
+//import com.arjuna.webservices.wsat.policy.CompletionCoordinatorPolicy;
+//import com.arjuna.webservices.wsat.policy.CompletionInitiatorPolicy;
+//import com.arjuna.webservices.wsat.policy.CoordinatorPolicy;
+//import com.arjuna.webservices.wsat.policy.ParticipantPolicy;
+//import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+//import com.arjuna.webservices.wsat.processors.CompletionCoordinatorProcessor;
+//import com.arjuna.webservices.wsat.processors.ParticipantProcessor;
+//import com.arjuna.webservices.wsat.processors.CoordinatorProcessor;
+//import com.arjuna.webservices.wsarjtx.policy.TerminationParticipantPolicy;
+//import com.arjuna.webservices.wsarjtx.policy.TerminationCoordinatorPolicy;
+//import com.arjuna.webservices.wsarjtx.ArjunaTXConstants;
+//import com.arjuna.webservices.wsarjtx.processors.TerminationCoordinatorProcessor;
+//import com.arjuna.webservices.transport.http.HttpClient;
+//import com.arjuna.webservices.wsarj.policy.ArjunaPolicy;
+//import com.arjuna.webservices.wscoor.policy.ActivationCoordinatorPolicy;
+//import com.arjuna.webservices.wscoor.policy.ActivationRequesterPolicy;
+//import com.arjuna.webservices.wscoor.policy.RegistrationCoordinatorPolicy;
+//import com.arjuna.webservices.wscoor.policy.RegistrationRequesterPolicy;
+//import com.arjuna.webservices.wscoor.CoordinationConstants;
+//import com.arjuna.webservices.wscoor.processors.ActivationCoordinatorProcessor;
+//import com.arjuna.webservices.wscoor.processors.RegistrationCoordinatorProcessor;
+//import com.arjuna.webservices.wsaddr.policy.AddressingPolicy;
+//import com.arjuna.wst.messaging.*;
 import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.recovery.RecoveryModule;
+//import com.arjuna.ats.arjuna.recovery.RecoveryModule;
 
 import java.io.InputStream;
 
@@ -106,11 +106,17 @@
 
     protected void startService() throws Exception
     {
-        getLog().info("JBossTS XTS Transaction Service - starting");
 
         // read unified properties file (replaces wscf.xml and wstx.xml)
-        Configuration.initialise("/jbossxts.xml");
+        // Configuration.initialise("/jbossxts.xml");
 
+        TaskManagerInitialisation(); // com.arjuna.services.framework.admin.TaskManagerInitialisation : initialise the Task Manager
+
+        /*
+         * initialisation is done by 1.0/1.1 war files so as to allow us to iunclude either WS-COOR/AT/BA 1.0 or 1.1
+         * or both
+         */
+        /*
         //// wscf.war:
 
         WSCFInitialisation();  // com.arjuna.mw.wsc.deploy.WSCFInitialisation: Initialise WSCF
@@ -146,6 +152,7 @@
         //// wstx.war:
 
         WSTXInitialisation(); // com.arjuna.mw.wst.deploy.WSTXInitialisation : Initialise WSTX
+        */
 
         acCoordinatorRecoveryModule = new ACCoordinatorRecoveryModule();
 
@@ -171,13 +178,24 @@
         }
         TaskManager.getManager().shutdown() ; // com.arjuna.services.framework.admin.TaskManagerInitialisation
 
+        /*
+         * this will be done by the servlet shutdown code
         // HttpClientInitialisation
         final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
         soapRegistry.removeSoapClient("http") ;
         soapRegistry.removeSoapClient("https") ;
+        */
     }
 
+    private void TaskManagerInitialisation()
+    {
+        final TaskManager taskManager = TaskManager.getManager() ;
+        taskManager.setMinimumWorkerCount(taskManagerMinWorkerCount) ;
+        taskManager.setMaximumWorkerCount(taskManagerMaxWorkerCount) ;
+    }
 
+    /*
+     * this is now done by war listeners -- see above for rationale
     ///////////////////////////////
 
     private void WSCFInitialisation() throws Exception
@@ -403,4 +421,5 @@
         final SoapRegistry soapRegistry = SoapRegistry.getRegistry() ;
         soapRegistry.registerSoapService(serviceName, new SoapService(handlerRegistry)) ;
     }
+    */
 }
\ No newline at end of file




More information about the jboss-svn-commits mailing list